# anshurathee05/bml-university-clubs architecture

> Architecture diagram of the GitHub repository anshurathee05/bml-university-clubs, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/anshurathee05/bml-university-clubs
- Repository: https://github.com/anshurathee05/bml-university-clubs

## Overview

BML University Clubs Management System supports public club and event discovery, student registration/login and profiles, plus administrative management of clubs, events and students. Requests enter through the Express server, which dispatches page/auth/admin routes and exposes club/event APIs; browser-side code builds club and event views. MongoDB models hold the domain records, and sessions are configured with Mongo-backed storage. The sampled browser excerpt shows event data loading from a public JSON file; its club-loading implementation and template-to-script wiring are not shown, so those links are omitted.

Main entry points: [`server.js`](https://github.com/anshurathee05/bml-university-clubs/blob/main/server.js) (Express server), [`routes/admin.js`](https://github.com/anshurathee05/bml-university-clubs/blob/main/routes/admin.js) (Admin routes), [`routes/index.js`](https://github.com/anshurathee05/bml-university-clubs/blob/main/routes/index.js) (Public pages), [`public/js/app.js`](https://github.com/anshurathee05/bml-university-clubs/blob/main/public/js/app.js) (Event browser)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Web entry"]
  node_server["Express server<br/>[server.js]"]
  node_pages["Public pages<br/>[index.js]"]
end

subgraph group_experience["Browsing UI"]
  node_browser["Club interface<br/>[app.js]"]
  node_eventui["Event browser<br/>[app.js]"]
  node_clubdata["Club data file<br/>[clubs-data.json]"]
  node_pageviews["Page templates"]
end

subgraph group_identity["Student identity"]
  node_authroutes["Account routes<br/>[auth.js]"]
  node_authmw["Auth middleware<br/>[auth.js]"]
end

subgraph group_management["Administration and data"]
  node_students[("Student records<br/>[Student.js]")]
  node_admin["Admin routes<br/>[admin.js]"]
  node_clubs[("Club records<br/>[Club.js]")]
  node_events[("Event records<br/>[Event.js]")]
end

node_visitor(("Visitor / student"))
node_mongodb[("MongoDB")]

node_visitor -->|"sends requests"| node_server
node_server -->|"mounts routes"| node_pages
node_server -->|"mounts routes"| node_authroutes
node_server -->|"mounts routes"| node_admin
node_pages -->|"renders pages"| node_pageviews
node_authroutes -->|"reads and saves"| node_students
node_admin -->|"queries and deletes"| node_clubs
node_admin -->|"queries and deletes"| node_events
node_admin -->|"queries"| node_students
node_server -->|"serves club API"| node_clubs
node_server -->|"serves event API"| node_events
node_eventui -->|"loads event data"| node_clubdata
node_browser -->|"initializes"| node_eventui
node_server -->|"connects and stores sessions"| node_mongodb

click node_server "https://github.com/anshurathee05/bml-university-clubs/blob/main/server.js"
click node_pages "https://github.com/anshurathee05/bml-university-clubs/blob/main/routes/index.js"
click node_browser "https://github.com/anshurathee05/bml-university-clubs/blob/main/public/js/app.js"
click node_eventui "https://github.com/anshurathee05/bml-university-clubs/blob/main/public/js/app.js"
click node_clubdata "https://github.com/anshurathee05/bml-university-clubs/blob/main/public/data/clubs-data.json"
click node_pageviews "https://github.com/anshurathee05/bml-university-clubs/tree/main/views"
click node_authroutes "https://github.com/anshurathee05/bml-university-clubs/blob/main/routes/auth.js"
click node_authmw "https://github.com/anshurathee05/bml-university-clubs/blob/main/middleware/auth.js"
click node_students "https://github.com/anshurathee05/bml-university-clubs/blob/main/models/Student.js"
click node_admin "https://github.com/anshurathee05/bml-university-clubs/blob/main/routes/admin.js"
click node_clubs "https://github.com/anshurathee05/bml-university-clubs/blob/main/models/Club.js"
click node_events "https://github.com/anshurathee05/bml-university-clubs/blob/main/models/Event.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_server,node_pages toneBlue
class node_browser,node_eventui,node_clubdata,node_pageviews,node_mongodb toneAmber
class node_authroutes,node_authmw toneMint
class node_students,node_admin,node_clubs,node_events toneRose
class node_visitor toneIndigo
```

## Components

### Web entry

- [Express server](https://github.com/anshurathee05/bml-university-clubs/blob/main/server.js): `server.js`
- [Public pages](https://github.com/anshurathee05/bml-university-clubs/blob/main/routes/index.js): `routes/index.js`

### Browsing UI

- [Club interface](https://github.com/anshurathee05/bml-university-clubs/blob/main/public/js/app.js): `public/js/app.js`
- [Event browser](https://github.com/anshurathee05/bml-university-clubs/blob/main/public/js/app.js): `public/js/app.js`
- [Club data file](https://github.com/anshurathee05/bml-university-clubs/blob/main/public/data/clubs-data.json): `public/data/clubs-data.json`
- [Page templates](https://github.com/anshurathee05/bml-university-clubs/tree/main/views): `views`

### Student identity

- [Account routes](https://github.com/anshurathee05/bml-university-clubs/blob/main/routes/auth.js): `routes/auth.js`
- [Auth middleware](https://github.com/anshurathee05/bml-university-clubs/blob/main/middleware/auth.js): `middleware/auth.js`

### Administration and data

- [Student records](https://github.com/anshurathee05/bml-university-clubs/blob/main/models/Student.js): `models/Student.js`
- [Admin routes](https://github.com/anshurathee05/bml-university-clubs/blob/main/routes/admin.js): `routes/admin.js`
- [Club records](https://github.com/anshurathee05/bml-university-clubs/blob/main/models/Club.js): `models/Club.js`
- [Event records](https://github.com/anshurathee05/bml-university-clubs/blob/main/models/Event.js): `models/Event.js`

### Other components

- **Visitor / student**
- **MongoDB**

## Connections

- Visitor / student → Express server: sends requests (evidence: `server.js`)
- Express server → Public pages: mounts routes (evidence: `server.js`)
- Express server → Account routes: mounts routes (evidence: `server.js`)
- Express server → Admin routes: mounts routes (evidence: `server.js`)
- Public pages → Page templates: renders pages (evidence: `routes/index.js`)
- Account routes → Student records: reads and saves (evidence: `routes/auth.js`)
- Admin routes → Club records: queries and deletes (evidence: `routes/admin.js`)
- Admin routes → Event records: queries and deletes (evidence: `routes/admin.js`)
- Admin routes → Student records: queries (evidence: `routes/admin.js`)
- Express server → Club records: serves club API (evidence: `server.js`)
- Express server → Event records: serves event API (evidence: `server.js`)
- Event browser → Club data file: loads event data (evidence: `public/js/app.js`)
- Club interface → Event browser: initializes (evidence: `public/js/app.js`)
- Express server → MongoDB: connects and stores sessions (evidence: `server.js`)
