How rush-perera/local-fileshare works
Project type and purpose
• This is a lightweight, single-page web application packaged as a standalone Windows executable.
• It uses Flask (Python microframework) to provide a local file-sharing HTTP server with a mobile-friendly UI and real-time upload progress.
File structure
• Top level:
• main.py – Python entrypoint that starts the Flask server and defines upload/download endpoints.
• main.exe – Windows‐packaged version (PyInstaller or similar) of the same Flask app.
• dist/FileShareApp – bundled executable and internal Python/Flask/Tk data for standalone distribution.
• screenshots – documentation assets only.
• No separate “frontend” directory: static HTML/JS/CSS and Flask templates are embedded under the Flask application.
• No external database: files are stored in the host file system (likely an “uploads/” folder managed by main.py).
• Configuration is minimal—defaults are in code, and no cloud or external services are referenced.
Key insights from README
• Serves entirely over local Wi-Fi (no Internet).
• Supports multiple file uploads/downloads via REST endpoints.
• Real-time progress bar indicates use of chunked uploads or AJAX.
• Packaged for Windows; distribution includes all dependencies.
Main components
a. Clients
• Mobile browser (iPhone, Android)
• Desktop browser (Windows PC, Mac)
b. Flask Server (monolith)
• HTTP API layer (endpoints: /upload, /files, /download)
• Static file server (HTML/CSS/JS assets)
• Upload progress handler (AJAX/WebSocket)
• File storage manager (writes/reads files on local disk)
c. File System
• “uploads/” directory or equivalent
d. Build/Packaging tool (optional, for build‐time view)
• PyInstaller (bundles Python interpreter + dependencies into main.exe)
Relationships & interactions
• Clients ↔ HTTP(S) over LAN ↔ Flask server
• Flask server → local disk (writes uploaded files, reads for download)
• Build tool → main.exe (one-time, offline process)
Architectural patterns & design principles
• Monolithic MVC-style: Flask routes (controller) serve templates (view) + handle file I/O (model).
• RESTful API for file operations.
• Single process, single port (e.g., 5000) listening on 0.0.0.0 for local network traffic.
• No external dependencies at runtime (self-contained).
Relevant technologies & frameworks
• Python 3.x
• Flask 3.1.0
• ItsDangerous, Jinja2/MarkupSafe, Werkzeug as internal Flask dependencies
• PyInstaller (or similar) for packaging
• HTML5/CSS3/JavaScript for front end, possibly using Bootstrap or vanilla JS for progress bar