# abdulwahab595/campus-event-hub architecture

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

- Interactive diagram: https://gitdiagram.com/abdulwahab595/campus-event-hub
- Repository: https://github.com/abdulwahab595/campus-event-hub

## Overview

Campus Event Hub is a web app for students to discover events and manage registrations, and for organizers to publish and maintain events. Users enter through the routed React app, which fetches data through a shared API client; the Express API authenticates and dispatches requests to domain controllers that read or write MongoDB. The major workflows include account registration and email verification, event discovery and organizer CRUD, and student registration management. Reminder and announcement email capabilities are represented from indexed source references; their exact runtime behavior is not fully excerpted.

Main entry points: [`src/api.js`](https://github.com/abdulwahab595/campus-event-hub/blob/main/src/api.js) (API client), [`src/App.jsx`](https://github.com/abdulwahab595/campus-event-hub/blob/main/src/App.jsx) (Routed app), [`server/controllers/eventController.js`](https://github.com/abdulwahab595/campus-event-hub/blob/main/server/controllers/eventController.js) (Event service), [`server/routes/eventRoutes.js`](https://github.com/abdulwahab595/campus-event-hub/blob/main/server/routes/eventRoutes.js) (Event routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_app["Routed app<br/>[App.jsx]"]
  node_event_browse["Event discovery<br/>[EventsPage.jsx]"]
  node_event_details["Event details"]
  node_my_regs["My registrations"]
  node_auth_pages["Account pages<br/>[RegisterPage.jsx]"]
  node_login_page["Login page<br/>[LoginPage.jsx]"]
  node_verify_page["Email verification"]
  node_organizer_pages["Organizer tools<br/>[OrganizerPage.jsx]"]
  node_event_form["Event editor"]
  node_event_card["Event card<br/>[EventCard.jsx]"]
  node_api_client["API client<br/>[api.js]"]
  node_client_state["Client state<br/>[store.js]"]
end

subgraph group_server["API and domain"]
  node_auth_routes["Auth routes<br/>[authRoutes.js]"]
  node_event_routes["Event routes<br/>[eventRoutes.js]"]
  node_registration_routes["Registration routes"]
  node_auth_controller["Account service<br/>[authController.js]"]
  node_event_controller["Event service<br/>[eventController.js]"]
  node_registration_controller["Registration service"]
  node_auth_middleware["Auth and roles<br/>[auth.js]"]
  node_event_data["Event shaping<br/>[eventData.js]"]
  node_server_entry["API startup<br/>[index.js]"]
end

subgraph group_persistence["MongoDB data"]
  node_user_store[("User accounts<br/>[User.js]")]
  node_event_store[("Events<br/>[Event.js]")]
  node_registration_store[("Registrations<br/>[Registration.js]")]
end

subgraph group_messaging["Email messaging"]
  node_announcement["Event announcements"]
  node_reminders["Event reminders"]
  node_email_sender["Email transport<br/>[sendEmail.js]"]
end

node_visitor(("Student or organizer"))
node_email_service(("Email provider"))

node_visitor -->|"uses"| node_app
node_app -->|"routes to"| node_event_browse
node_app -->|"routes to"| node_event_details
node_app -->|"routes to"| node_my_regs
node_app -->|"routes to"| node_auth_pages
node_app -->|"routes to"| node_login_page
node_app -->|"routes to"| node_verify_page
node_app -->|"routes to"| node_organizer_pages
node_app -->|"routes to"| node_event_form
node_app -->|"restores session via"| node_api_client
node_app -->|"dispatches to"| node_client_state
node_event_browse -->|"requests data via"| node_api_client
node_event_details -->|"requests data via"| node_api_client
node_my_regs -->|"requests data via"| node_api_client
node_login_page -->|"requests data via"| node_api_client
node_auth_pages -->|"requests data via"| node_api_client
node_verify_page -->|"requests data via"| node_api_client
node_organizer_pages -->|"requests data via"| node_api_client
node_event_form -->|"requests data via"| node_api_client
node_event_browse -->|"renders"| node_event_card
node_my_regs -->|"renders"| node_event_card
node_api_client -->|"dispatches auth errors to"| node_client_state
node_api_client -.->|"sends HTTP requests"| node_auth_routes
node_api_client -.->|"sends HTTP requests"| node_event_routes
node_api_client -.->|"sends HTTP requests"| node_registration_routes
node_server_entry -->|"mounts"| node_auth_routes
node_server_entry -->|"mounts"| node_event_routes
node_server_entry -->|"mounts"| node_registration_routes
node_event_routes -->|"protects routes"| node_auth_middleware
node_registration_routes -.->|"protects routes"| node_auth_middleware
node_auth_routes -->|"dispatches to"| node_auth_controller
node_event_routes -->|"dispatches to"| node_event_controller
node_event_routes -->|"dispatches to"| node_registration_controller
node_registration_routes -->|"dispatches to"| node_registration_controller
node_auth_middleware -->|"loads verified user"| node_user_store
node_auth_controller -->|"reads and writes"| node_user_store
node_event_controller -->|"reads and writes"| node_event_store
node_event_controller -->|"deletes registrations"| node_registration_store
node_event_controller -->|"formats responses"| node_event_data
node_registration_controller -->|"checks events"| node_event_store
node_registration_controller -->|"manages registrations"| node_registration_store
node_registration_controller -->|"formats events"| node_event_data
node_event_controller -->|"sends announcement"| node_announcement
node_server_entry -->|"schedules"| node_reminders
node_announcement -->|"sends through"| node_email_sender
node_reminders -->|"sends through"| node_email_sender
node_email_sender -.->|"delivers email"| node_email_service

click node_app "https://github.com/abdulwahab595/campus-event-hub/blob/main/src/App.jsx"
click node_event_browse "https://github.com/abdulwahab595/campus-event-hub/blob/main/src/pages/EventsPage.jsx"
click node_event_details "https://github.com/abdulwahab595/campus-event-hub/blob/main/src/pages/EventDetailsPage.jsx"
click node_my_regs "https://github.com/abdulwahab595/campus-event-hub/blob/main/src/pages/MyRegistrationsPage.jsx"
click node_auth_pages "https://github.com/abdulwahab595/campus-event-hub/blob/main/src/pages/RegisterPage.jsx"
click node_login_page "https://github.com/abdulwahab595/campus-event-hub/blob/main/src/pages/LoginPage.jsx"
click node_verify_page "https://github.com/abdulwahab595/campus-event-hub/blob/main/src/pages/VerifyEmailPage.jsx"
click node_organizer_pages "https://github.com/abdulwahab595/campus-event-hub/blob/main/src/pages/OrganizerPage.jsx"
click node_event_form "https://github.com/abdulwahab595/campus-event-hub/blob/main/src/pages/OrganizerEventFormPage.jsx"
click node_event_card "https://github.com/abdulwahab595/campus-event-hub/blob/main/src/components/EventCard.jsx"
click node_api_client "https://github.com/abdulwahab595/campus-event-hub/blob/main/src/api.js"
click node_client_state "https://github.com/abdulwahab595/campus-event-hub/blob/main/src/store/store.js"
click node_auth_routes "https://github.com/abdulwahab595/campus-event-hub/blob/main/server/routes/authRoutes.js"
click node_event_routes "https://github.com/abdulwahab595/campus-event-hub/blob/main/server/routes/eventRoutes.js"
click node_registration_routes "https://github.com/abdulwahab595/campus-event-hub/blob/main/server/routes/registrationRoutes.js"
click node_auth_controller "https://github.com/abdulwahab595/campus-event-hub/blob/main/server/controllers/authController.js"
click node_event_controller "https://github.com/abdulwahab595/campus-event-hub/blob/main/server/controllers/eventController.js"
click node_registration_controller "https://github.com/abdulwahab595/campus-event-hub/blob/main/server/controllers/registrationController.js"
click node_auth_middleware "https://github.com/abdulwahab595/campus-event-hub/blob/main/server/middleware/auth.js"
click node_event_data "https://github.com/abdulwahab595/campus-event-hub/blob/main/server/utils/eventData.js"
click node_server_entry "https://github.com/abdulwahab595/campus-event-hub/blob/main/server/index.js"
click node_user_store "https://github.com/abdulwahab595/campus-event-hub/blob/main/server/models/User.js"
click node_event_store "https://github.com/abdulwahab595/campus-event-hub/blob/main/server/models/Event.js"
click node_registration_store "https://github.com/abdulwahab595/campus-event-hub/blob/main/server/models/Registration.js"
click node_announcement "https://github.com/abdulwahab595/campus-event-hub/blob/main/server/utils/sendEventAnnouncement.js"
click node_reminders "https://github.com/abdulwahab595/campus-event-hub/blob/main/server/utils/sendEventReminders.js"
click node_email_sender "https://github.com/abdulwahab595/campus-event-hub/blob/main/server/utils/sendEmail.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_event_browse,node_event_details,node_my_regs,node_auth_pages,node_login_page,node_verify_page,node_organizer_pages,node_event_form,node_event_card,node_api_client,node_client_state toneBlue
class node_auth_routes,node_event_routes,node_registration_routes,node_auth_controller,node_event_controller,node_registration_controller,node_auth_middleware,node_event_data,node_server_entry toneAmber
class node_user_store,node_event_store,node_registration_store toneMint
class node_announcement,node_reminders,node_email_sender toneRose
class node_visitor,node_email_service toneIndigo
```

## Components

### Web client

- [Routed app](https://github.com/abdulwahab595/campus-event-hub/blob/main/src/App.jsx): `src/App.jsx`
- [Event discovery](https://github.com/abdulwahab595/campus-event-hub/blob/main/src/pages/EventsPage.jsx): `src/pages/EventsPage.jsx`
- [Event details](https://github.com/abdulwahab595/campus-event-hub/blob/main/src/pages/EventDetailsPage.jsx): `src/pages/EventDetailsPage.jsx`
- [My registrations](https://github.com/abdulwahab595/campus-event-hub/blob/main/src/pages/MyRegistrationsPage.jsx): `src/pages/MyRegistrationsPage.jsx`
- [Account pages](https://github.com/abdulwahab595/campus-event-hub/blob/main/src/pages/RegisterPage.jsx): `src/pages/RegisterPage.jsx`
- [Login page](https://github.com/abdulwahab595/campus-event-hub/blob/main/src/pages/LoginPage.jsx): `src/pages/LoginPage.jsx`
- [Email verification](https://github.com/abdulwahab595/campus-event-hub/blob/main/src/pages/VerifyEmailPage.jsx): `src/pages/VerifyEmailPage.jsx`
- [Organizer tools](https://github.com/abdulwahab595/campus-event-hub/blob/main/src/pages/OrganizerPage.jsx): `src/pages/OrganizerPage.jsx`
- [Event editor](https://github.com/abdulwahab595/campus-event-hub/blob/main/src/pages/OrganizerEventFormPage.jsx): `src/pages/OrganizerEventFormPage.jsx`
- [Event card](https://github.com/abdulwahab595/campus-event-hub/blob/main/src/components/EventCard.jsx): `src/components/EventCard.jsx`
- [API client](https://github.com/abdulwahab595/campus-event-hub/blob/main/src/api.js): `src/api.js`
- [Client state](https://github.com/abdulwahab595/campus-event-hub/blob/main/src/store/store.js): `src/store/store.js`

### API and domain

- [Auth routes](https://github.com/abdulwahab595/campus-event-hub/blob/main/server/routes/authRoutes.js): `server/routes/authRoutes.js`
- [Event routes](https://github.com/abdulwahab595/campus-event-hub/blob/main/server/routes/eventRoutes.js): `server/routes/eventRoutes.js`
- [Registration routes](https://github.com/abdulwahab595/campus-event-hub/blob/main/server/routes/registrationRoutes.js): `server/routes/registrationRoutes.js`
- [Account service](https://github.com/abdulwahab595/campus-event-hub/blob/main/server/controllers/authController.js): `server/controllers/authController.js`
- [Event service](https://github.com/abdulwahab595/campus-event-hub/blob/main/server/controllers/eventController.js): `server/controllers/eventController.js`
- [Registration service](https://github.com/abdulwahab595/campus-event-hub/blob/main/server/controllers/registrationController.js): `server/controllers/registrationController.js`
- [Auth and roles](https://github.com/abdulwahab595/campus-event-hub/blob/main/server/middleware/auth.js): `server/middleware/auth.js`
- [Event shaping](https://github.com/abdulwahab595/campus-event-hub/blob/main/server/utils/eventData.js): `server/utils/eventData.js`
- [API startup](https://github.com/abdulwahab595/campus-event-hub/blob/main/server/index.js): `server/index.js`

### MongoDB data

- [User accounts](https://github.com/abdulwahab595/campus-event-hub/blob/main/server/models/User.js): `server/models/User.js`
- [Events](https://github.com/abdulwahab595/campus-event-hub/blob/main/server/models/Event.js): `server/models/Event.js`
- [Registrations](https://github.com/abdulwahab595/campus-event-hub/blob/main/server/models/Registration.js): `server/models/Registration.js`

### Email messaging

- [Event announcements](https://github.com/abdulwahab595/campus-event-hub/blob/main/server/utils/sendEventAnnouncement.js): `server/utils/sendEventAnnouncement.js`
- [Event reminders](https://github.com/abdulwahab595/campus-event-hub/blob/main/server/utils/sendEventReminders.js): `server/utils/sendEventReminders.js`
- [Email transport](https://github.com/abdulwahab595/campus-event-hub/blob/main/server/utils/sendEmail.js): `server/utils/sendEmail.js`

### Other components

- **Student or organizer**
- **Email provider**

## Connections

- Student or organizer → Routed app: uses (evidence: `src/App.jsx`)
- Routed app → Event discovery: routes to (evidence: `src/App.jsx`)
- Routed app → Event details: routes to (evidence: `src/App.jsx`)
- Routed app → My registrations: routes to (evidence: `src/App.jsx`)
- Routed app → Account pages: routes to (evidence: `src/App.jsx`)
- Routed app → Login page: routes to (evidence: `src/App.jsx`)
- Routed app → Email verification: routes to (evidence: `src/App.jsx`)
- Routed app → Organizer tools: routes to (evidence: `src/App.jsx`)
- Routed app → Event editor: routes to (evidence: `src/App.jsx`)
- Routed app → API client: restores session via (evidence: `src/App.jsx`)
- Routed app → Client state: dispatches to (evidence: `src/App.jsx`)
- Event discovery → API client: requests data via (evidence: `src/pages/EventsPage.jsx`)
- Event details → API client: requests data via (evidence: `src/pages/EventDetailsPage.jsx`)
- My registrations → API client: requests data via (evidence: `src/pages/MyRegistrationsPage.jsx`)
- Login page → API client: requests data via (evidence: `src/pages/LoginPage.jsx`)
- Account pages → API client: requests data via (evidence: `src/pages/RegisterPage.jsx`)
- Email verification → API client: requests data via (evidence: `src/pages/VerifyEmailPage.jsx`)
- Organizer tools → API client: requests data via (evidence: `src/pages/OrganizerPage.jsx`)
- Event editor → API client: requests data via (evidence: `src/pages/OrganizerEventFormPage.jsx`)
- Event discovery → Event card: renders (evidence: `src/pages/EventsPage.jsx`)
- My registrations → Event card: renders (evidence: `src/pages/MyRegistrationsPage.jsx`)
- API client → Client state: dispatches auth errors to (evidence: `src/api.js`)
- API client → Auth routes: sends HTTP requests
- API client → Event routes: sends HTTP requests
- API client → Registration routes: sends HTTP requests
- API startup → Auth routes: mounts (evidence: `server/index.js`)
- API startup → Event routes: mounts (evidence: `server/index.js`)
- API startup → Registration routes: mounts (evidence: `server/index.js`)
- Event routes → Auth and roles: protects routes (evidence: `server/routes/eventRoutes.js`)
- Registration routes → Auth and roles: protects routes (evidence: `server/routes/registrationRoutes.js`)
- Auth routes → Account service: dispatches to (evidence: `server/routes/authRoutes.js`)
- Event routes → Event service: dispatches to (evidence: `server/routes/eventRoutes.js`)
- Event routes → Registration service: dispatches to (evidence: `server/routes/eventRoutes.js`)
- Registration routes → Registration service: dispatches to (evidence: `server/routes/registrationRoutes.js`)
- Auth and roles → User accounts: loads verified user (evidence: `server/middleware/auth.js`)
- Account service → User accounts: reads and writes (evidence: `server/controllers/authController.js`)
- Event service → Events: reads and writes (evidence: `server/controllers/eventController.js`)
- Event service → Registrations: deletes registrations (evidence: `server/controllers/eventController.js`)
- Event service → Event shaping: formats responses (evidence: `server/controllers/eventController.js`)
- Registration service → Events: checks events (evidence: `server/controllers/registrationController.js`)
- Registration service → Registrations: manages registrations (evidence: `server/controllers/registrationController.js`)
- Registration service → Event shaping: formats events (evidence: `server/controllers/registrationController.js`)
- Event service → Event announcements: sends announcement (evidence: `server/controllers/eventController.js`)
- API startup → Event reminders: schedules (evidence: `server/index.js`)
- Event announcements → Email transport: sends through (evidence: `server/utils/sendEventAnnouncement.js`)
- Event reminders → Email transport: sends through (evidence: `server/utils/sendEventReminders.js`)
- Email transport → Email provider: delivers email
