How traukit0/trueq works
Project type and purpose
• TrueQ is a full-stack CRUD web application (MVP) for social exchanges of goods and services.
• Frontend: React/Vite single-page application served by Nginx.
• Backend: Flask REST API with SQLAlchemy (ORM) and Alembic (migrations).
• Data persists in a MySQL container; Adminer provides a DB GUI.
Main components
a. User Browser (client)
b. Nginx + React container (“frontend”)
c. Flask API container (“backend”)
• Routes layer (item_routes.py)
• Services layer (item_service.py)
• Models layer (SQLAlchemy models: Item)
• Alembic migrations (versions/*)
d. MySQL database container (db_data volume)
e. Adminer container (DB administration)
f. Docker Compose orchestration (network + volumes)
Relationships and data flow
• Browser → (HTTP/HTTPS) → Nginx serves index.html & JS bundle
• React app → (XHR/fetch to /api) → Flask API endpoints
• Flask API → SQLAlchemy → MySQL reads/writes
• Alembic (at build or manually) → applies migrations to MySQL
• Adminer ↔ MySQL for visual DB management
Architectural patterns and principles
• Client-Server separation: loose coupling via REST API
• Layered backend: Controllers (routes) → Business Logic (services) → Data Access (models)
• Containerization: each service isolated in its own Docker image
• Infrastructure-as-code: docker-compose.yml defines multi-container topology
• Configuration via environment variables (.env in compose)
Technologies & modules call-outs
• Backend: Flask, Flask-CORS, SQLAlchemy, Alembic
• DB: MySQL 8, Adminer
• Deployment: Docker, Docker Compose, Nginx