Skip to content

TeleDrive is a full-stack application that transforms Telegram into your personal cloud storage system. The project consists of a Flutter frontend and a Node.js backend that acts as an intermediary between the application and Telegram's API. This enables users to securely store and manage their files through a familiar and intuitive interface.

Notifications You must be signed in to change notification settings

ashishexee/TeleDrive

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

20 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

TeleDrive - Cloud Storage via Telegram πŸ“¦

A comprehensive cloud storage solution that leverages Telegram's infrastructure for file storage and management. Upload, organize, and access your files from anywhere using Telegram as the backend storage service.

πŸ“œ Overview

TeleDrive is a full-stack application that transforms Telegram into your personal cloud storage system. The project consists of a Flutter frontend and a Node.js backend that acts as an intermediary between the application and Telegram's API. This enables users to securely store and manage their files through a familiar and intuitive interface.


πŸ“Έ Application Screenshots

  1. Login Screen πŸ”’
    The login screen using Telegram authentication to securely access your drive.
    Login Screen

  2. Home Page - All Files 🏠
    Main dashboard showing all files with search and upload functionality.
    Home Page - Light Mode
    Home Page - Dark Mode

  3. Photos Gallery πŸ“Έ
    Grid view of all images with thumbnail previews for quick browsing.
    Photos Gallery

  4. Documents Section πŸ“œ
    Organized view of document files with type indicators and quick actions.
    Documents Section

  5. Video Gallery πŸŽ₯
    Built-in video player for previewing video content directly in the app.
    Video Player

  6. File Upload ⬆️
    File selection and upload interface with progress tracking.

  7. Downloads Manager πŸ”½οΈ
    List of files downloaded to the device with open and share options.
    Downloads Manager

  8. Recycle Bin πŸ—‘οΈ
    Deleted files with options to restore or permanently remove.
    Recycle Bin

Additional Screenshots

  • App Navigation Drawer
    Easy access to all app sections from any screen.
    App Drawer

  • Other Files Section
    View and manage miscellaneous file types.
    Others Section

  • Successful Authentication
    Confirmation screen after successful login.
    Successful Login


πŸš€ Features

User Experience πŸ‘€

  • Secure Authentication: Login using Telegram's authentication system πŸ”’
  • Intuitive Interface: User-friendly design for easy file management 🎨
  • Cross-platform Support: Works on Android, iOS, and web platforms πŸ“±πŸ’»

File Management πŸ“‚

  • Upload & Download: Transfer files to and from Telegram's servers β¬†οΈπŸ”½οΈ
  • File Categories: Automatic organization into Photos, Documents, Videos, APKs, and Others πŸ“ΈπŸ“œπŸŽ₯
  • Search Functionality: Easily find files by name πŸ”
  • File Preview: Preview images and documents directly in the app πŸ‘€

Storage Features πŸ“€

  • Recycle Bin: Soft-delete functionality with restore capability πŸ—‘οΈ
  • Direct Downloads: Save files directly to device storage πŸ“…
  • Telegram Forwarding: Send files to your Telegram chat πŸ“€
  • File Status Tracking: Monitor upload and download progress πŸ“Š

Technical Features πŸ› οΈ

  • Thumbnail Generation: Automatic thumbnail creation for image files πŸ–ΌοΈ
  • Permission Handling: Proper storage access permissions πŸ”
  • Error Handling: Robust error management for a smooth user experience 🚨
  • Responsive Design: Works seamlessly across different screen sizes πŸ”

πŸ”§ Tech Stack

Frontend 🌐

  • Flutter: Cross-platform UI framework for building natively compiled applications πŸ–₯️
  • Dart: Programming language optimized for building UIs 🐧
  • HTTP Package: For API communication with backend 🌍
  • File Management Libraries: For handling file operations on the device πŸ“

Backend βš™οΈ

  • Node.js: JavaScript runtime environment for server-side code 🟒
  • Express: Web application framework for Node.js πŸš€
  • Telegram Bot API: For file storage and retrieval πŸ€–
  • Multer: For handling file uploads πŸ“€

πŸ–₯️ Installation & Setup

Prerequisites πŸ“‹

  • Flutter SDK (2.0+) πŸ–ΌοΈ
  • Node.js (14.0+) 🟒
  • Telegram Bot Token (from @BotFather) πŸ€–

Frontend Setup 🌟

  1. Clone the repository:

    git clone https://github.com/yourusername/telegram_drive
  2. Navigate to the frontend directory:

    cd telegram_drive/frontend
  3. Install dependencies:

    flutter pub get
  4. Run the application:

    flutter run

