Welcome to the Cloud Storage project! This repository contains the code for a cloud storage service built using FastAPI and Telethon.
- User Authentication: Secure login and logout functionality.
- File Upload: Upload images and videos.
- Media Gallery: Display uploaded media in a gallery format.
- Progress Tracking: Real-time upload progress tracking.
- Media Actions: Download and remove media files.
- Responsive Design: Mobile-friendly navigation and layout.
- HTML
- CSS
- JavaScript
- FontAwesome: For icons
- FastAPI: A modern, fast (high-performance), web framework for building APIs with Python 3.6+.
- Telethon: A Python library to interact with Telegram's API.
- Python 3.7+
- Telegram API credentials (API ID and API Hash)
-
Clone the repository:
git clone https://github.com/xn-coder/cloud-storage.git cd cloud-storage
-
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the required dependencies:
pip install -r requirements.txt
- Set your Telegram API credentials in
api/main.py
:api_id = YOUR_API_ID api_hash = "YOUR_API_HASH"
-
Start the FastAPI server:
uvicorn api.main:app --host 0.0.0.0 --port 8000
-
The API will be available at
http://localhost:8000
.
- GET /: Welcome message
- POST /sign-in/: Sign in with a phone number
- POST /verify-code/: Verify the code sent to the phone number
- POST /logout/: Log out from the session
- POST /upload/: Upload a file
- GET /download/{id}: Download a file by ID
- GET /remove/: Remove a file by ID
- GET /media/: Get media details by ID
- GET /stream/{id}: Stream a video by ID
- GET /list-files/: List uploaded files
Contributions are welcome! Please open an issue or submit a pull request for any changes.
For more details, visit the repository.