How chanchreek/wandermate-your-travel-companion works
Project Type and Purpose
• This is a monolithic, full-stack Django web application named “WanderMate” that generates AI-powered travel itineraries.
• The user interacts with HTML pages served by Django (“globe” app), which in turn invoke AI services (either an internal Python module or external AI API), persist data in SQLite, and render results back to the browser.
File Structure Analysis
• Top-level:
• README.md – brief description (“AI powered itinerary generator”)
• requirements.txt – Python dependencies (Django, AI/ML libraries or API SDK)
• “plannerproject” folder:
• db.sqlite3 – embedded relational database
• manage.py – Django command-line utility
• “plannerproject” package – global settings, URL router, ASGI/WSGI entry points
• “globe” Django app – core functionality, including:
– models.py – data schema (e.g., destinations, user profiles, itineraries)
– views.py + urls.py – request handlers and routing
– templates/globe/*.html – presentation layer
– admin.py – backend management interface
– migrations/ – database schema evolution
– tests.py – automated tests
Architectural Patterns & Components
• MVC (Model-View-Controller) pattern as implemented by Django:
• Model layer (SQLite via Django ORM)
• View layer (Django views/controllers)
• Template layer (HTML, possibly with CSS/JS)
• Monolithic deployment: single Django process behind ASGI/WSGI (e.g., Gunicorn, Daphne)
• External AI Service (if in use) for itinerary generation
• Browser as client, serving static assets and dynamic pages
a. Client (Web Browser)
b. Web Server / Application Host (Django ASGI/WSGI)
c. URL Router (plannerproject/urls.py → globe/urls.py)
d. View Controllers (globe/views.py)
e. Business Logic / AI Module (internal code or external API)
f. Data Layer (SQLite via Django ORM: globe/models.py)
g. Templates (globe/templates/globe/*.html)
h. Admin Interface (Django Admin)
i. External Services (e.g., OpenAI GPT API)
Interactions & Data Flow
1. User sends HTTP request (e.g., “Generate Itinerary” form).
2. Django’s URL dispatcher routes request to a view.
3. View extracts input, invokes AI module or external API to compute itinerary.
4. Generated data is saved/queried via Django ORM → SQLite.
5. View renders results into a template.
6. HTTP response with rendered HTML (and optional JSON) returns to browser.
Detail
• Endpoints in globe/urls.py (e.g., “/”, “/generate-itinerary/”).
• Both ASGI (for real-time features) and WSGI (for standard HTTP) entry points if relevant.
• Manage.py utility as a side note for maintenance tasks (migrations, tests).