How floriannicolas/yeeet works
Project Overview
• YEEET is a secure file sharing platform offering user authentication, chunked file uploads, real-time progress tracking, and secure file downloads.
• It features a three-pronged architecture: a backend API server, a web client built in Next.js (React), and a desktop client using Tauri (Rust + React).
Main Components
a. Backend API Server:
• Based on Node.js with Express and TypeScript.
• Components include configuration, database connectivity (PostgreSQL with Drizzle ORM), authentication middleware, API routes (auth, files, user, cron jobs), background tasks, and services (email, storage, user-storage).
• Real-time communications via Socket.IO.
• Security features like session management (express-session) and bcrypt for password hashing.
b. Web Client (Next.js Application):
• Built with Next.js and React along with TypeScript.
• Organized into app routes, pages (login, register, forgot-password, reset-password), and components (dashboard, UI elements).
• Communicates with the backend for API calls (using Axios) and receives real-time updates.
c. Desktop Application:
• Built using Tauri (Rust for the backend, React with Vite for the frontend).
• Consists of a Tauri configuration and Rust source files (e.g., main.rs, lib.rs, tray, screenshot_watcher, etc.) along with a React-based UI structured similarly to the web client.
d. Database:
• A PostgreSQL database, with migrations and schemas defined in the backend.
e. External & Optional Services:
• File storage (local "uploads" folder or optionally S3 if enabled by configuration).
• Environmental configuration and secrets loaded via .env files in each component.
Relationships & Interactions
• Both the Next.js web client and the Tauri desktop client communicate with the Backend API Server via HTTP/WebSocket channels.
• The backend interacts with the PostgreSQL database for storage and retrieves or stores file metadata.
• The Desktop and Web clients receive real-time progress updates for file uploads via Socket.IO.
• Authentication flow where the clients send login/register requests to the Backend, which handles session management and token issuance.
• File upload processing: Client → Backend API → Storage (local file system or S3) with progress tracking.
Architectural Patterns & Design Principles
• Separation of concerns: Clearly delineated frontend, backend, and desktop client components.
• Modular design: Use of middleware in the backend (authentication, logging, etc.), service layers, and clearly separated routes.
• Reusability: Shared libraries and utilities across both clients.
• Security: Emphasize the session-based authentication, password hashing, and secure file downloads via unique tokens.
• Real-time communication: Represent Socket.IO communications as a separate bidirectional channel between clients and backend.
• Each major component is clearly marked: Backend API Server, Next.js Web Client, Tauri Desktop Application, Database (PostgreSQL), and External Storage (optional S3).
• Labels for protocols (HTTP API, WebSocket) and specific technologies (e.g., Express, Socket.IO, Tauri, Next.js, PostgreSQL).
• Annotations or notes on authentication and security measures.