# athithyan24/kktour architecture

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

- Interactive diagram: https://gitdiagram.com/athithyan24/kktour
- Repository: https://github.com/athithyan24/kktour

## Overview

Kanyakumari GIS Tourism is a tourism discovery and destination-management application. Visitors browse destinations, explore their locations, read guides and reviews, save places, and plan trips; administrators manage destinations, categories, content, and trip requests. The graph also shows the server’s route/controller/model layers and documented authentication, nearby-place, review, and itinerary behavior. Source excerpts establish frontend routing and selected backend calls; frontend-to-API request wiring and several unsampled feature implementations are not shown, so those links are omitted.

Main entry points: [`client/src/App.jsx`](https://github.com/athithyan24/kktour/blob/main/client/src/App.jsx) (Tourism web app), [`server/server.js`](https://github.com/athithyan24/kktour/blob/main/server/server.js) (API application), [`server/models`](https://github.com/athithyan24/kktour/tree/main/server/models) (Tourism records), [`server/controllers/destinationController.js`](https://github.com/athithyan24/kktour/blob/main/server/controllers/destinationController.js) (Destination management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_visitor["Visitor experience"]
  node_webapp["Tourism web app<br/>[App.jsx]"]
  node_discovery["Destination discovery<br/>[Explore.jsx]"]
  node_spotdetail["Spot details<br/>[Spot.jsx]"]
  node_mapview["GIS map<br/>[MapPage.jsx]"]
  node_planner["Trip planner<br/>[Planner.jsx]"]
  node_guides["Guides<br/>[Guides.jsx]"]
  node_saved["Saved places<br/>[Bookmarks.jsx]"]
  node_reviews["Reviews"]
end

subgraph group_admin["Administration"]
  node_adminui["Admin workspace"]
end

subgraph group_api["API and access"]
  node_server["API application<br/>[server.js]"]
  node_authroutes["Authentication routes<br/>[authRoutes.js]"]
  node_dstroutes["Destination routes"]
  node_triproutes["Trip routes<br/>[tripRoutes.js]"]
  node_contentroutes["Content routes<br/>[contentRoutes.js]"]
  node_reviewroutes["Review routes<br/>[reviewRoutes.js]"]
end

subgraph group_domain["Tourism domain"]
  node_destinations["Destination management"]
  node_nearby["Nearby search<br/>[nearbyService.js]"]
  node_tripmanagement["Trip management<br/>[tripController.js]"]
  node_content["Guides and content"]
  node_datamodels[("Tourism records")]
end

subgraph group_support["Shared services"]
  node_auth["Identity handling<br/>[authController.js]"]
  node_access["Access control<br/>[authMiddleware.js]"]
  node_db[("MongoDB connection<br/>[db.js]")]
  node_itinerary["Itinerary generation<br/>[itinerary.js]"]
  node_apiwrapper["HTTP client<br/>[api.js]"]
end

node_traveller(("Traveller"))

node_traveller -.->|"uses"| node_webapp
node_webapp -->|"routes to"| node_discovery
node_webapp -->|"routes to"| node_spotdetail
node_webapp -->|"routes to"| node_mapview
node_webapp -->|"routes to"| node_planner
node_webapp -->|"routes to"| node_guides
node_webapp -->|"routes to"| node_saved
node_webapp -->|"routes to"| node_adminui
node_server -->|"mounts routes"| node_authroutes
node_server -->|"mounts routes"| node_dstroutes
node_server -->|"mounts routes"| node_triproutes
node_server -->|"mounts routes"| node_contentroutes
node_server -->|"mounts routes"| node_reviewroutes
node_authroutes -->|"dispatches to"| node_auth
node_authroutes -->|"uses guards"| node_access
node_dstroutes -->|"dispatches to"| node_destinations
node_dstroutes -->|"uses guards"| node_access
node_triproutes -->|"dispatches to"| node_tripmanagement
node_triproutes -->|"uses guards"| node_access
node_contentroutes -->|"dispatches to"| node_content
node_reviewroutes -->|"dispatches to"| node_reviews
node_reviewroutes -->|"uses guards"| node_access
node_auth -->|"reads and writes"| node_datamodels
node_destinations -->|"reads and writes"| node_datamodels
node_destinations -->|"requests nearby"| node_nearby
node_destinations -->|"uses categories"| node_datamodels
node_tripmanagement -->|"reads and writes"| node_datamodels
node_tripmanagement -->|"generates plan"| node_itinerary
node_content -->|"reads and writes"| node_datamodels
node_reviews -->|"updates ratings"| node_datamodels
node_server -->|"connects"| node_db
node_webapp -.->|"uses HTTP"| node_apiwrapper
node_apiwrapper -.->|"sends requests"| node_server

click node_webapp "https://github.com/athithyan24/kktour/blob/main/client/src/App.jsx"
click node_discovery "https://github.com/athithyan24/kktour/blob/main/client/src/pages/Explore.jsx"
click node_spotdetail "https://github.com/athithyan24/kktour/blob/main/client/src/pages/Spot.jsx"
click node_mapview "https://github.com/athithyan24/kktour/blob/main/client/src/pages/MapPage.jsx"
click node_planner "https://github.com/athithyan24/kktour/blob/main/client/src/pages/Planner.jsx"
click node_guides "https://github.com/athithyan24/kktour/blob/main/client/src/pages/Guides.jsx"
click node_saved "https://github.com/athithyan24/kktour/blob/main/client/src/pages/Bookmarks.jsx"
click node_reviews "https://github.com/athithyan24/kktour/blob/main/server/controllers/reviewController.js"
click node_adminui "https://github.com/athithyan24/kktour/tree/main/client/src/pages/Admin"
click node_server "https://github.com/athithyan24/kktour/blob/main/server/server.js"
click node_authroutes "https://github.com/athithyan24/kktour/blob/main/server/routes/authRoutes.js"
click node_dstroutes "https://github.com/athithyan24/kktour/blob/main/server/routes/destinationRoutes.js"
click node_triproutes "https://github.com/athithyan24/kktour/blob/main/server/routes/tripRoutes.js"
click node_contentroutes "https://github.com/athithyan24/kktour/blob/main/server/routes/contentRoutes.js"
click node_reviewroutes "https://github.com/athithyan24/kktour/blob/main/server/routes/reviewRoutes.js"
click node_auth "https://github.com/athithyan24/kktour/blob/main/server/controllers/authController.js"
click node_access "https://github.com/athithyan24/kktour/blob/main/server/middleware/authMiddleware.js"
click node_destinations "https://github.com/athithyan24/kktour/blob/main/server/controllers/destinationController.js"
click node_nearby "https://github.com/athithyan24/kktour/blob/main/server/services/nearbyService.js"
click node_tripmanagement "https://github.com/athithyan24/kktour/blob/main/server/controllers/tripController.js"
click node_content "https://github.com/athithyan24/kktour/blob/main/server/controllers/contentController.js"
click node_datamodels "https://github.com/athithyan24/kktour/tree/main/server/models"
click node_db "https://github.com/athithyan24/kktour/blob/main/server/config/db.js"
click node_itinerary "https://github.com/athithyan24/kktour/blob/main/server/utils/itinerary.js"
click node_apiwrapper "https://github.com/athithyan24/kktour/blob/main/client/src/services/api.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_webapp,node_discovery,node_spotdetail,node_mapview,node_planner,node_guides,node_saved,node_reviews toneBlue
class node_adminui toneAmber
class node_server,node_authroutes,node_dstroutes,node_triproutes,node_contentroutes,node_reviewroutes toneMint
class node_destinations,node_nearby,node_tripmanagement,node_content,node_datamodels toneRose
class node_auth,node_access,node_db,node_itinerary,node_apiwrapper,node_traveller toneIndigo
```

## Components

### Visitor experience

- [Tourism web app](https://github.com/athithyan24/kktour/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Destination discovery](https://github.com/athithyan24/kktour/blob/main/client/src/pages/Explore.jsx): `client/src/pages/Explore.jsx`
- [Spot details](https://github.com/athithyan24/kktour/blob/main/client/src/pages/Spot.jsx): `client/src/pages/Spot.jsx`
- [GIS map](https://github.com/athithyan24/kktour/blob/main/client/src/pages/MapPage.jsx): `client/src/pages/MapPage.jsx`
- [Trip planner](https://github.com/athithyan24/kktour/blob/main/client/src/pages/Planner.jsx): `client/src/pages/Planner.jsx`
- [Guides](https://github.com/athithyan24/kktour/blob/main/client/src/pages/Guides.jsx): `client/src/pages/Guides.jsx`
- [Saved places](https://github.com/athithyan24/kktour/blob/main/client/src/pages/Bookmarks.jsx): `client/src/pages/Bookmarks.jsx`
- [Reviews](https://github.com/athithyan24/kktour/blob/main/server/controllers/reviewController.js): `server/controllers/reviewController.js`

### Administration

- [Admin workspace](https://github.com/athithyan24/kktour/tree/main/client/src/pages/Admin): `client/src/pages/Admin`

### API and access

- [API application](https://github.com/athithyan24/kktour/blob/main/server/server.js): `server/server.js`
- [Authentication routes](https://github.com/athithyan24/kktour/blob/main/server/routes/authRoutes.js): `server/routes/authRoutes.js`
- [Destination routes](https://github.com/athithyan24/kktour/blob/main/server/routes/destinationRoutes.js): `server/routes/destinationRoutes.js`
- [Trip routes](https://github.com/athithyan24/kktour/blob/main/server/routes/tripRoutes.js): `server/routes/tripRoutes.js`
- [Content routes](https://github.com/athithyan24/kktour/blob/main/server/routes/contentRoutes.js): `server/routes/contentRoutes.js`
- [Review routes](https://github.com/athithyan24/kktour/blob/main/server/routes/reviewRoutes.js): `server/routes/reviewRoutes.js`

### Tourism domain

- [Destination management](https://github.com/athithyan24/kktour/blob/main/server/controllers/destinationController.js): `server/controllers/destinationController.js`
- [Nearby search](https://github.com/athithyan24/kktour/blob/main/server/services/nearbyService.js): `server/services/nearbyService.js`
- [Trip management](https://github.com/athithyan24/kktour/blob/main/server/controllers/tripController.js): `server/controllers/tripController.js`
- [Guides and content](https://github.com/athithyan24/kktour/blob/main/server/controllers/contentController.js): `server/controllers/contentController.js`
- [Tourism records](https://github.com/athithyan24/kktour/tree/main/server/models): `server/models`

### Shared services

- [Identity handling](https://github.com/athithyan24/kktour/blob/main/server/controllers/authController.js): `server/controllers/authController.js`
- [Access control](https://github.com/athithyan24/kktour/blob/main/server/middleware/authMiddleware.js): `server/middleware/authMiddleware.js`
- [MongoDB connection](https://github.com/athithyan24/kktour/blob/main/server/config/db.js): `server/config/db.js`
- [Itinerary generation](https://github.com/athithyan24/kktour/blob/main/server/utils/itinerary.js): `server/utils/itinerary.js`
- [HTTP client](https://github.com/athithyan24/kktour/blob/main/client/src/services/api.js): `client/src/services/api.js`

### Other components

- **Traveller**

## Connections

- Traveller → Tourism web app: uses
- Tourism web app → Destination discovery: routes to (evidence: `client/src/App.jsx`)
- Tourism web app → Spot details: routes to (evidence: `client/src/App.jsx`)
- Tourism web app → GIS map: routes to (evidence: `client/src/App.jsx`)
- Tourism web app → Trip planner: routes to (evidence: `client/src/App.jsx`)
- Tourism web app → Guides: routes to (evidence: `client/src/App.jsx`)
- Tourism web app → Saved places: routes to (evidence: `client/src/App.jsx`)
- Tourism web app → Admin workspace: routes to (evidence: `client/src/App.jsx`)
- API application → Authentication routes: mounts routes (evidence: `server/server.js`)
- API application → Destination routes: mounts routes (evidence: `server/server.js`)
- API application → Trip routes: mounts routes (evidence: `server/server.js`)
- API application → Content routes: mounts routes (evidence: `server/server.js`)
- API application → Review routes: mounts routes (evidence: `server/server.js`)
- Authentication routes → Identity handling: dispatches to (evidence: `server/routes/authRoutes.js`)
- Authentication routes → Access control: uses guards (evidence: `server/routes/authRoutes.js`)
- Destination routes → Destination management: dispatches to (evidence: `server/routes/destinationRoutes.js`)
- Destination routes → Access control: uses guards (evidence: `server/routes/destinationRoutes.js`)
- Trip routes → Trip management: dispatches to (evidence: `server/routes/tripRoutes.js`)
- Trip routes → Access control: uses guards (evidence: `server/routes/tripRoutes.js`)
- Content routes → Guides and content: dispatches to (evidence: `server/routes/contentRoutes.js`)
- Review routes → Reviews: dispatches to (evidence: `server/routes/reviewRoutes.js`)
- Review routes → Access control: uses guards (evidence: `server/routes/reviewRoutes.js`)
- Identity handling → Tourism records: reads and writes (evidence: `server/controllers/authController.js`)
- Destination management → Tourism records: reads and writes (evidence: `server/controllers/destinationController.js`)
- Destination management → Nearby search: requests nearby (evidence: `server/controllers/destinationController.js`)
- Destination management → Tourism records: uses categories (evidence: `server/controllers/destinationController.js`)
- Trip management → Tourism records: reads and writes (evidence: `server/controllers/tripController.js`)
- Trip management → Itinerary generation: generates plan (evidence: `server/controllers/tripController.js`)
- Guides and content → Tourism records: reads and writes (evidence: `server/controllers/contentController.js`)
- Reviews → Tourism records: updates ratings (evidence: `server/controllers/reviewController.js`)
- API application → MongoDB connection: connects (evidence: `server/server.js`)
- Tourism web app → HTTP client: uses HTTP
- HTTP client → API application: sends requests
