# akshith0412/eventhub architecture

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

- Interactive diagram: https://gitdiagram.com/akshith0412/eventhub
- Repository: https://github.com/akshith0412/eventhub

## Overview

EventHub is a multi-role event booking and hosting platform. Customers register and verify accounts, browse or search events, book or cancel seats, and view history; creators pass admin verification before managing events and check-ins; admins moderate creators and listings. React dashboards call the Express API, whose controllers coordinate persistence, caching, queued email, and documented real-time updates. The tree and README support these product branches, but several client pages and backend subsystems were not sampled, so uncertain implementation links are omitted.

Main entry points: [`backend/controllers/eventController.js`](https://github.com/akshith0412/eventhub/blob/main/backend/controllers/eventController.js) (Event controller), [`frontend/src/App.jsx`](https://github.com/akshith0412/eventhub/blob/main/frontend/src/App.jsx) (Role dashboards), [`frontend/src/api.js`](https://github.com/akshith0412/eventhub/blob/main/frontend/src/api.js) (HTTP client), [`backend/app.js`](https://github.com/akshith0412/eventhub/blob/main/backend/app.js) (Express app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["React client"]
  node_appui["Role dashboards<br/>[App.jsx]"]
  node_customerui["Customer dashboard"]
  node_creatorui["Creator dashboard"]
  node_adminui["Admin dashboard<br/>[AdminDashboard.jsx]"]
  node_authui["Auth pages"]
  node_apiclient["HTTP client<br/>[api.js]"]
  node_socketclient["Socket client<br/>[socket.js]"]
end

subgraph group_api["API and identity"]
  node_server["Express app<br/>[app.js]"]
  node_authroutes["Auth routes<br/>[authRoutes.js]"]
  node_authcontroller["Auth controller<br/>[authController.js]"]
  node_authmodels["Account models"]
  node_otp["OTP service<br/>[otpService.js]"]
end

subgraph group_events["Event operations"]
  node_eventroutes["Event routes<br/>[eventRoutes.js]"]
  node_eventcontroller["Event controller<br/>[eventController.js]"]
  node_eventmodels["Event and booking models<br/>[eventsModel.js]"]
  node_adminroutes["Admin routes<br/>[adminRoutes.js]"]
  node_admincontroller["Admin controller<br/>[adminController.js]"]
end

subgraph group_platform["Platform services"]
  node_mongo[("MongoDB")]
  node_cache["Cache service<br/>[cacheService.js]"]
  node_redis[("Redis<br/>[redis.js]")]
  node_socketserver["Socket.IO server<br/>[socket.js]"]
end

subgraph group_messaging["Async messaging"]
  node_emailqueue["Email queue<br/>[emailQueue.js]"]
  node_worker["Email worker<br/>[emailWorker.js]"]
  node_mail["Mail service<br/>[mailService.js]"]
end

node_people(("Platform users"))
node_smtp(("SMTP provider"))

node_people -->|"use dashboards"| node_appui
node_appui -->|"navigate to"| node_authui
node_appui -->|"open role view"| node_customerui
node_appui -->|"open role view"| node_creatorui
node_appui -->|"open role view"| node_adminui
node_authui -->|"submit requests"| node_apiclient
node_customerui -->|"request event actions"| node_apiclient
node_creatorui -->|"request event actions"| node_apiclient
node_adminui -->|"request moderation"| node_apiclient
node_creatorui -.->|"receive live updates"| node_socketclient
node_apiclient -->|"send HTTP requests"| node_server
node_server -->|"mount routes"| node_authroutes
node_server -->|"mount routes"| node_eventroutes
node_server -->|"mount routes"| node_adminroutes
node_authroutes -->|"dispatch handlers"| node_authcontroller
node_authcontroller -->|"store or verify OTP"| node_otp
node_authcontroller -->|"read and write accounts"| node_authmodels
node_authcontroller -->|"enqueue mail jobs"| node_emailqueue
node_otp -->|"store OTP state"| node_redis
node_eventroutes -->|"dispatch handlers"| node_eventcontroller
node_eventcontroller -->|"read and update records"| node_eventmodels
node_eventcontroller -->|"run transactions"| node_mongo
node_eventcontroller -->|"read and invalidate cache"| node_cache
node_cache -->|"get and set keys"| node_redis
node_eventcontroller -->|"enqueue notifications"| node_emailqueue
node_adminroutes -->|"dispatch handlers"| node_admincontroller
node_admincontroller -->|"moderate events"| node_eventmodels
node_admincontroller -->|"read and verify accounts"| node_authmodels
node_admincontroller -->|"invalidate listings"| node_cache
node_eventcontroller -.->|"push activity updates"| node_socketserver
node_socketserver -.->|"emit creator updates"| node_socketclient
node_emailqueue -->|"persist jobs"| node_redis
node_worker -->|"consume jobs"| node_redis
node_worker -->|"dispatch email type"| node_mail
node_mail -->|"send email"| node_smtp

click node_appui "https://github.com/akshith0412/eventhub/blob/main/frontend/src/App.jsx"
click node_customerui "https://github.com/akshith0412/eventhub/blob/main/frontend/src/pages/Customer/CustomerDashboard.jsx"
click node_creatorui "https://github.com/akshith0412/eventhub/blob/main/frontend/src/pages/Creator/CreatorDashboard.jsx"
click node_adminui "https://github.com/akshith0412/eventhub/blob/main/frontend/src/pages/Admin/AdminDashboard.jsx"
click node_authui "https://github.com/akshith0412/eventhub/tree/main/frontend/src/pages/Auth"
click node_apiclient "https://github.com/akshith0412/eventhub/blob/main/frontend/src/api.js"
click node_socketclient "https://github.com/akshith0412/eventhub/blob/main/frontend/src/socket.js"
click node_server "https://github.com/akshith0412/eventhub/blob/main/backend/app.js"
click node_authroutes "https://github.com/akshith0412/eventhub/blob/main/backend/routes/authRoutes.js"
click node_authcontroller "https://github.com/akshith0412/eventhub/blob/main/backend/controllers/authController.js"
click node_authmodels "https://github.com/akshith0412/eventhub/tree/main/backend/models"
click node_otp "https://github.com/akshith0412/eventhub/blob/main/backend/services/otpService.js"
click node_eventroutes "https://github.com/akshith0412/eventhub/blob/main/backend/routes/eventRoutes.js"
click node_eventcontroller "https://github.com/akshith0412/eventhub/blob/main/backend/controllers/eventController.js"
click node_eventmodels "https://github.com/akshith0412/eventhub/blob/main/backend/models/eventsModel.js"
click node_adminroutes "https://github.com/akshith0412/eventhub/blob/main/backend/routes/adminRoutes.js"
click node_admincontroller "https://github.com/akshith0412/eventhub/blob/main/backend/controllers/adminController.js"
click node_cache "https://github.com/akshith0412/eventhub/blob/main/backend/services/cacheService.js"
click node_redis "https://github.com/akshith0412/eventhub/blob/main/backend/config/redis.js"
click node_socketserver "https://github.com/akshith0412/eventhub/blob/main/backend/config/socket.js"
click node_emailqueue "https://github.com/akshith0412/eventhub/blob/main/backend/queues/emailQueue.js"
click node_worker "https://github.com/akshith0412/eventhub/blob/main/backend/workers/emailWorker.js"
click node_mail "https://github.com/akshith0412/eventhub/blob/main/backend/services/mailService.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_appui,node_customerui,node_creatorui,node_adminui,node_authui,node_apiclient,node_socketclient,node_people toneBlue
class node_server,node_authroutes,node_authcontroller,node_authmodels,node_otp toneAmber
class node_eventroutes,node_eventcontroller,node_eventmodels,node_adminroutes,node_admincontroller toneMint
class node_mongo,node_cache,node_redis,node_socketserver toneRose
class node_emailqueue,node_worker,node_mail,node_smtp toneIndigo
```

## Components

### React client

- [Role dashboards](https://github.com/akshith0412/eventhub/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Customer dashboard](https://github.com/akshith0412/eventhub/blob/main/frontend/src/pages/Customer/CustomerDashboard.jsx): `frontend/src/pages/Customer/CustomerDashboard.jsx`
- [Creator dashboard](https://github.com/akshith0412/eventhub/blob/main/frontend/src/pages/Creator/CreatorDashboard.jsx): `frontend/src/pages/Creator/CreatorDashboard.jsx`
- [Admin dashboard](https://github.com/akshith0412/eventhub/blob/main/frontend/src/pages/Admin/AdminDashboard.jsx): `frontend/src/pages/Admin/AdminDashboard.jsx`
- [Auth pages](https://github.com/akshith0412/eventhub/tree/main/frontend/src/pages/Auth): `frontend/src/pages/Auth`
- [HTTP client](https://github.com/akshith0412/eventhub/blob/main/frontend/src/api.js): `frontend/src/api.js`
- [Socket client](https://github.com/akshith0412/eventhub/blob/main/frontend/src/socket.js): `frontend/src/socket.js`

### API and identity

- [Express app](https://github.com/akshith0412/eventhub/blob/main/backend/app.js): `backend/app.js`
- [Auth routes](https://github.com/akshith0412/eventhub/blob/main/backend/routes/authRoutes.js): `backend/routes/authRoutes.js`
- [Auth controller](https://github.com/akshith0412/eventhub/blob/main/backend/controllers/authController.js): `backend/controllers/authController.js`
- [Account models](https://github.com/akshith0412/eventhub/tree/main/backend/models): `backend/models`
- [OTP service](https://github.com/akshith0412/eventhub/blob/main/backend/services/otpService.js): `backend/services/otpService.js`

### Event operations

- [Event routes](https://github.com/akshith0412/eventhub/blob/main/backend/routes/eventRoutes.js): `backend/routes/eventRoutes.js`
- [Event controller](https://github.com/akshith0412/eventhub/blob/main/backend/controllers/eventController.js): `backend/controllers/eventController.js`
- [Event and booking models](https://github.com/akshith0412/eventhub/blob/main/backend/models/eventsModel.js): `backend/models/eventsModel.js`
- [Admin routes](https://github.com/akshith0412/eventhub/blob/main/backend/routes/adminRoutes.js): `backend/routes/adminRoutes.js`
- [Admin controller](https://github.com/akshith0412/eventhub/blob/main/backend/controllers/adminController.js): `backend/controllers/adminController.js`

### Platform services

- **MongoDB**
- [Cache service](https://github.com/akshith0412/eventhub/blob/main/backend/services/cacheService.js): `backend/services/cacheService.js`
- [Redis](https://github.com/akshith0412/eventhub/blob/main/backend/config/redis.js): `backend/config/redis.js`
- [Socket.IO server](https://github.com/akshith0412/eventhub/blob/main/backend/config/socket.js): `backend/config/socket.js`

### Async messaging

- [Email queue](https://github.com/akshith0412/eventhub/blob/main/backend/queues/emailQueue.js): `backend/queues/emailQueue.js`
- [Email worker](https://github.com/akshith0412/eventhub/blob/main/backend/workers/emailWorker.js): `backend/workers/emailWorker.js`
- [Mail service](https://github.com/akshith0412/eventhub/blob/main/backend/services/mailService.js): `backend/services/mailService.js`

### Other components

- **Platform users**
- **SMTP provider**

## Connections

- Platform users → Role dashboards: use dashboards
- Role dashboards → Auth pages: navigate to
- Role dashboards → Customer dashboard: open role view
- Role dashboards → Creator dashboard: open role view
- Role dashboards → Admin dashboard: open role view
- Auth pages → HTTP client: submit requests
- Customer dashboard → HTTP client: request event actions
- Creator dashboard → HTTP client: request event actions
- Admin dashboard → HTTP client: request moderation
- Creator dashboard → Socket client: receive live updates
- HTTP client → Express app: send HTTP requests
- Express app → Auth routes: mount routes
- Express app → Event routes: mount routes
- Express app → Admin routes: mount routes
- Auth routes → Auth controller: dispatch handlers
- Auth controller → OTP service: store or verify OTP
- Auth controller → Account models: read and write accounts
- Auth controller → Email queue: enqueue mail jobs
- OTP service → Redis: store OTP state
- Event routes → Event controller: dispatch handlers
- Event controller → Event and booking models: read and update records
- Event controller → MongoDB: run transactions
- Event controller → Cache service: read and invalidate cache
- Cache service → Redis: get and set keys
- Event controller → Email queue: enqueue notifications
- Admin routes → Admin controller: dispatch handlers
- Admin controller → Event and booking models: moderate events
- Admin controller → Account models: read and verify accounts
- Admin controller → Cache service: invalidate listings
- Event controller → Socket.IO server: push activity updates
- Socket.IO server → Socket client: emit creator updates
- Email queue → Redis: persist jobs
- Email worker → Redis: consume jobs
- Email worker → Mail service: dispatch email type
- Mail service → SMTP provider: send email
