Loading repository data…
Loading repository data…
fbpatel003 / repository
TGDrive turns your Telegram account into unlimited cloud storage — directly in your browser. No server, no subscription, no storage limit. Files are stored permanently on Telegram's infrastructure using the official MTProto API.
Unlimited cloud storage — powered by your Telegram account
Live Demo · Report Bug · Request Feature
| Login | Drive |
|---|---|
| Upload | Preview |
|---|---|
TGDrive turns your Telegram account into unlimited cloud storage — directly in your browser. No server, no subscription, no storage limit. Files are stored permanently on Telegram's infrastructure using the official MTProto API.
[TGDrive]Your Browser
├── React UI
├── GramJS (MTProto client — same protocol as official Telegram app)
├── IndexedDB (session, credentials, file metadata cache)
└── Direct WebSocket ──► Telegram MTProto servers
└── Your files stored here permanently
Folders are private Telegram channels prefixed with [TGDrive]. Files are sent as document attachments with a JSON caption carrying the original filename, size, MIME type, and upload timestamp — so metadata is always accurate regardless of how Telegram processes the file.
Just visit fbpatel003.github.io/tgdrive — no installation needed.
# Clone the repo
git clone https://github.com/fbpatel003/tgdrive.git
cd tgdrive
# Install dependencies
npm install
# Start dev server
npm run dev
Open http://localhost:5173, enter your API credentials, and sign in.
| Layer | Technology |
|---|---|
| UI Framework | React 18 + TypeScript |
| Build Tool | Vite 8 |
| Telegram Client | GramJS (MTProto) |
| Local Storage | Dexie.js (IndexedDB) |
| Styling | Tailwind CSS + DaisyUI (night theme) |
| Icons | Lucide React |
| Routing | React Router v6 |
| Server State | TanStack Query |
| Deployment | GitHub Pages + GitHub Actions |
tgdrive/
├── public/
│ ├── favicon.svg # SVG favicon
│ ├── favicon.ico # ICO favicon (16×16, 32×32)
│ ├── favicon-192.png # Apple touch icon
│ └── 404.html # GitHub Pages SPA redirect
├── src/
│ ├── lib/
│ │ ├── db.ts # Dexie IndexedDB schema
│ │ ├── telegram.ts # GramJS client singleton + PersistentSession
│ │ ├── drive.ts # All drive operations (folders, files, upload, download)
│ │ └── streamVideo.ts # MediaSource API video streaming
│ ├── hooks/
│ │ └── useAuth.tsx # Auth state context
│ ├── components/
│ │ ├── Navbar.tsx
│ │ ├── UploadModal.tsx # Drag-drop upload with progress
│ │ ├── NewFolderModal.tsx
│ │ ├── PreviewModal.tsx # Image + streaming video preview
│ │ └── AdBanner.tsx # Google AdSense banner
│ ├── pages/
│ │ ├── LoginPage.tsx # Landing page + 3-step login flow
│ │ └── DrivePage.tsx # Folder grid + file table
│ └── App.tsx # Router with auth guard
├── .github/workflows/
│ └── deploy.yml # GitHub Actions → GitHub Pages
├── vite.config.ts
└── index.html
| Concern | How TGDrive handles it |
|---|---|
| API credentials | Stored only in your browser's IndexedDB. Never transmitted to any TGDrive server (there is none). |
| Telegram session | Stored in IndexedDB. Automatically kept in sync with Telegram's auth key to prevent session errors. |
| File data | Goes directly from your browser to Telegram's servers via WebSocket. Never touches a TGDrive server. |
| Who can see your files | Only you. Folders are private Telegram channels on your account. |
| If you clear browser data | Session lost, files safe. Log in again and everything reappears. |
TGDrive has no backend server. The author never sees your credentials, session, or files.
video/mp4 and video/webm. Other formats fall back to full download before playbackThe repo includes a GitHub Actions workflow that builds and deploys automatically on every push to main.
main — the workflow runs automaticallyhttps://yourusername.github.io/tgdrive/The base path is detected automatically from GITHUB_REPOSITORY — no config needed.
Contributions are welcome. Open an issue first to discuss what you'd like to change.
git checkout -b feature/your-feature
git commit -m "add: your feature"
git push origin feature/your-feature
# open a Pull Request
MIT — see LICENSE for details.
Built by Fenil · Star ⭐ if you find it useful