# ateeb09/travel2india architecture

> Architecture diagram of the GitHub repository ateeb09/travel2india, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ateeb09/travel2india
- Repository: https://github.com/ateeb09/travel2india

## Overview

#### Purpose and Entry Points
Travel2India is a server-rendered Django travel discovery and lead-generation application. It presents curated destination content, accepts trip/flight requests, initiates and verifies Razorpay payments, and sends admin notifications. Development starts through `travel2india/manage.py`; production runs the WSGI app at `travel2india/travel2india/wsgi.py`, with deployment commands in `travel2india/Procfile` and `travel2india/build.sh`.

#### Django Composition and Routing
The project configuration, middleware, database selection, static handling, environment-driven secrets, and root routing belong to `travel2india/travel2india/settings.py` and `travel2india/travel2india/urls.py`. The `core` Django app owns application routing and request handlers through `travel2india/core/urls.py` and `travel2india/core/views.py`. ASGI support also exists at `travel2india/travel2india/asgi.py`, though the documented production gateway is Gunicorn/WSGI.

#### Content Discovery and Search
Destination browsing is primarily template-driven: landing, destination listing, and per-destination detail pages reside in `travel2india/templates/home.html`, `travel2india/templates/destinations.html`, and the `travel2india/templates/detail_*.html` set. Search requests are handled in `travel2india/core/views.py` and rendered through `travel2india/templates/search_results.html`; the search boundary translates user keywords into matching curated destination content rather than querying an external travel inventory service.

#### Lead Capture and Persistence
The core domain models define durable user-submitted records, including contact messages, trip inquiries, flight bookings, and payments, in `travel2india/core/models.py`. Form validation and request-to-model binding are centralized in `travel2india/core/forms.py`; schema evolution is recorded in `travel2india/core/migrations/0001_initial.py` through `0003_contactmessage_flightbooking_inquiry_and_more.py`. Relevant form workflows render `travel2india/templates/contact.html`, `travel2india/templates/inquiry.html`, and `travel2india/templates/flight_booking.html`, then redirect to success pages.

#### Notifications and Shared Presentation
After lead submission, application logic invokes the email boundary in `travel2india/core/email_service.py`, using configured SMTP/Gmail credentials to notify administrators. Shared template context is supplied by `travel2india/core/context_processors.py`, while `travel2india/templates/base.html` provides the common page shell, navigation, theme behavior, and client-side widget integration.

#### Payments
Payment processing crosses from Django to Razorpay Checkout: payment views in `travel2india/core/views.py` create or coordinate payment requests, `travel2india/templates/payment.html` hosts the checkout-facing UI, and the `Payment` persistence model is defined in `travel2india/core/models.py`. Razorpay key ID and secret are environment-provided credentials; backend verification is the trust boundary before a payment record is treated as valid.

#### Runtime, Assets, and Deployment
The runtime is Python 3.12/Django 5.1.6 with SQLite locally and Render-provisioned PostgreSQL in production. `travel2india/requirements.txt` supplies Django, Gunicorn, WhiteNoise, database, and payment dependencies. WhiteNoise serves production static assets from `travel2india/static/`, including global styling at `travel2india/static/css/style.css`. Render runs the build script, migrations/static collection as configured, and Gunicorn; PostgreSQL connectivity arrives through `DATABASE_URL`.

