# hirukshanan/valluvam architecture

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

- Interactive diagram: https://gitdiagram.com/hirukshanan/valluvam
- Repository: https://github.com/hirukshanan/valluvam

## Overview

Valluvam is a nonprofit public website with a protected administration platform. Visitors browse organizational information and submit volunteer, support, or contact forms; administrators authenticate, manage content and submissions, and update settings. The React app routes these experiences to an Express API, whose domain controllers operate on MongoDB-backed records and use Cloudinary for media. The README documents bilingual UI and Turnstile protection; sampled excerpts show some, but not all, of those connections, so unverified links are omitted.

Main entry points: [`server/src/models`](https://github.com/hirukshanan/valluvam/tree/main/server/src/models) (Domain records), [`server/src/app.js`](https://github.com/hirukshanan/valluvam/blob/main/server/src/app.js) (Express API), [`client/src/App.jsx`](https://github.com/hirukshanan/valluvam/blob/main/client/src/App.jsx) (Protected routes), [`server/src/controllers/contactController.js`](https://github.com/hirukshanan/valluvam/blob/main/server/src/controllers/contactController.js) (Contact submissions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Website"]
  node_webapp["Public routes<br/>[App.jsx]"]
  node_publicpages["Public pages"]
  node_language["Language context"]
  node_settingsctx["Settings context"]
end

subgraph group_admin["Administration"]
  node_adminroutes["Protected routes<br/>[App.jsx]"]
  node_authctx["Authentication state<br/>[AuthContext.jsx]"]
  node_authservice["Admin authentication<br/>[authService.js]"]
  node_adminpages["Admin pages"]
  node_adminservices["Admin API services"]
end

subgraph group_api["API"]
  node_apiroot["Express API<br/>[app.js]"]
  node_routes["Feature routes"]
  node_authcontroller["Authentication logic<br/>[authController.js]"]
  node_contactcontroller["Contact submissions"]
  node_eventcontroller["Event management<br/>[eventController.js]"]
  node_gallerycontroller["Gallery management"]
  node_teamcontroller["Team management<br/>[teamController.js]"]
  node_volunteercontroller["Volunteer submissions"]
  node_supportcontroller["Support content"]
  node_settingscontroller["Organization settings"]
  node_dashboardcontroller["Dashboard statistics"]
end

subgraph group_integrations["Data and integrations"]
  node_models[("Domain records")]
  node_cloudinary[("Cloudinary media")]
  node_turnstile["Turnstile verification<br/>[turnstile.js]"]
  node_mongodb[("MongoDB")]
end

node_visitor(("Website visitor"))
node_administrator(("Administrator"))

node_visitor -->|"visits"| node_webapp
node_webapp -->|"routes to"| node_publicpages
node_administrator -->|"opens"| node_adminroutes
node_adminroutes -->|"routes to"| node_adminpages
node_adminroutes -->|"protects with"| node_authctx
node_authctx -->|"authenticates via"| node_authservice
node_authservice -->|"requests API"| node_apiroot
node_settingsctx -.->|"loads public settings"| node_apiroot
node_adminpages -.->|"uses services"| node_adminservices
node_adminservices -.->|"requests API"| node_apiroot
node_apiroot -->|"mounts routes"| node_routes
node_authcontroller -->|"reads user"| node_models
node_contactcontroller -->|"manages messages"| node_models
node_eventcontroller -->|"manages events"| node_models
node_gallerycontroller -->|"manages albums"| node_models
node_teamcontroller -->|"manages members"| node_models
node_supportcontroller -->|"manages options"| node_models
node_contactcontroller -->|"verifies token"| node_turnstile
node_volunteercontroller -->|"verifies token"| node_turnstile
node_eventcontroller -->|"uploads media"| node_cloudinary
node_gallerycontroller -->|"uploads media"| node_cloudinary
node_teamcontroller -->|"uploads photos"| node_cloudinary
node_models -.->|"persists records"| node_mongodb

click node_webapp "https://github.com/hirukshanan/valluvam/blob/main/client/src/App.jsx"
click node_publicpages "https://github.com/hirukshanan/valluvam/tree/main/client/src/pages"
click node_language "https://github.com/hirukshanan/valluvam/blob/main/client/src/context/LanguageContext.jsx"
click node_settingsctx "https://github.com/hirukshanan/valluvam/blob/main/client/src/context/SettingsContext.jsx"
click node_adminroutes "https://github.com/hirukshanan/valluvam/blob/main/client/src/App.jsx"
click node_authctx "https://github.com/hirukshanan/valluvam/blob/main/client/src/context/AuthContext.jsx"
click node_authservice "https://github.com/hirukshanan/valluvam/blob/main/client/src/services/authService.js"
click node_adminpages "https://github.com/hirukshanan/valluvam/tree/main/client/src/pages"
click node_adminservices "https://github.com/hirukshanan/valluvam/tree/main/client/src/services"
click node_apiroot "https://github.com/hirukshanan/valluvam/blob/main/server/src/app.js"
click node_routes "https://github.com/hirukshanan/valluvam/tree/main/server/src/routes"
click node_authcontroller "https://github.com/hirukshanan/valluvam/blob/main/server/src/controllers/authController.js"
click node_contactcontroller "https://github.com/hirukshanan/valluvam/blob/main/server/src/controllers/contactController.js"
click node_eventcontroller "https://github.com/hirukshanan/valluvam/blob/main/server/src/controllers/eventController.js"
click node_gallerycontroller "https://github.com/hirukshanan/valluvam/blob/main/server/src/controllers/galleryController.js"
click node_teamcontroller "https://github.com/hirukshanan/valluvam/blob/main/server/src/controllers/teamController.js"
click node_volunteercontroller "https://github.com/hirukshanan/valluvam/blob/main/server/src/controllers/volunteerController.js"
click node_supportcontroller "https://github.com/hirukshanan/valluvam/blob/main/server/src/controllers/supportController.js"
click node_settingscontroller "https://github.com/hirukshanan/valluvam/blob/main/server/src/controllers/settingsController.js"
click node_dashboardcontroller "https://github.com/hirukshanan/valluvam/blob/main/server/src/controllers/adminDashboardController.js"
click node_models "https://github.com/hirukshanan/valluvam/tree/main/server/src/models"
click node_turnstile "https://github.com/hirukshanan/valluvam/blob/main/server/src/utils/turnstile.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_publicpages,node_language,node_settingsctx toneBlue
class node_adminroutes,node_authctx,node_authservice,node_adminpages,node_adminservices toneAmber
class node_apiroot,node_routes,node_authcontroller,node_contactcontroller,node_eventcontroller,node_gallerycontroller,node_teamcontroller,node_volunteercontroller,node_supportcontroller,node_settingscontroller,node_dashboardcontroller toneMint
class node_models,node_cloudinary,node_turnstile,node_mongodb toneRose
class node_visitor,node_administrator toneIndigo
```

## Components

### Website

- [Public routes](https://github.com/hirukshanan/valluvam/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Public pages](https://github.com/hirukshanan/valluvam/tree/main/client/src/pages): `client/src/pages`
- [Language context](https://github.com/hirukshanan/valluvam/blob/main/client/src/context/LanguageContext.jsx): `client/src/context/LanguageContext.jsx`
- [Settings context](https://github.com/hirukshanan/valluvam/blob/main/client/src/context/SettingsContext.jsx): `client/src/context/SettingsContext.jsx`

### Administration

- [Protected routes](https://github.com/hirukshanan/valluvam/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Authentication state](https://github.com/hirukshanan/valluvam/blob/main/client/src/context/AuthContext.jsx): `client/src/context/AuthContext.jsx`
- [Admin authentication](https://github.com/hirukshanan/valluvam/blob/main/client/src/services/authService.js): `client/src/services/authService.js`
- [Admin pages](https://github.com/hirukshanan/valluvam/tree/main/client/src/pages): `client/src/pages`
- [Admin API services](https://github.com/hirukshanan/valluvam/tree/main/client/src/services): `client/src/services`

### API

- [Express API](https://github.com/hirukshanan/valluvam/blob/main/server/src/app.js): `server/src/app.js`
- [Feature routes](https://github.com/hirukshanan/valluvam/tree/main/server/src/routes): `server/src/routes`
- [Authentication logic](https://github.com/hirukshanan/valluvam/blob/main/server/src/controllers/authController.js): `server/src/controllers/authController.js`
- [Contact submissions](https://github.com/hirukshanan/valluvam/blob/main/server/src/controllers/contactController.js): `server/src/controllers/contactController.js`
- [Event management](https://github.com/hirukshanan/valluvam/blob/main/server/src/controllers/eventController.js): `server/src/controllers/eventController.js`
- [Gallery management](https://github.com/hirukshanan/valluvam/blob/main/server/src/controllers/galleryController.js): `server/src/controllers/galleryController.js`
- [Team management](https://github.com/hirukshanan/valluvam/blob/main/server/src/controllers/teamController.js): `server/src/controllers/teamController.js`
- [Volunteer submissions](https://github.com/hirukshanan/valluvam/blob/main/server/src/controllers/volunteerController.js): `server/src/controllers/volunteerController.js`
- [Support content](https://github.com/hirukshanan/valluvam/blob/main/server/src/controllers/supportController.js): `server/src/controllers/supportController.js`
- [Organization settings](https://github.com/hirukshanan/valluvam/blob/main/server/src/controllers/settingsController.js): `server/src/controllers/settingsController.js`
- [Dashboard statistics](https://github.com/hirukshanan/valluvam/blob/main/server/src/controllers/adminDashboardController.js): `server/src/controllers/adminDashboardController.js`

### Data and integrations

- [Domain records](https://github.com/hirukshanan/valluvam/tree/main/server/src/models): `server/src/models`
- **Cloudinary media**
- [Turnstile verification](https://github.com/hirukshanan/valluvam/blob/main/server/src/utils/turnstile.js): `server/src/utils/turnstile.js`
- **MongoDB**

### Other components

- **Website visitor**
- **Administrator**

## Connections

- Website visitor → Public routes: visits (evidence: `client/src/App.jsx`)
- Public routes → Public pages: routes to (evidence: `client/src/App.jsx`)
- Administrator → Protected routes: opens (evidence: `client/src/App.jsx`)
- Protected routes → Admin pages: routes to (evidence: `client/src/App.jsx`)
- Protected routes → Authentication state: protects with (evidence: `client/src/App.jsx`)
- Authentication state → Admin authentication: authenticates via (evidence: `client/src/context/AuthContext.jsx`)
- Admin authentication → Express API: requests API (evidence: `client/src/services/authService.js`)
- Settings context → Express API: loads public settings
- Admin pages → Admin API services: uses services (evidence: `client/src/pages/AdminGallery.jsx`)
- Admin API services → Express API: requests API
- Express API → Feature routes: mounts routes (evidence: `server/src/app.js`)
- Authentication logic → Domain records: reads user (evidence: `server/src/controllers/authController.js`)
- Contact submissions → Domain records: manages messages (evidence: `server/src/controllers/contactController.js`)
- Event management → Domain records: manages events (evidence: `server/src/controllers/eventController.js`)
- Gallery management → Domain records: manages albums (evidence: `server/src/controllers/galleryController.js`)
- Team management → Domain records: manages members (evidence: `server/src/controllers/teamController.js`)
- Support content → Domain records: manages options (evidence: `server/src/controllers/supportController.js`)
- Contact submissions → Turnstile verification: verifies token (evidence: `server/src/controllers/contactController.js`)
- Volunteer submissions → Turnstile verification: verifies token (evidence: `server/src/controllers/volunteerController.js`)
- Event management → Cloudinary media: uploads media (evidence: `server/src/controllers/eventController.js`)
- Gallery management → Cloudinary media: uploads media (evidence: `server/src/controllers/galleryController.js`)
- Team management → Cloudinary media: uploads photos (evidence: `server/src/controllers/teamController.js`)
- Domain records → MongoDB: persists records
