How ramilevi1/qt-ride works
Project Type and Purpose
• This is a full-stack, Flask-based carpooling application (“QT-ride”) with an N-tier microservices architecture.
• Core features: user authentication, ride offering, ride searching, blog publishing and parsing, newsletter signup/delivery, and contact-us email.
File Structure Analysis
• Top-level:
• app.py (main Flask entrypoint)
• static/ and templates/ (frontend assets and Jinja templates)
• auth_service/, offer_service/, search_service/, user_profile/ (each a self-contained Flask microservice with its own venv, app.py, database, migrations)
• shared_instance/ (common models and shared SQLite DB)
• scripts: parse_blogs.py, newletterScript.py (batch processing), ride_migrations/, my_playwright_tests/ (E2E tests)
• Other: database.py and models.py at root for central logic, README specifying architecture and tech stack.
README Insights
• Declares N-tier microservices: Client → Authentication, OfferRide, SearchRide services → their own SQLite DBs
• Lists tech: Flask, Flask-SQLAlchemy, Flask-Migrate, Flask-Login, SQLite, Jinja, vanilla JS, Ajax, Playwright tests.
Main Components
a. Client (Web Browser / Mobile)
• Renders HTML/CSS/JS from static/ and templates/
• Initiates HTTP(S) requests to the gateway or directly to microservices
b. API Gateway / Main Flask App (app.py)
• Single entrypoint that routes requests to microservices or serves UI
c. Microservices
1) Authentication Service (auth_service/app.py + auth_service/auth_service.db)
2) OfferRide Service (offer_service/app.py + offer_service/*.db)
3) SearchRide Service (search_service/app.py + search_service/*.db)
4) UserProfile Service (user_profile/app.py + user_profile/*.db)
d. Shared Data Layer
• shared_instance/database.py + ride.db (optional consolidated DB)
• Migrations directories show Flask-Migrate usage per service
e. Batch/Background Processes
• parse_blogs.py (scrapes templates/blogs → shared DB)
• newletterScript.py (sends emails via Flask-Mail or SMTP)
f. External Services
• Email SMTP server (for contact-us and newsletter delivery)
Relationships and Data Flows
• Client → HTTPS → API Gateway / Main App
• API Gateway → internal HTTP calls or Flask Blueprints to microservices
• Each microservice ↔ its own SQLite DB via SQLAlchemy
• parse_blogs.py reads service templates/blog files → writes parsed content into a DB (could be shared_instance)
• newletterScript.py reads newsletter signup DB entries → sends emails via SMTP
• playwrite tests simulate end-to-end client interactions with the deployed app
Architectural Patterns and Design Principles
• N-Tier + Microservices: separation of concerns by domain (auth, rides, profiles)
• Service per database: each Flask service manages its own persistence layer
• Batch processing for blogs and newsletters is decoupled from request path
• Shared library (shared_instance) for common models to avoid duplication
• CI workflows defined in .github/workflows for tests and linting