# angaddogra/wandermate-your-travel-companion architecture

> Architecture diagram of the GitHub repository angaddogra/wandermate-your-travel-companion, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/angaddogra/wandermate-your-travel-companion
- Repository: https://github.com/angaddogra/wandermate-your-travel-companion

## Overview

##### Project Type and Purpose
- Full-stack web application built on Django (Python).
- Purpose: AI-powered itinerary generation (“WanderMate”).

##### Main Components
a. Client (Web Browser)
b. Django Web Server
– URL Dispatcher (plannerproject/urls.py & globe/urls.py)
– Views & Business Logic (globe/views.py)
– Templates (globe/templates/globe/*.html)
– Models & ORM (globe/models.py → db.sqlite3)
c. Database
– SQLite (db.sqlite3)
d. External AI Service
– (e.g., OpenAI or another NLP/ML API called from views)
e. Static/Media File Handler (if any)
f. Optional Production Layer
– WSGI/ASGI (plannerproject/wsgi.py, asgi.py)
– Reverse Proxy (e.g., Nginx/Gunicorn)

##### Relationships & Data Flow
- Browser → HTTP Request → Django URL Dispatcher
- Dispatcher → Invokes View Function
- View:
– Validates Input / Session / Auth (globe/login, signup)
– Reads/Writes Models via ORM → SQLite
– Calls External AI API to generate itineraries
– Renders Template with Data → HTML Response
- Response → Browser
- (In Prod) WSGI/ASGI Layer connects web server to Django app

##### Architectural Patterns & Principles
- MVT (Model-View-Template) – separation of concerns
- Single Django app (“globe”) under one project – monolithic
- ORM abstracts data layer (db.sqlite3 migration files)
- External service integration for AI functionality
- Clearly defined URL→View→Template pipeline

##### Essential Elements
- Component labels (e.g., “Client,” “Django URL Dispatcher,” “SQLite DB”).

## Diagram (Mermaid)

```mermaid
flowchart TB
  classDef client fill:#89CFF0,stroke:#000,color:#000;
  classDef prod fill:#D3D3D3,stroke:#000,color:#000;
  classDef app fill:#90EE90,stroke:#000,color:#000;
  classDef db fill:#FFA500,stroke:#000,color:#000;
  classDef external fill:#D8BFD8,stroke:#000,color:#000;

  Client["Web Browser"]:::client

  subgraph "Production Layer"
    direction TB
    ReverseProxy["Nginx Reverse Proxy"]:::prod
    WSGI["WSGI Entry Point<br/>(wsgi.py)"]:::prod
    ASGI["ASGI Entry Point<br/>(asgi.py)"]:::prod
    ReverseProxy --> WSGI
    ReverseProxy --> ASGI
  end

  subgraph "Django Application" 
    direction TB
    URLP["Project URL Dispatcher<br/>(plannerproject/urls.py)"]:::app
    URLA["App URL Dispatcher<br/>(globe/urls.py)"]:::app
    Views["Views & Business Logic<br/>(globe/views.py)"]:::app
    Models["Models & ORM Layer<br/>(globe/models.py)"]:::app
    Migrations["Migrations<br/>(globe/migrations/)"]:::app
    Templates["Templates<br/>(globe/templates/globe/)"]:::app

    URLP --> URLA
    URLA --> Views
    Views --> Models
    Models --> Migrations
    Views --> Templates
  end

  DB["SQLite Database<br/>(db.sqlite3)"]:::db
  AI["External AI Service"]:::external

  Client -->|HTTP GET /| ReverseProxy
  ReverseProxy -->|Forward Request| WSGI
  ReverseProxy -->|Forward Request| ASGI
  WSGI -->|HTTP Request| URLP
  ASGI -->|HTTP Request| URLP
  URLP -->|Route to View| URLA
  Views -->|ORM Query| DB
  Models -->|reads/writes| DB
  Views -->|AI API Call| AI
  Views -->|Render HTML| Templates
  Templates -->|HTML Response| Client

  click URLP "https://github.com/angaddogra/wandermate-your-travel-companion/blob/main/plannerproject/plannerproject/urls.py"
  click URLA "https://github.com/angaddogra/wandermate-your-travel-companion/blob/main/plannerproject/globe/urls.py"
  click Views "https://github.com/angaddogra/wandermate-your-travel-companion/blob/main/plannerproject/globe/views.py"
  click Models "https://github.com/angaddogra/wandermate-your-travel-companion/blob/main/plannerproject/globe/models.py"
  click Migrations "https://github.com/angaddogra/wandermate-your-travel-companion/blob/main/plannerproject/globe/migrations/0001_initial.py"
  click Templates "https://github.com/angaddogra/wandermate-your-travel-companion/tree/main/plannerproject/globe/templates/globe/"
  click WSGI "https://github.com/angaddogra/wandermate-your-travel-companion/blob/main/plannerproject/plannerproject/wsgi.py"
  click ASGI "https://github.com/angaddogra/wandermate-your-travel-companion/blob/main/plannerproject/plannerproject/asgi.py"
  click DB "https://github.com/angaddogra/wandermate-your-travel-companion/blob/main/plannerproject/db.sqlite3"

  class Client client
  class ReverseProxy,WSGI,ASGI prod
  class URLP,URLA,Views,Models,Migrations,Templates app
  class DB db
  class AI external
```
