# vivek0409-7/maharashtra-tour architecture

> Architecture diagram of the GitHub repository vivek0409-7/maharashtra-tour, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vivek0409-7/maharashtra-tour
- Repository: https://github.com/vivek0409-7/maharashtra-tour

## Overview

Aagman is a Maharashtra tourism portal combining destination discovery with account access and itinerary planning. The main planning flow is: a visitor submits trip preferences in the frontend, which calls the planner API; the controller requests a Gemini itinerary and saves it as a journey, while visitors can retrieve saved journeys. The portal also provides separate destination-browsing areas for forts and hills, temples, beaches, and heritage sites. Backend excerpts show route dispatch and model usage; destination links and frontend page wiring are not fully sampled, so those relationships are not inferred.

Main entry points: [`backend/routes/plannerRoutes.js`](https://github.com/vivek0409-7/maharashtra-tour/blob/main/backend/routes/plannerRoutes.js) (Planner routes), [`backend/server.js`](https://github.com/vivek0409-7/maharashtra-tour/blob/main/backend/server.js) (Express API server), [`frontend/script.js`](https://github.com/vivek0409-7/maharashtra-tour/blob/main/frontend/script.js) (Planner and sessions), [`backend/controllers/plannerController.js`](https://github.com/vivek0409-7/maharashtra-tour/blob/main/backend/controllers/plannerController.js) (Itinerary controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Destination discovery"]
  node_home["Tourism portal<br/>[index.html]"]
  node_forts["Forts and hills<br/>[branchscript.js]"]
  node_temples["Temple destinations"]
  node_beaches["Beach destinations<br/>[script.js]"]
  node_heritage["Heritage sites"]
end

subgraph group_planning["Journey planning"]
  node_planner_ui["Planner and sessions<br/>[script.js]"]
  node_planner_routes["Planner routes<br/>[plannerRoutes.js]"]
  node_planner_controller["Itinerary controller"]
  node_journey_model[("Journey model<br/>[Journey.js]")]
end

subgraph group_identity["Accounts"]
  node_auth_ui["Account interface<br/>[script.js]"]
  node_auth_routes["Account routes<br/>[authRoutes.js]"]
  node_auth_controller["Account controller<br/>[authController.js]"]
  node_user_model[("User model<br/>[User.js]")]
end

subgraph group_backend["API and persistence"]
  node_api_server["Express API server<br/>[server.js]"]
  node_db_config["Database connection<br/>[db.js]"]
end

node_visitor(("Visitor"))
node_gemini{{"Gemini AI"}}
node_mongo_memory[("In-memory MongoDB")]

node_visitor -->|"browses"| node_home
node_visitor -->|"submits preferences"| node_planner_ui
node_planner_ui -->|"posts itinerary request"| node_planner_routes
node_planner_ui -->|"fetches saved journeys"| node_planner_routes
node_planner_routes -->|"dispatches to"| node_planner_controller
node_planner_controller -->|"requests itinerary"| node_gemini
node_planner_controller -->|"saves and queries"| node_journey_model
node_visitor -->|"uses account forms"| node_auth_ui
node_auth_ui -->|"calls auth endpoints"| node_auth_routes
node_auth_routes -->|"dispatches to"| node_auth_controller
node_auth_controller -->|"reads and saves users"| node_user_model
node_api_server -->|"connects database"| node_db_config
node_api_server -->|"mounts routes"| node_auth_routes
node_api_server -->|"mounts routes"| node_planner_routes
node_db_config -->|"starts instance"| node_mongo_memory

click node_home "https://github.com/vivek0409-7/maharashtra-tour/blob/main/frontend/index.html"
click node_forts "https://github.com/vivek0409-7/maharashtra-tour/blob/main/frontend/branch1/Ginfo/branchscript.js"
click node_temples "https://github.com/vivek0409-7/maharashtra-tour/tree/main/frontend/branch2/temples"
click node_beaches "https://github.com/vivek0409-7/maharashtra-tour/blob/main/frontend/branch3/beaches/script.js"
click node_heritage "https://github.com/vivek0409-7/maharashtra-tour/tree/main/frontend/branch4/sites"
click node_planner_ui "https://github.com/vivek0409-7/maharashtra-tour/blob/main/frontend/script.js"
click node_planner_routes "https://github.com/vivek0409-7/maharashtra-tour/blob/main/backend/routes/plannerRoutes.js"
click node_planner_controller "https://github.com/vivek0409-7/maharashtra-tour/blob/main/backend/controllers/plannerController.js"
click node_journey_model "https://github.com/vivek0409-7/maharashtra-tour/blob/main/backend/models/Journey.js"
click node_auth_ui "https://github.com/vivek0409-7/maharashtra-tour/blob/main/frontend/script.js"
click node_auth_routes "https://github.com/vivek0409-7/maharashtra-tour/blob/main/backend/routes/authRoutes.js"
click node_auth_controller "https://github.com/vivek0409-7/maharashtra-tour/blob/main/backend/controllers/authController.js"
click node_user_model "https://github.com/vivek0409-7/maharashtra-tour/blob/main/backend/models/User.js"
click node_api_server "https://github.com/vivek0409-7/maharashtra-tour/blob/main/backend/server.js"
click node_db_config "https://github.com/vivek0409-7/maharashtra-tour/blob/main/backend/config/db.js"

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_home,node_forts,node_temples,node_beaches,node_heritage toneBlue
class node_planner_ui,node_planner_routes,node_planner_controller,node_journey_model,node_mongo_memory toneAmber
class node_auth_ui,node_auth_routes,node_auth_controller,node_user_model toneMint
class node_api_server,node_db_config toneRose
class node_visitor,node_gemini toneIndigo
```

## Components

### Destination discovery

- [Tourism portal](https://github.com/vivek0409-7/maharashtra-tour/blob/main/frontend/index.html): `frontend/index.html`
- [Forts and hills](https://github.com/vivek0409-7/maharashtra-tour/blob/main/frontend/branch1/Ginfo/branchscript.js): `frontend/branch1/Ginfo/branchscript.js`
- [Temple destinations](https://github.com/vivek0409-7/maharashtra-tour/tree/main/frontend/branch2/temples): `frontend/branch2/temples`
- [Beach destinations](https://github.com/vivek0409-7/maharashtra-tour/blob/main/frontend/branch3/beaches/script.js): `frontend/branch3/beaches/script.js`
- [Heritage sites](https://github.com/vivek0409-7/maharashtra-tour/tree/main/frontend/branch4/sites): `frontend/branch4/sites`

### Journey planning

- [Planner and sessions](https://github.com/vivek0409-7/maharashtra-tour/blob/main/frontend/script.js): `frontend/script.js`
- [Planner routes](https://github.com/vivek0409-7/maharashtra-tour/blob/main/backend/routes/plannerRoutes.js): `backend/routes/plannerRoutes.js`
- [Itinerary controller](https://github.com/vivek0409-7/maharashtra-tour/blob/main/backend/controllers/plannerController.js): `backend/controllers/plannerController.js`
- [Journey model](https://github.com/vivek0409-7/maharashtra-tour/blob/main/backend/models/Journey.js): `backend/models/Journey.js`

### Accounts

- [Account interface](https://github.com/vivek0409-7/maharashtra-tour/blob/main/frontend/script.js): `frontend/script.js`
- [Account routes](https://github.com/vivek0409-7/maharashtra-tour/blob/main/backend/routes/authRoutes.js): `backend/routes/authRoutes.js`
- [Account controller](https://github.com/vivek0409-7/maharashtra-tour/blob/main/backend/controllers/authController.js): `backend/controllers/authController.js`
- [User model](https://github.com/vivek0409-7/maharashtra-tour/blob/main/backend/models/User.js): `backend/models/User.js`

### API and persistence

- [Express API server](https://github.com/vivek0409-7/maharashtra-tour/blob/main/backend/server.js): `backend/server.js`
- [Database connection](https://github.com/vivek0409-7/maharashtra-tour/blob/main/backend/config/db.js): `backend/config/db.js`

### Other components

- **Visitor**
- **Gemini AI**
- **In-memory MongoDB**

## Connections

- Visitor → Tourism portal: browses
- Visitor → Planner and sessions: submits preferences (evidence: `frontend/script.js`)
- Planner and sessions → Planner routes: posts itinerary request (evidence: `frontend/script.js`)
- Planner and sessions → Planner routes: fetches saved journeys (evidence: `frontend/script.js`)
- Planner routes → Itinerary controller: dispatches to (evidence: `backend/routes/plannerRoutes.js`)
- Itinerary controller → Gemini AI: requests itinerary (evidence: `backend/controllers/plannerController.js`)
- Itinerary controller → Journey model: saves and queries (evidence: `backend/controllers/plannerController.js`)
- Visitor → Account interface: uses account forms (evidence: `frontend/script.js`)
- Account interface → Account routes: calls auth endpoints (evidence: `frontend/script.js`)
- Account routes → Account controller: dispatches to (evidence: `backend/routes/authRoutes.js`)
- Account controller → User model: reads and saves users (evidence: `backend/controllers/authController.js`)
- Express API server → Database connection: connects database (evidence: `backend/server.js`)
- Express API server → Account routes: mounts routes (evidence: `backend/server.js`)
- Express API server → Planner routes: mounts routes (evidence: `backend/server.js`)
- Database connection → In-memory MongoDB: starts instance (evidence: `backend/config/db.js`)
