# ayushiverma844/heritagesphere architecture

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

- Interactive diagram: https://gitdiagram.com/ayushiverma844/heritagesphere
- Repository: https://github.com/ayushiverma844/heritagesphere

## Overview

HeritageSphere is a heritage-discovery and storytelling application: visitors explore places and collections, browse a knowledge hub, and read illustrated, chapter-based stories; signed-in users can manage profiles and collections and review places. Administrators manage places, stories, categories, and users, and view dashboard analytics. The graph follows the visible frontend routing and backend mounting, with sampled review, story, and authentication implementation details. Several domain modules are present in the tree but their internal wiring was not sampled, so those links are left out.

Main entry points: [`Frontend/src/App.jsx`](https://github.com/ayushiverma844/heritagesphere/blob/main/Frontend/src/App.jsx) (Route experience), [`Backend/app.js`](https://github.com/ayushiverma844/heritagesphere/blob/main/Backend/app.js) (API application), [`Frontend/src/api/api.js`](https://github.com/ayushiverma844/heritagesphere/blob/main/Frontend/src/api/api.js) (HTTP client), [`Frontend/src/pages/AdminDashboard.jsx`](https://github.com/ayushiverma844/heritagesphere/blob/main/Frontend/src/pages/AdminDashboard.jsx) (Admin workspace)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_app["Route experience<br/>[App.jsx]"]
  node_explore["Place discovery<br/>[Explore.jsx]"]
  node_placeview["Place details<br/>[PlaceDetails.jsx]"]
  node_api["HTTP client<br/>[api.js]"]
end

subgraph group_identity["Identity and community"]
  node_auth["Authentication<br/>[Auth.jsx]"]
  node_authservice["Auth service<br/>[authService.js]"]
  node_authstate["Auth state<br/>[AuthContext.jsx]"]
  node_collection["My collection<br/>[MyCollection.jsx]"]
  node_profile["User profile<br/>[Profile.jsx]"]
  node_reviews["Place reviews<br/>[reviewService.js]"]
end

subgraph group_heritage["Heritage content"]
  node_knowledge["Knowledge hub<br/>[KnowledgeHub.jsx]"]
  node_storyview["Story reader<br/>[Story.jsx]"]
end

subgraph group_operations["Administration"]
  node_adminui["Admin workspace<br/>[AdminDashboard.jsx]"]
  node_admincontent["Content management<br/>[ManageStories.jsx]"]
  node_adminstats["Dashboard data"]
end

subgraph group_backend["Backend services"]
  node_server["API application<br/>[app.js]"]
  node_authroutes["Auth endpoints<br/>[authRoutes.js]"]
  node_storyroutes["Story endpoints<br/>[storyRoutes.js]"]
  node_reviewroutes["Review endpoints<br/>[reviewroutes.js]"]
  node_storycontroller["Story operations<br/>[storyController.js]"]
  node_reviewcontroller["Review operations"]
  node_authcontroller["Account operations<br/>[authController.js]"]
  node_database[("Application database<br/>[db.js]")]
  node_mail["Email service<br/>[mail.js]"]
  node_cloudinary["Image storage<br/>[cloudinary.js]"]
end

node_visitor(("Visitor or user"))

node_visitor -->|"opens"| node_app
node_app -->|"routes to"| node_explore
node_app -->|"routes to"| node_knowledge
node_app -->|"routes to"| node_storyview
node_app -->|"routes to"| node_placeview
node_app -->|"routes to"| node_auth
node_app -->|"routes to"| node_collection
node_app -->|"routes to"| node_profile
node_app -->|"routes to"| node_adminui
node_auth -->|"uses"| node_authservice
node_authservice -->|"requests"| node_api
node_reviews -->|"requests"| node_api
node_adminui -->|"opens"| node_admincontent
node_adminui -->|"loads"| node_adminstats
node_adminstats -->|"requests"| node_api
node_api -->|"sends requests"| node_server
node_server -->|"mounts"| node_authroutes
node_server -->|"mounts"| node_storyroutes
node_server -->|"mounts"| node_reviewroutes
node_authroutes -->|"dispatches"| node_authcontroller
node_storyroutes -->|"dispatches"| node_storycontroller
node_reviewroutes -->|"dispatches"| node_reviewcontroller
node_authcontroller -->|"queries"| node_database
node_authcontroller -->|"sends OTP email"| node_mail
node_storycontroller -->|"queries"| node_database
node_storycontroller -.->|"stores images"| node_cloudinary
node_reviewcontroller -->|"reads and writes"| node_database

click node_app "https://github.com/ayushiverma844/heritagesphere/blob/main/Frontend/src/App.jsx"
click node_explore "https://github.com/ayushiverma844/heritagesphere/blob/main/Frontend/src/pages/Explore.jsx"
click node_knowledge "https://github.com/ayushiverma844/heritagesphere/blob/main/Frontend/src/pages/KnowledgeHub.jsx"
click node_storyview "https://github.com/ayushiverma844/heritagesphere/blob/main/Frontend/src/pages/Story.jsx"
click node_placeview "https://github.com/ayushiverma844/heritagesphere/blob/main/Frontend/src/pages/PlaceDetails.jsx"
click node_api "https://github.com/ayushiverma844/heritagesphere/blob/main/Frontend/src/api/api.js"
click node_auth "https://github.com/ayushiverma844/heritagesphere/blob/main/Frontend/src/pages/Auth.jsx"
click node_authservice "https://github.com/ayushiverma844/heritagesphere/blob/main/Frontend/src/services/authService.js"
click node_authstate "https://github.com/ayushiverma844/heritagesphere/blob/main/Frontend/src/context/AuthContext.jsx"
click node_collection "https://github.com/ayushiverma844/heritagesphere/blob/main/Frontend/src/pages/MyCollection.jsx"
click node_profile "https://github.com/ayushiverma844/heritagesphere/blob/main/Frontend/src/pages/Profile.jsx"
click node_reviews "https://github.com/ayushiverma844/heritagesphere/blob/main/Frontend/src/services/reviewService.js"
click node_adminui "https://github.com/ayushiverma844/heritagesphere/blob/main/Frontend/src/pages/AdminDashboard.jsx"
click node_admincontent "https://github.com/ayushiverma844/heritagesphere/blob/main/Frontend/src/components/Admin/ManageStories.jsx"
click node_adminstats "https://github.com/ayushiverma844/heritagesphere/blob/main/Frontend/src/services/adminDashboardService.js"
click node_server "https://github.com/ayushiverma844/heritagesphere/blob/main/Backend/app.js"
click node_authroutes "https://github.com/ayushiverma844/heritagesphere/blob/main/Backend/routes/authRoutes.js"
click node_storyroutes "https://github.com/ayushiverma844/heritagesphere/blob/main/Backend/routes/storyRoutes.js"
click node_reviewroutes "https://github.com/ayushiverma844/heritagesphere/blob/main/Backend/routes/reviewroutes.js"
click node_storycontroller "https://github.com/ayushiverma844/heritagesphere/blob/main/Backend/controllers/storyController.js"
click node_reviewcontroller "https://github.com/ayushiverma844/heritagesphere/blob/main/Backend/controllers/reviewController.js"
click node_authcontroller "https://github.com/ayushiverma844/heritagesphere/blob/main/Backend/controllers/authController.js"
click node_database "https://github.com/ayushiverma844/heritagesphere/blob/main/Backend/config/db.js"
click node_mail "https://github.com/ayushiverma844/heritagesphere/blob/main/Backend/config/mail.js"
click node_cloudinary "https://github.com/ayushiverma844/heritagesphere/blob/main/Backend/config/cloudinary.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_app,node_explore,node_placeview,node_api,node_visitor toneBlue
class node_auth,node_authservice,node_authstate,node_collection,node_profile,node_reviews toneAmber
class node_knowledge,node_storyview toneMint
class node_adminui,node_admincontent,node_adminstats toneRose
class node_server,node_authroutes,node_storyroutes,node_reviewroutes,node_storycontroller,node_reviewcontroller,node_authcontroller,node_database,node_mail,node_cloudinary toneIndigo
```

## Components

### Web experience

- [Route experience](https://github.com/ayushiverma844/heritagesphere/blob/main/Frontend/src/App.jsx): `Frontend/src/App.jsx`
- [Place discovery](https://github.com/ayushiverma844/heritagesphere/blob/main/Frontend/src/pages/Explore.jsx): `Frontend/src/pages/Explore.jsx`
- [Place details](https://github.com/ayushiverma844/heritagesphere/blob/main/Frontend/src/pages/PlaceDetails.jsx): `Frontend/src/pages/PlaceDetails.jsx`
- [HTTP client](https://github.com/ayushiverma844/heritagesphere/blob/main/Frontend/src/api/api.js): `Frontend/src/api/api.js`

### Identity and community

- [Authentication](https://github.com/ayushiverma844/heritagesphere/blob/main/Frontend/src/pages/Auth.jsx): `Frontend/src/pages/Auth.jsx`
- [Auth service](https://github.com/ayushiverma844/heritagesphere/blob/main/Frontend/src/services/authService.js): `Frontend/src/services/authService.js`
- [Auth state](https://github.com/ayushiverma844/heritagesphere/blob/main/Frontend/src/context/AuthContext.jsx): `Frontend/src/context/AuthContext.jsx`
- [My collection](https://github.com/ayushiverma844/heritagesphere/blob/main/Frontend/src/pages/MyCollection.jsx): `Frontend/src/pages/MyCollection.jsx`
- [User profile](https://github.com/ayushiverma844/heritagesphere/blob/main/Frontend/src/pages/Profile.jsx): `Frontend/src/pages/Profile.jsx`
- [Place reviews](https://github.com/ayushiverma844/heritagesphere/blob/main/Frontend/src/services/reviewService.js): `Frontend/src/services/reviewService.js`

### Heritage content

- [Knowledge hub](https://github.com/ayushiverma844/heritagesphere/blob/main/Frontend/src/pages/KnowledgeHub.jsx): `Frontend/src/pages/KnowledgeHub.jsx`
- [Story reader](https://github.com/ayushiverma844/heritagesphere/blob/main/Frontend/src/pages/Story.jsx): `Frontend/src/pages/Story.jsx`

### Administration

- [Admin workspace](https://github.com/ayushiverma844/heritagesphere/blob/main/Frontend/src/pages/AdminDashboard.jsx): `Frontend/src/pages/AdminDashboard.jsx`
- [Content management](https://github.com/ayushiverma844/heritagesphere/blob/main/Frontend/src/components/Admin/ManageStories.jsx): `Frontend/src/components/Admin/ManageStories.jsx`
- [Dashboard data](https://github.com/ayushiverma844/heritagesphere/blob/main/Frontend/src/services/adminDashboardService.js): `Frontend/src/services/adminDashboardService.js`

### Backend services

- [API application](https://github.com/ayushiverma844/heritagesphere/blob/main/Backend/app.js): `Backend/app.js`
- [Auth endpoints](https://github.com/ayushiverma844/heritagesphere/blob/main/Backend/routes/authRoutes.js): `Backend/routes/authRoutes.js`
- [Story endpoints](https://github.com/ayushiverma844/heritagesphere/blob/main/Backend/routes/storyRoutes.js): `Backend/routes/storyRoutes.js`
- [Review endpoints](https://github.com/ayushiverma844/heritagesphere/blob/main/Backend/routes/reviewroutes.js): `Backend/routes/reviewroutes.js`
- [Story operations](https://github.com/ayushiverma844/heritagesphere/blob/main/Backend/controllers/storyController.js): `Backend/controllers/storyController.js`
- [Review operations](https://github.com/ayushiverma844/heritagesphere/blob/main/Backend/controllers/reviewController.js): `Backend/controllers/reviewController.js`
- [Account operations](https://github.com/ayushiverma844/heritagesphere/blob/main/Backend/controllers/authController.js): `Backend/controllers/authController.js`
- [Application database](https://github.com/ayushiverma844/heritagesphere/blob/main/Backend/config/db.js): `Backend/config/db.js`
- [Email service](https://github.com/ayushiverma844/heritagesphere/blob/main/Backend/config/mail.js): `Backend/config/mail.js`
- [Image storage](https://github.com/ayushiverma844/heritagesphere/blob/main/Backend/config/cloudinary.js): `Backend/config/cloudinary.js`

### Other components

- **Visitor or user**

## Connections

- Visitor or user → Route experience: opens
- Route experience → Place discovery: routes to
- Route experience → Knowledge hub: routes to
- Route experience → Story reader: routes to
- Route experience → Place details: routes to
- Route experience → Authentication: routes to
- Route experience → My collection: routes to
- Route experience → User profile: routes to
- Route experience → Admin workspace: routes to
- Authentication → Auth service: uses
- Auth service → HTTP client: requests
- Place reviews → HTTP client: requests
- Admin workspace → Content management: opens
- Admin workspace → Dashboard data: loads
- Dashboard data → HTTP client: requests
- HTTP client → API application: sends requests
- API application → Auth endpoints: mounts
- API application → Story endpoints: mounts
- API application → Review endpoints: mounts
- Auth endpoints → Account operations: dispatches
- Story endpoints → Story operations: dispatches
- Review endpoints → Review operations: dispatches
- Account operations → Application database: queries
- Account operations → Email service: sends OTP email
- Story operations → Application database: queries
- Story operations → Image storage: stores images
- Review operations → Application database: reads and writes
