# uw-iuga/iuga-web-app architecture

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

- Interactive diagram: https://gitdiagram.com/uw-iuga/iuga-web-app
- Repository: https://github.com/uw-iuga/iuga-web-app

## Overview

IUGA’s website presents student-association information, events, resources, and election content; signed-in users can RSVP to events. The main flow is a visitor using the React app, with production homepage event data fetched from the Express API and event RSVP submitted to its event controller. Authentication obtains tokens through MSAL and sends them to the backend. The backend connects to MongoDB and exposes event and user routes. Some pages and controllers are present in the tree but were not sampled, so their internal wiring is not inferred.

Main entry points: [`frontend/src/App.jsx`](https://github.com/uw-iuga/iuga-web-app/blob/main/frontend/src/App.jsx) (React app), [`backend/app.js`](https://github.com/uw-iuga/iuga-web-app/blob/main/backend/app.js) (Express app), [`backend/models.js`](https://github.com/uw-iuga/iuga-web-app/blob/main/backend/models.js) (Mongo models), [`frontend/src/context/AuthContext.jsx`](https://github.com/uw-iuga/iuga-web-app/blob/main/frontend/src/context/AuthContext.jsx) (Auth context)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Website experience"]
  node_app["React app<br/>[App.jsx]"]
  node_home["Home page<br/>[Home.jsx]"]
  node_events_page["Events page<br/>[Events.jsx]"]
  node_resources_page["Resources page<br/>[Resources.jsx]"]
  node_about_page["About page<br/>[About.jsx]"]
  node_elections_page["Elections page<br/>[Elections.jsx]"]
  node_faq_page["Election FAQ<br/>[ElectionsFAQ.jsx]"]
  node_event_details["Event details"]
  node_content_data["Association content"]
  node_mock_events["Mock calendar"]
end

subgraph group_identity["Authentication"]
  node_auth_context["Auth context<br/>[AuthContext.jsx]"]
  node_auth_hook["Token exchange<br/>[useAuth.jsx]"]
end

subgraph group_api["Backend API"]
  node_express_app["Express app<br/>[app.js]"]
  node_api_router["API v1 router<br/>[apiv1.js]"]
  node_events_controller["Events controller<br/>[events.js]"]
  node_user_controller["User controller<br/>[user.js]"]
  node_administration["Administration<br/>[administration.js]"]
  node_feedback["Feedback<br/>[feedback.js]"]
end

subgraph group_data["Data and storage"]
  node_models["Mongo models<br/>[models.js]"]
  node_mongodb[("MongoDB")]
end

node_visitor(("Visitor"))
node_identity_provider{{"Microsoft identity"}}

node_visitor -->|"uses"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_events_page
node_app -->|"routes to"| node_resources_page
node_app -->|"routes to"| node_about_page
node_app -->|"routes to"| node_elections_page
node_app -->|"routes to"| node_faq_page
node_app -->|"reads"| node_content_data
node_app -->|"loads in development"| node_mock_events
node_app -->|"fetches upcoming events"| node_express_app
node_event_details -->|"posts RSVP"| node_express_app
node_app -->|"uses"| node_auth_context
node_auth_context -->|"calls"| node_auth_hook
node_auth_hook -->|"acquires token"| node_identity_provider
node_auth_hook -->|"posts login token"| node_express_app
node_auth_context -->|"posts logout"| node_express_app
node_express_app -->|"mounts"| node_api_router
node_api_router -->|"dispatches events"| node_events_controller
node_api_router -->|"dispatches users"| node_user_controller
node_express_app -->|"connects"| node_models
node_events_controller -->|"queries and writes"| node_models
node_user_controller -->|"uses"| node_models
node_models -->|"reads and writes"| node_mongodb

click node_app "https://github.com/uw-iuga/iuga-web-app/blob/main/frontend/src/App.jsx"
click node_home "https://github.com/uw-iuga/iuga-web-app/blob/main/frontend/src/pages/Home.jsx"
click node_events_page "https://github.com/uw-iuga/iuga-web-app/blob/main/frontend/src/pages/Events.jsx"
click node_resources_page "https://github.com/uw-iuga/iuga-web-app/blob/main/frontend/src/pages/Resources.jsx"
click node_about_page "https://github.com/uw-iuga/iuga-web-app/blob/main/frontend/src/pages/About.jsx"
click node_elections_page "https://github.com/uw-iuga/iuga-web-app/blob/main/frontend/src/pages/Elections.jsx"
click node_faq_page "https://github.com/uw-iuga/iuga-web-app/blob/main/frontend/src/pages/ElectionsFAQ.jsx"
click node_event_details "https://github.com/uw-iuga/iuga-web-app/blob/main/frontend/src/components/EventDetailsCard.jsx"
click node_content_data "https://github.com/uw-iuga/iuga-web-app/tree/main/frontend/src/assets/data"
click node_mock_events "https://github.com/uw-iuga/iuga-web-app/blob/main/frontend/src/assets/mock-data/MockCalendarData.js"
click node_auth_context "https://github.com/uw-iuga/iuga-web-app/blob/main/frontend/src/context/AuthContext.jsx"
click node_auth_hook "https://github.com/uw-iuga/iuga-web-app/blob/main/frontend/src/hooks/useAuth.jsx"
click node_express_app "https://github.com/uw-iuga/iuga-web-app/blob/main/backend/app.js"
click node_api_router "https://github.com/uw-iuga/iuga-web-app/blob/main/backend/routes/api/v1/apiv1.js"
click node_events_controller "https://github.com/uw-iuga/iuga-web-app/blob/main/backend/routes/api/v1/controllers/events.js"
click node_user_controller "https://github.com/uw-iuga/iuga-web-app/blob/main/backend/routes/api/v1/controllers/user.js"
click node_administration "https://github.com/uw-iuga/iuga-web-app/blob/main/backend/routes/api/v1/controllers/administration.js"
click node_feedback "https://github.com/uw-iuga/iuga-web-app/blob/main/backend/routes/api/v1/controllers/feedback.js"
click node_models "https://github.com/uw-iuga/iuga-web-app/blob/main/backend/models.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_home,node_events_page,node_resources_page,node_about_page,node_elections_page,node_faq_page,node_event_details,node_content_data,node_mock_events toneBlue
class node_auth_context,node_auth_hook toneAmber
class node_express_app,node_api_router,node_events_controller,node_user_controller,node_administration,node_feedback toneMint
class node_models,node_mongodb toneRose
class node_visitor,node_identity_provider toneIndigo
```

## Components

### Website experience

- [React app](https://github.com/uw-iuga/iuga-web-app/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Home page](https://github.com/uw-iuga/iuga-web-app/blob/main/frontend/src/pages/Home.jsx): `frontend/src/pages/Home.jsx`
- [Events page](https://github.com/uw-iuga/iuga-web-app/blob/main/frontend/src/pages/Events.jsx): `frontend/src/pages/Events.jsx`
- [Resources page](https://github.com/uw-iuga/iuga-web-app/blob/main/frontend/src/pages/Resources.jsx): `frontend/src/pages/Resources.jsx`
- [About page](https://github.com/uw-iuga/iuga-web-app/blob/main/frontend/src/pages/About.jsx): `frontend/src/pages/About.jsx`
- [Elections page](https://github.com/uw-iuga/iuga-web-app/blob/main/frontend/src/pages/Elections.jsx): `frontend/src/pages/Elections.jsx`
- [Election FAQ](https://github.com/uw-iuga/iuga-web-app/blob/main/frontend/src/pages/ElectionsFAQ.jsx): `frontend/src/pages/ElectionsFAQ.jsx`
- [Event details](https://github.com/uw-iuga/iuga-web-app/blob/main/frontend/src/components/EventDetailsCard.jsx): `frontend/src/components/EventDetailsCard.jsx`
- [Association content](https://github.com/uw-iuga/iuga-web-app/tree/main/frontend/src/assets/data): `frontend/src/assets/data`
- [Mock calendar](https://github.com/uw-iuga/iuga-web-app/blob/main/frontend/src/assets/mock-data/MockCalendarData.js): `frontend/src/assets/mock-data/MockCalendarData.js`

### Authentication

- [Auth context](https://github.com/uw-iuga/iuga-web-app/blob/main/frontend/src/context/AuthContext.jsx): `frontend/src/context/AuthContext.jsx`
- [Token exchange](https://github.com/uw-iuga/iuga-web-app/blob/main/frontend/src/hooks/useAuth.jsx): `frontend/src/hooks/useAuth.jsx`

### Backend API

- [Express app](https://github.com/uw-iuga/iuga-web-app/blob/main/backend/app.js): `backend/app.js`
- [API v1 router](https://github.com/uw-iuga/iuga-web-app/blob/main/backend/routes/api/v1/apiv1.js): `backend/routes/api/v1/apiv1.js`
- [Events controller](https://github.com/uw-iuga/iuga-web-app/blob/main/backend/routes/api/v1/controllers/events.js): `backend/routes/api/v1/controllers/events.js`
- [User controller](https://github.com/uw-iuga/iuga-web-app/blob/main/backend/routes/api/v1/controllers/user.js): `backend/routes/api/v1/controllers/user.js`
- [Administration](https://github.com/uw-iuga/iuga-web-app/blob/main/backend/routes/api/v1/controllers/administration.js): `backend/routes/api/v1/controllers/administration.js`
- [Feedback](https://github.com/uw-iuga/iuga-web-app/blob/main/backend/routes/api/v1/controllers/feedback.js): `backend/routes/api/v1/controllers/feedback.js`

### Data and storage

- [Mongo models](https://github.com/uw-iuga/iuga-web-app/blob/main/backend/models.js): `backend/models.js`
- **MongoDB**

### Other components

- **Visitor**
- **Microsoft identity**

## Connections

- Visitor → React app: uses
- React app → Home page: routes to
- React app → Events page: routes to
- React app → Resources page: routes to
- React app → About page: routes to
- React app → Elections page: routes to
- React app → Election FAQ: routes to
- React app → Association content: reads
- React app → Mock calendar: loads in development
- React app → Express app: fetches upcoming events
- Event details → Express app: posts RSVP
- React app → Auth context: uses
- Auth context → Token exchange: calls
- Token exchange → Microsoft identity: acquires token
- Token exchange → Express app: posts login token
- Auth context → Express app: posts logout
- Express app → API v1 router: mounts
- API v1 router → Events controller: dispatches events
- API v1 router → User controller: dispatches users
- Express app → Mongo models: connects
- Events controller → Mongo models: queries and writes
- User controller → Mongo models: uses
- Mongo models → MongoDB: reads and writes
