# ganesh87692006-ctrl/clg-event-management architecture

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

- Interactive diagram: https://gitdiagram.com/ganesh87692006-ctrl/clg-event-management
- Repository: https://github.com/ganesh87692006-ctrl/clg-event-management

## Overview

This is a college event management app: students and admins use browser pages to authenticate and manage event participation through an Express API backed by MongoDB. The main student workflow is to browse events, register or cancel, and review registrations; admins create and delete events and inspect attendees. The graph preserves authentication, event management, registration, and persistence responsibilities. Source excerpts establish backend routing and model calls; frontend page-to-script links and the MongoDB role are documented in the README.

Main entry points: [`backend/routes/registrations.js`](https://github.com/ganesh87692006-ctrl/clg-event-management/blob/main/backend/routes/registrations.js) (Registrations), [`backend/server.js`](https://github.com/ganesh87692006-ctrl/clg-event-management/blob/main/backend/server.js) (Express server), [`backend/routes/events.js`](https://github.com/ganesh87692006-ctrl/clg-event-management/blob/main/backend/routes/events.js) (Event management), [`frontend/js/dashboard.js`](https://github.com/ganesh87692006-ctrl/clg-event-management/blob/main/frontend/js/dashboard.js) (Student interactions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Browser app"]
  node_login_page["Login and register<br/>[index.html]"]
  node_student_page["Student dashboard<br/>[dashboard.html]"]
  node_admin_page["Admin dashboard<br/>[admin.html]"]
  node_auth_ui["Auth interactions<br/>[auth.js]"]
  node_student_ui["Student interactions<br/>[dashboard.js]"]
  node_admin_ui["Admin interactions<br/>[admin.js]"]
  node_api_client["HTTP client<br/>[api.js]"]
end

subgraph group_api["API and access"]
  node_server["Express server<br/>[server.js]"]
  node_auth_routes["Authentication<br/>[auth.js]"]
  node_auth_guard["JWT access control<br/>[authMiddleware.js]"]
end

subgraph group_events["Event workflows"]
  node_event_routes["Event management<br/>[events.js]"]
  node_registration_routes["Registrations<br/>[registrations.js]"]
end

subgraph group_data["Data models"]
  node_user_model["User records<br/>[User.js]"]
  node_event_model["Event records<br/>[Event.js]"]
  node_registration_model["Registration records<br/>[Registration.js]"]
  node_mongodb[("MongoDB")]
end

node_student(("Student"))
node_admin(("Admin"))

node_student -->|"opens"| node_login_page
node_admin -->|"opens"| node_login_page
node_student -->|"uses"| node_student_page
node_admin -->|"uses"| node_admin_page
node_login_page -->|"loads"| node_auth_ui
node_student_page -->|"loads"| node_student_ui
node_admin_page -->|"loads"| node_admin_ui
node_auth_ui -->|"requests"| node_api_client
node_student_ui -->|"requests"| node_api_client
node_admin_ui -->|"requests"| node_api_client
node_api_client -->|"sends HTTP"| node_server
node_server -->|"mounts"| node_auth_routes
node_server -->|"mounts"| node_event_routes
node_server -->|"mounts"| node_registration_routes
node_auth_routes -->|"reads and writes"| node_user_model
node_event_routes -->|"reads and writes"| node_event_model
node_registration_routes -->|"reads and writes"| node_registration_model
node_registration_routes -->|"updates seats"| node_event_model
node_event_routes -->|"checks access"| node_auth_guard
node_registration_routes -->|"checks access"| node_auth_guard
node_server -->|"connects"| node_mongodb
node_student_ui -->|"fetches events"| node_event_routes
node_student_ui -->|"registers and cancels"| node_registration_routes
node_admin_ui -->|"manages events"| node_event_routes
node_admin_ui -->|"views attendees"| node_registration_routes

click node_login_page "https://github.com/ganesh87692006-ctrl/clg-event-management/blob/main/frontend/index.html"
click node_student_page "https://github.com/ganesh87692006-ctrl/clg-event-management/blob/main/frontend/dashboard.html"
click node_admin_page "https://github.com/ganesh87692006-ctrl/clg-event-management/blob/main/frontend/admin.html"
click node_auth_ui "https://github.com/ganesh87692006-ctrl/clg-event-management/blob/main/frontend/js/auth.js"
click node_student_ui "https://github.com/ganesh87692006-ctrl/clg-event-management/blob/main/frontend/js/dashboard.js"
click node_admin_ui "https://github.com/ganesh87692006-ctrl/clg-event-management/blob/main/frontend/js/admin.js"
click node_api_client "https://github.com/ganesh87692006-ctrl/clg-event-management/blob/main/frontend/js/api.js"
click node_server "https://github.com/ganesh87692006-ctrl/clg-event-management/blob/main/backend/server.js"
click node_auth_routes "https://github.com/ganesh87692006-ctrl/clg-event-management/blob/main/backend/routes/auth.js"
click node_auth_guard "https://github.com/ganesh87692006-ctrl/clg-event-management/blob/main/backend/middleware/authMiddleware.js"
click node_event_routes "https://github.com/ganesh87692006-ctrl/clg-event-management/blob/main/backend/routes/events.js"
click node_registration_routes "https://github.com/ganesh87692006-ctrl/clg-event-management/blob/main/backend/routes/registrations.js"
click node_user_model "https://github.com/ganesh87692006-ctrl/clg-event-management/blob/main/backend/models/User.js"
click node_event_model "https://github.com/ganesh87692006-ctrl/clg-event-management/blob/main/backend/models/Event.js"
click node_registration_model "https://github.com/ganesh87692006-ctrl/clg-event-management/blob/main/backend/models/Registration.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_login_page,node_student_page,node_admin_page,node_auth_ui,node_student_ui,node_admin_ui,node_api_client toneBlue
class node_server,node_auth_routes,node_auth_guard toneAmber
class node_event_routes,node_registration_routes toneMint
class node_user_model,node_event_model,node_registration_model,node_mongodb toneRose
class node_student,node_admin toneIndigo
```

## Components

### Browser app

- [Login and register](https://github.com/ganesh87692006-ctrl/clg-event-management/blob/main/frontend/index.html): `frontend/index.html`
- [Student dashboard](https://github.com/ganesh87692006-ctrl/clg-event-management/blob/main/frontend/dashboard.html): `frontend/dashboard.html`
- [Admin dashboard](https://github.com/ganesh87692006-ctrl/clg-event-management/blob/main/frontend/admin.html): `frontend/admin.html`
- [Auth interactions](https://github.com/ganesh87692006-ctrl/clg-event-management/blob/main/frontend/js/auth.js): `frontend/js/auth.js`
- [Student interactions](https://github.com/ganesh87692006-ctrl/clg-event-management/blob/main/frontend/js/dashboard.js): `frontend/js/dashboard.js`
- [Admin interactions](https://github.com/ganesh87692006-ctrl/clg-event-management/blob/main/frontend/js/admin.js): `frontend/js/admin.js`
- [HTTP client](https://github.com/ganesh87692006-ctrl/clg-event-management/blob/main/frontend/js/api.js): `frontend/js/api.js`

### API and access

- [Express server](https://github.com/ganesh87692006-ctrl/clg-event-management/blob/main/backend/server.js): `backend/server.js`
- [Authentication](https://github.com/ganesh87692006-ctrl/clg-event-management/blob/main/backend/routes/auth.js): `backend/routes/auth.js`
- [JWT access control](https://github.com/ganesh87692006-ctrl/clg-event-management/blob/main/backend/middleware/authMiddleware.js): `backend/middleware/authMiddleware.js`

### Event workflows

- [Event management](https://github.com/ganesh87692006-ctrl/clg-event-management/blob/main/backend/routes/events.js): `backend/routes/events.js`
- [Registrations](https://github.com/ganesh87692006-ctrl/clg-event-management/blob/main/backend/routes/registrations.js): `backend/routes/registrations.js`

### Data models

- [User records](https://github.com/ganesh87692006-ctrl/clg-event-management/blob/main/backend/models/User.js): `backend/models/User.js`
- [Event records](https://github.com/ganesh87692006-ctrl/clg-event-management/blob/main/backend/models/Event.js): `backend/models/Event.js`
- [Registration records](https://github.com/ganesh87692006-ctrl/clg-event-management/blob/main/backend/models/Registration.js): `backend/models/Registration.js`
- **MongoDB**

### Other components

- **Student**
- **Admin**

## Connections

- Student → Login and register: opens (evidence: `README.md`)
- Admin → Login and register: opens (evidence: `README.md`)
- Student → Student dashboard: uses (evidence: `README.md`)
- Admin → Admin dashboard: uses (evidence: `README.md`)
- Login and register → Auth interactions: loads (evidence: `README.md`)
- Student dashboard → Student interactions: loads (evidence: `README.md`)
- Admin dashboard → Admin interactions: loads (evidence: `README.md`)
- Auth interactions → HTTP client: requests (evidence: `frontend/js/auth.js`)
- Student interactions → HTTP client: requests (evidence: `frontend/js/dashboard.js`)
- Admin interactions → HTTP client: requests (evidence: `frontend/js/admin.js`)
- HTTP client → Express server: sends HTTP (evidence: `README.md`)
- Express server → Authentication: mounts (evidence: `backend/server.js`)
- Express server → Event management: mounts (evidence: `backend/server.js`)
- Express server → Registrations: mounts (evidence: `backend/server.js`)
- Authentication → User records: reads and writes (evidence: `backend/routes/auth.js`)
- Event management → Event records: reads and writes (evidence: `backend/routes/events.js`)
- Registrations → Registration records: reads and writes (evidence: `backend/routes/registrations.js`)
- Registrations → Event records: updates seats (evidence: `backend/routes/registrations.js`)
- Event management → JWT access control: checks access (evidence: `backend/routes/events.js`)
- Registrations → JWT access control: checks access (evidence: `backend/routes/registrations.js`)
- Express server → MongoDB: connects (evidence: `backend/server.js`)
- Student interactions → Event management: fetches events (evidence: `frontend/js/dashboard.js`)
- Student interactions → Registrations: registers and cancels (evidence: `frontend/js/dashboard.js`)
- Admin interactions → Event management: manages events (evidence: `frontend/js/admin.js`)
- Admin interactions → Registrations: views attendees (evidence: `frontend/js/admin.js`)