Main entry points: [`travel2india/core/views.py`](https://github.com/ateeb09/travel2india/blob/main/travel2india/core/views.py) (Request handlers), [`travel2india/travel2india/settings.py`](https://github.com/ateeb09/travel2india/blob/main/travel2india/travel2india/settings.py) (Project settings), [`travel2india/core/models.py`](https://github.com/ateeb09/travel2india/blob/main/travel2india/core/models.py) (Lead & payment models), [`travel2india/Procfile`](https://github.com/ateeb09/travel2india/blob/main/travel2india/Procfile) (Render deployment)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime &amp; Deployment"]
  node_manage["Django CLI<br/>entry point<br/>[manage.py]"]
  node_deployment{{"Render deployment"}}
  node_build["Build script<br/>build pipeline<br/>[build.sh]"]
  node_wsgi{{"Gunicorn WSGI<br/>production gateway<br/>[wsgi.py]"}}
  node_whitenoise["WhiteNoise<br/>static serving"]
end

subgraph group_django["Django Application"]
  node_settings["Project settings<br/>Django configuration<br/>[settings.py]"]
  node_root_urls["Root routing<br/>URL configuration<br/>[urls.py]"]
  node_core_urls["Core routing<br/>app routes<br/>[urls.py]"]
  node_views["Request handlers<br/>Django views<br/>[views.py]"]
  node_forms["Lead forms<br/>validation layer<br/>[forms.py]"]
  node_models["Lead &amp; payment models<br/>domain persistence<br/>[models.py]"]
  node_migrations["Schema migrations<br/>migration history<br/>[0001_initial.py]"]
  node_email_service["Admin notifications<br/>email service<br/>[email_service.py]"]
end

subgraph group_presentation["Templates &amp; Assets"]
  node_templates["Page templates<br/>server-rendered UI<br/>[base.html]"]
  node_context["Template context<br/>context processor"]
  node_static["Static assets<br/>CSS and client assets"]
end

subgraph group_integrations["External Services"]
  node_database[("SQLite / PostgreSQL<br/>application database")]
  node_razorpay{{"Razorpay Checkout<br/>payment provider"}}
  node_smtp{{"SMTP / Gmail<br/>email provider"}}
end

node_deployment -->|"runs"| node_build
node_deployment -->|"starts"| node_wsgi
node_manage -->|"loads"| node_settings
node_wsgi -->|"loads"| node_settings
node_settings -->|"configures"| node_root_urls
node_settings -->|"connects"| node_database
node_settings -->|"enables"| node_whitenoise
node_root_urls -->|"includes"| node_core_urls
node_core_urls -->|"dispatches to"| node_views
node_views -->|"renders"| node_templates
node_context -->|"supplies shared context"| node_templates
node_whitenoise -->|"serves"| node_static
node_views -->|"validates submissions"| node_forms
node_forms -->|"binds to"| node_models
node_views -->|"reads and persists"| node_models
node_migrations -.->|"evolves schema for"| node_models
node_models -->|"stores records"| node_database
node_views -->|"notifies after leads"| node_email_service
node_email_service -->|"sends via"| node_smtp
node_views -->|"creates and verifies payments"| node_razorpay

click node_manage "https://github.com/ateeb09/travel2india/blob/main/travel2india/manage.py"
click node_deployment "https://github.com/ateeb09/travel2india/blob/main/travel2india/Procfile"
click node_build "https://github.com/ateeb09/travel2india/blob/main/travel2india/build.sh"
click node_wsgi "https://github.com/ateeb09/travel2india/blob/main/travel2india/travel2india/wsgi.py"
click node_settings "https://github.com/ateeb09/travel2india/blob/main/travel2india/travel2india/settings.py"
click node_root_urls "https://github.com/ateeb09/travel2india/blob/main/travel2india/travel2india/urls.py"
click node_core_urls "https://github.com/ateeb09/travel2india/blob/main/travel2india/core/urls.py"
click node_views "https://github.com/ateeb09/travel2india/blob/main/travel2india/core/views.py"
click node_forms "https://github.com/ateeb09/travel2india/blob/main/travel2india/core/forms.py"
click node_models "https://github.com/ateeb09/travel2india/blob/main/travel2india/core/models.py"
click node_migrations "https://github.com/ateeb09/travel2india/blob/main/travel2india/core/migrations/0001_initial.py"
click node_email_service "https://github.com/ateeb09/travel2india/blob/main/travel2india/core/email_service.py"
click node_templates "https://github.com/ateeb09/travel2india/blob/main/travel2india/templates/base.html"
click node_context "https://github.com/ateeb09/travel2india/blob/main/travel2india/core/context_processors.py"
click node_static "https://github.com/ateeb09/travel2india/tree/main/travel2india/static"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_manage,node_deployment,node_build,node_wsgi,node_whitenoise toneBlue
class node_settings,node_root_urls,node_core_urls,node_views,node_forms,node_models,node_migrations,node_email_service toneAmber
class node_templates,node_context,node_static toneMint
class node_database,node_razorpay,node_smtp toneRose
```

## Components

### Runtime & Deployment

- [Django CLI](https://github.com/ateeb09/travel2india/blob/main/travel2india/manage.py): entry point · Development commands and management tasks. · `travel2india/manage.py`
- [Render deployment](https://github.com/ateeb09/travel2india/blob/main/travel2india/Procfile): deployment · Builds, migrates, collects static files, and starts Gunicorn. · `travel2india/Procfile`
- [Build script](https://github.com/ateeb09/travel2india/blob/main/travel2india/build.sh): build pipeline · `travel2india/build.sh`
- [Gunicorn WSGI](https://github.com/ateeb09/travel2india/blob/main/travel2india/travel2india/wsgi.py): production gateway · `travel2india/travel2india/wsgi.py`
- **WhiteNoise**: static serving · Serves collected production assets.

### Django Application

- [Project settings](https://github.com/ateeb09/travel2india/blob/main/travel2india/travel2india/settings.py): Django configuration · Configures middleware, secrets, database, static handling, and installed apps. · `travel2india/travel2india/settings.py`
- [Root routing](https://github.com/ateeb09/travel2india/blob/main/travel2india/travel2india/urls.py): URL configuration · `travel2india/travel2india/urls.py`
- [Core routing](https://github.com/ateeb09/travel2india/blob/main/travel2india/core/urls.py): app routes · `travel2india/core/urls.py`
- [Request handlers](https://github.com/ateeb09/travel2india/blob/main/travel2india/core/views.py): Django views · Serves content, search, lead workflows, and payment coordination. · `travel2india/core/views.py`
- [Lead forms](https://github.com/ateeb09/travel2india/blob/main/travel2india/core/forms.py): validation layer · Binds and validates contact, inquiry, and flight submissions. · `travel2india/core/forms.py`
- [Lead & payment models](https://github.com/ateeb09/travel2india/blob/main/travel2india/core/models.py): domain persistence · Stores contact messages, inquiries, flight bookings, and payments. · `travel2india/core/models.py`
- [Schema migrations](https://github.com/ateeb09/travel2india/blob/main/travel2india/core/migrations/0001_initial.py): migration history · `travel2india/core/migrations/0001_initial.py`
- [Admin notifications](https://github.com/ateeb09/travel2india/blob/main/travel2india/core/email_service.py): email service · `travel2india/core/email_service.py`

### Templates & Assets

- [Page templates](https://github.com/ateeb09/travel2india/blob/main/travel2india/templates/base.html): server-rendered UI · Includes destination, search, lead, success, and payment pages. · `travel2india/templates/base.html`
- [Template context](https://github.com/ateeb09/travel2india/blob/main/travel2india/core/context_processors.py): context processor · `travel2india/core/context_processors.py`
- [Static assets](https://github.com/ateeb09/travel2india/tree/main/travel2india/static): CSS and client assets · `travel2india/static`

### External Services

- **SQLite / PostgreSQL**: application database · Uses SQLite locally and Render PostgreSQL through DATABASE_URL in production.
- **Razorpay Checkout**: payment provider · Payment creation and backend verification boundary.
- **SMTP / Gmail**: email provider · Delivers administrator lead notifications.

## Connections

- Render deployment → Build script: runs
- Render deployment → Gunicorn WSGI: starts
- Django CLI → Project settings: loads
- Gunicorn WSGI → Project settings: loads
- Project settings → Root routing: configures
- Project settings → SQLite / PostgreSQL: connects
- Project settings → WhiteNoise: enables
- Root routing → Core routing: includes
- Core routing → Request handlers: dispatches to
- Request handlers → Page templates: renders
- Template context → Page templates: supplies shared context
- WhiteNoise → Static assets: serves
- Request handlers → Lead forms: validates submissions
- Lead forms → Lead & payment models: binds to
- Request handlers → Lead & payment models: reads and persists
- Schema migrations → Lead & payment models: evolves schema for
- Lead & payment models → SQLite / PostgreSQL: stores records
- Request handlers → Admin notifications: notifies after leads
- Admin notifications → SMTP / Gmail: sends via
- Request handlers → Razorpay Checkout: creates and verifies payments