Backend Setup βš™οΈ

  1. Navigate to the backend directory:

    cd telegram_drive/backend
  2. Install dependencies:

    npm install
  3. Create a .env file with the following content:

    TELEGRAM_BOT_TOKEN=your_telegram_bot_token_here
    PORT=3000
    
  4. Start the server:

    npm start

🌐 API Endpoints

Authentication πŸ”’

  • POST /api/verify - Verify the 6-digit code received from Telegram bot

File Management πŸ“

  • POST /api/upload - Upload a file to Telegram ⬆️
  • GET /api/files - Get all files for a user πŸ“‹
  • GET /api/file/:fileId - Download a file directly πŸ“…
  • GET /api/download/:fileId - Send a file to user's Telegram chat πŸ“€
  • DELETE /api/file/:fileId - Move a file to the Recycle Bin πŸ—‘οΈ

Thumbnails πŸ–ΌοΈ

  • GET /api/thumbnail/:fileId - Get thumbnail for an image file

Recycle Bin πŸ—‘οΈ

  • GET /api/bin - List files in recycle bin πŸ“‹
  • POST /api/bin/restore/:fileId - Restore a file from recycle bin πŸ”„
  • DELETE /api/bin/:fileId - Permanently delete a file ❌
  • DELETE /api/bin/empty - Empty the recycle bin 🧹

πŸ“‚ Project Structure

Frontend 🌟

frontend/
β”œβ”€β”€ lib/
β”‚   β”œβ”€β”€ constants.dart    # App-wide constants including entry point of the app
β”‚   β”œβ”€β”€ main.dart        # Entry point of the application
β”‚   β”œβ”€β”€ home/            # Home page and related components
β”‚   β”œβ”€β”€ models/          # Data models including File models
β”‚   β”œβ”€β”€ screens/         # Additional screens (download, preview)
β”‚   β”œβ”€β”€ services/        # Services for file preview
β”‚   β”œβ”€β”€ shared_preferences/ # User data persistence
β”‚   β”œβ”€β”€ widgets/         # Reusable UI components
β”‚   β”œβ”€β”€ assets/          # Static assets
└── pubspec.yaml         # Flutter dependencies

Backend βš™οΈ

backend/
β”œβ”€β”€ server.js            # Main server file
β”œβ”€β”€ uploads/             # Temporary storage for file uploads
β”œβ”€β”€ data/
β”‚   β”œβ”€β”€ userFiles.json   # User file metadata storage
β”œβ”€β”€ thumbnails/          # Cache directory for generated thumbnails
β”œβ”€β”€ .env                # Environment variables

πŸ” Security Features

  • Verification Code: 6-digit time-limited verification code for authentication πŸ”’
  • File ID Validation: Ensures users can only access their own files πŸ›‘οΈ
  • Temporary File Storage: Files are stored temporarily during processing πŸ“¦
  • Error Handling: Comprehensive error handling with appropriate status codes 🚨

⚑ Performance Optimizations

  • Thumbnail Caching: Generated thumbnails are cached to reduce processing load πŸ–ΌοΈ
  • Scheduled Cleanup: Automatic cleanup of old cached thumbnails 🧹
  • Periodic Data Saving: Automatic saving of file metadata πŸ—’οΈ
  • Graceful Shutdown: Ensures data is saved before server shutdown πŸ”Œ

πŸ› οΈ Troubleshooting

Common Issues ⚠️

Upload/Download Issues πŸ“€πŸ“…

  • Verify your internet connection is stable 🌐
  • Check that the file size is under the 50MB limit πŸ”
  • Ensure you have correct permissions granted to the app πŸ”

Authentication Problems πŸ”’

  • Make sure you're using the correct Telegram account πŸ“±
  • Check if the Telegram bot is active and functioning πŸ€–

πŸ“¦ Deployment

Production Recommendations πŸš€

  1. Use a process manager like PM2:

    npm install -g pm2
    pm2 start server.js --name telegram-drive
  2. Set behind a reverse proxy (Nginx/Apache) for SSL termination πŸ”’

  3. Configure a proper firewall πŸ›‘οΈ

About

TeleDrive is a full-stack application that transforms Telegram into your personal cloud storage system. The project consists of a Flutter frontend and a Node.js backend that acts as an intermediary between the application and Telegram's API. This enables users to securely store and manage their files through a familiar and intuitive interface.

Resources

Stars

Watchers

Forks