Telegram Cloud Drive

Telegram Cloud Drive
A self-hosted personal cloud storage system that turns a private Telegram channel into effectively unlimited file storage, paired with a self-hosted PostgreSQL database for metadata and a Next.js web dashboard for browsing, searching, and streaming.
Key Features
- Unlimited storage backend: files are stored as messages in a private Telegram channel; only lightweight metadata (titles, tags, sizes, message pointers) lives in PostgreSQL.
- Automatic indexing: a Telegram bot indexes new channel posts in real time via a caption-based contract, with inline indexing for files dropped directly to the bot.
- Optimistic web dashboard: grid/list browsing, search, favorites, trash/restore, folders, tag library, and light/dark mode, with optimistic UI updates that reconcile with the server in the background.
- Automated daily backups: the bot runs nightly
pg_dumpbackups of the metadata database, compresses them, and uploads them to the storage channel, auto-indexed for recovery. - Flexible uploads: resumable browser uploads (single file, multi-file, or full folder), Bot Drop via Telegram DM, and a host-path picker for local uploads.
- PikPak remote-download integration: pulls files from a PikPak (rclone) remote directly into the storage pipeline via Telegram bot commands, with live progress tracking and inline-button browsing.
- YouTube-style video streaming: HTTP range-request streaming with disk caching, plus background transcoding to a compressed H.264 copy for bandwidth savings on repeat views.
- Additional polish: WebP thumbnails, case-insensitive tags, soft-delete with 7-day purge, and shared-password authentication.
Architecture
Four independent processes communicate only through PostgreSQL tables: a Next.js 15 / React 19 web dashboard (deployable on Vercel or self-hosted), a Python bot (python-telegram-bot, Telethon, FastAPI) handling indexing and downloads, a watcher process executing the upload queue via MTProto, and a dedicated streamer service for video range-streaming and compression. The stack is containerized with Docker Compose, with automated setup scripts for both Linux VPS and Windows environments.
Tech Stack
Next.js 15, React 19, TailwindCSS, Python 3.11, python-telegram-bot, Telethon, FastAPI, PostgreSQL, Docker/Docker Compose.
Role
Sole developer: designed the multi-process architecture, built the Telegram-backed storage pipeline, the PostgreSQL schema, the streaming/compression service, and the Next.js dashboard, plus deployment automation for both server and laptop environments.