How yeahitsmeagain/tgstorage works
Project Type Analysis
This is a full-stack application that serves as a cloud storage solution utilizing Telegram bots for file storage. The project uses FastAPI (evident from the backend structure), MySQL, and Nginx, with OAuth integration for authentication.
Main Components
A. Client Layer:
• External Client Applications
• OAuth (Google) Integration Point
B. Infrastructure Layer:
• Nginx Reverse Proxy (with SSL/TLS termination)
• Docker Containers
C. Application Layer:
• FastAPI Backend Service
• Telegram Bot Integration
• Redis Cache
D. Data Layer:
• MySQL Database
• Telegram Storage (for actual files)
[Client Layer]
• ↓
[Infrastructure Layer]
• ↓
[Application Layer]
• ↓
[Data Layer]
Specific Component Relationships to Highlight
A. API Routes (from /backend/app/routes):
• Auth Routes (/auth)
• File Routes (/file)
• Folder Routes (/folder)
• Share Routes (/share)
• User Routes (/user)
B. Database Models (from /backend/app/db/models):
• Relationships between:
• User
• File
• Folder
• SharedResource
• AbstractResource
C. External Services:
• Google OAuth
• Telegram Bot API
Important Flows
A. Authentication Flow:
Client → Nginx → FastAPI → Google OAuth → Database
B. File Operations Flow:
Client → Nginx → FastAPI → Telegram Bot API → Telegram Storage
C. Data Access Flow:
Client → Nginx → FastAPI → MySQL Database
Additional Elements
• Environment configurations
• Security layers (OAuth, middleware)
• Caching layer (Redis)
• Load balancing (if applicable)
Technical Details to Note
• Use the CRUD operations structure from /backend/app/db/crud
• Middleware layer for upload size limits
• Dependency injection system
• Event handling system
• Use double lines for data persistence operations
• Version numbers for major components
• Timestamps for cache operations