How santucho12/sistema-boston works
Project type and purpose
• This is a full-stack Flask web application (“Sistema de Gestión de CV”) whose goal is to let job seekers upload CVs and photos, and let administrators manage those records via a web panel.
File structure
• Top-level application entry:
• app.py – wires up Flask, loads config, registers blueprints/routes.
• config.py – application configuration (DB URIs, upload paths, secrets).
• auth.py – user authentication, session management.
• db.py – initializes and provides database connection (MySQL).
• utils.py – shared helper functions (e.g., file validation, image resizing).
• URL routing separated into “routes/”:
• routes/main.py – public-facing endpoints (CV upload form, index).
• routes/admin.py – admin panel endpoints (view/delete applicants).
• Static / templates / uploads:
• static/ – CSS and JS files for “index” and “admin” views.
• templates/ – Jinja2 HTML templates for main and admin.
• uploads/ – file system storage for received CVs and photos.
• Ancillary files: requirements.txt, install_deps.py, render.yaml (CI/deployment), .gitignore, venv.zip
Key insights from README
• Built on Flask with a MySQL backend.
• Uses a .env file for private credentials.
• Typical launch via “python app.py” after installing requirements.
• Secure, efficient file handling and admin control.
Main components & interactions
a. User Clients (Browser)
• Public user interface (submit CV + photo)
• Admin interface (login, manage candidates)
b. Web Server (Flask Application)
• app.py orchestrator
• auth.py handles login sessions
• routes/main.py & routes/admin.py handle HTTP requests
• utils.py for validation, file processing
c. Database (MySQL)
• db.py manages connections, runs queries (applicant records)
d. File Storage (Local FS under “uploads/”)
• Holds uploaded CVs and images
e. Configuration & Environment
• config.py reads settings, integrates with .env (secrets, DB URI)
Relationships & data flow
• Browser → HTTP(S) → Flask routes
• Public “/” GET → templates/index.html
• Public “/upload” POST → routes/main.py → utils.save_file → uploads/ + db.py insert record
• Admin “/login” → auth.py → session cookie
• Admin “/applicants” → db.py SELECT → templates/admin.html
• Admin “/applicants/delete” → db.py DELETE + file removal via utils
• Flask → Database (via db.py)
• Flask → File system (via utils.py)
• config.py provides DB credentials, upload paths
Architectural patterns & design principles
• MVC‐ish separation:
• Models: db.py data access
• Views: Jinja2 templates in /templates
• Controllers: route handlers in routes/
• Blueprint pattern: grouping of route modules (main vs admin)
• Single-process synchronous Flask app (no microservices)
• Local file storage for uploads (could be replaced by S3 in future)