# sittaroad04/dormfix architecture

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

- Interactive diagram: https://gitdiagram.com/sittaroad04/dormfix
- Repository: https://github.com/sittaroad04/dormfix

## Overview

DormFix is a dormitory maintenance-request web app for residents and administrators. The main workflow is a resident registering or signing in, submitting a repair request, and tracking its status and timeline; administrators review all requests and update status with notes. The React pages call the Express API, whose handlers use a shared SQL connection pool for user, request, and history operations. The graph includes README-documented capabilities whose individual page implementations were not sampled; relationships among those unsampled pages and API routes are therefore not asserted.

Main entry points: [`frontend/src/App.jsx`](https://github.com/sittaroad04/dormfix/blob/main/frontend/src/App.jsx) (Route app), [`backend/app.js`](https://github.com/sittaroad04/dormfix/blob/main/backend/app.js) (API handlers), [`frontend/src/components/StatusBadge.jsx`](https://github.com/sittaroad04/dormfix/blob/main/frontend/src/components/StatusBadge.jsx) (Status display), [`frontend/src/pages/AdminRequests.jsx`](https://github.com/sittaroad04/dormfix/blob/main/frontend/src/pages/AdminRequests.jsx) (All requests)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Resident app"]
  node_app["Route app<br/>[App.jsx]"]
  node_layout["Session layout<br/>[Layout.jsx]"]
  node_login["Sign in<br/>[Login.jsx]"]
  node_register["Registration<br/>[Register.jsx]"]
  node_dashboard["Resident dashboard<br/>[Dashboard.jsx]"]
  node_maintenance["New request<br/>[Maintenance.jsx]"]
  node_requests["My requests<br/>[Requests.jsx]"]
  node_requestdetail["Request detail<br/>[RequestDetail.jsx]"]
  node_history["Repair timeline<br/>[History.jsx]"]
  node_statusbadge["Status display<br/>[StatusBadge.jsx]"]
end

subgraph group_admin["Admin operations"]
  node_admindashboard["Admin dashboard<br/>[Dashboard.jsx]"]
  node_adminrequests["All requests<br/>[AdminRequests.jsx]"]
  node_admindetail["Update request"]
end

subgraph group_service["API service"]
  node_server["HTTP server<br/>[server.js]"]
  node_api["API handlers<br/>[app.js]"]
end

subgraph group_data["Persistence"]
  node_sqlpool["SQL connection pool<br/>[db.js]"]
  node_azuresql[("Azure SQL")]
end

node_resident(("Resident"))
node_admin(("Administrator"))

node_app -->|"wraps routes"| node_layout
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_register
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_maintenance
node_app -->|"routes to"| node_requests
node_app -->|"routes to"| node_requestdetail
node_app -->|"routes to"| node_history
node_app -->|"routes to"| node_adminrequests
node_app -->|"routes to"| node_admindetail
node_layout -->|"renders outlet"| node_dashboard
node_resident -.->|"signs in"| node_login
node_resident -.->|"registers"| node_register
node_resident -.->|"submits request"| node_maintenance
node_resident -.->|"reviews requests"| node_requests
node_requests -->|"renders status"| node_statusbadge
node_requestdetail -->|"renders status"| node_statusbadge
node_history -->|"renders status"| node_statusbadge
node_admin -.->|"reviews work"| node_adminrequests
node_admin -.->|"updates work"| node_admindetail
node_adminrequests -->|"renders status"| node_statusbadge
node_admindetail -->|"renders status"| node_statusbadge
node_server -->|"serves"| node_api
node_api -->|"gets pool"| node_sqlpool
node_sqlpool -->|"connects"| node_azuresql
node_adminrequests -.->|"fetches requests"| node_api
node_admindetail -.->|"updates status"| node_api
node_requestdetail -->|"fetches request history"| node_api
node_history -->|"fetches timelines"| node_api

click node_app "https://github.com/sittaroad04/dormfix/blob/main/frontend/src/App.jsx"
click node_layout "https://github.com/sittaroad04/dormfix/blob/main/frontend/src/components/Layout.jsx"
click node_login "https://github.com/sittaroad04/dormfix/blob/main/frontend/src/pages/Login.jsx"
click node_register "https://github.com/sittaroad04/dormfix/blob/main/frontend/src/pages/Register.jsx"
click node_dashboard "https://github.com/sittaroad04/dormfix/blob/main/frontend/src/pages/Dashboard.jsx"
click node_maintenance "https://github.com/sittaroad04/dormfix/blob/main/frontend/src/pages/Maintenance.jsx"
click node_requests "https://github.com/sittaroad04/dormfix/blob/main/frontend/src/pages/Requests.jsx"
click node_requestdetail "https://github.com/sittaroad04/dormfix/blob/main/frontend/src/pages/RequestDetail.jsx"
click node_history "https://github.com/sittaroad04/dormfix/blob/main/frontend/src/pages/History.jsx"
click node_statusbadge "https://github.com/sittaroad04/dormfix/blob/main/frontend/src/components/StatusBadge.jsx"
click node_admindashboard "https://github.com/sittaroad04/dormfix/blob/main/frontend/src/pages/Dashboard.jsx"
click node_adminrequests "https://github.com/sittaroad04/dormfix/blob/main/frontend/src/pages/AdminRequests.jsx"
click node_admindetail "https://github.com/sittaroad04/dormfix/blob/main/frontend/src/pages/AdminRequestDetail.jsx"
click node_server "https://github.com/sittaroad04/dormfix/blob/main/backend/server.js"
click node_api "https://github.com/sittaroad04/dormfix/blob/main/backend/app.js"
click node_sqlpool "https://github.com/sittaroad04/dormfix/blob/main/backend/db.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_layout,node_login,node_register,node_dashboard,node_maintenance,node_requests,node_requestdetail,node_history,node_statusbadge toneBlue
class node_admindashboard,node_adminrequests,node_admindetail toneAmber
class node_server,node_api toneMint
class node_sqlpool,node_azuresql toneRose
class node_resident,node_admin toneIndigo
```

## Components

### Resident app

- [Route app](https://github.com/sittaroad04/dormfix/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Session layout](https://github.com/sittaroad04/dormfix/blob/main/frontend/src/components/Layout.jsx): `frontend/src/components/Layout.jsx`
- [Sign in](https://github.com/sittaroad04/dormfix/blob/main/frontend/src/pages/Login.jsx): `frontend/src/pages/Login.jsx`
- [Registration](https://github.com/sittaroad04/dormfix/blob/main/frontend/src/pages/Register.jsx): `frontend/src/pages/Register.jsx`
- [Resident dashboard](https://github.com/sittaroad04/dormfix/blob/main/frontend/src/pages/Dashboard.jsx): `frontend/src/pages/Dashboard.jsx`
- [New request](https://github.com/sittaroad04/dormfix/blob/main/frontend/src/pages/Maintenance.jsx): `frontend/src/pages/Maintenance.jsx`
- [My requests](https://github.com/sittaroad04/dormfix/blob/main/frontend/src/pages/Requests.jsx): `frontend/src/pages/Requests.jsx`
- [Request detail](https://github.com/sittaroad04/dormfix/blob/main/frontend/src/pages/RequestDetail.jsx): `frontend/src/pages/RequestDetail.jsx`
- [Repair timeline](https://github.com/sittaroad04/dormfix/blob/main/frontend/src/pages/History.jsx): `frontend/src/pages/History.jsx`
- [Status display](https://github.com/sittaroad04/dormfix/blob/main/frontend/src/components/StatusBadge.jsx): `frontend/src/components/StatusBadge.jsx`

### Admin operations

- [Admin dashboard](https://github.com/sittaroad04/dormfix/blob/main/frontend/src/pages/Dashboard.jsx): `frontend/src/pages/Dashboard.jsx`
- [All requests](https://github.com/sittaroad04/dormfix/blob/main/frontend/src/pages/AdminRequests.jsx): `frontend/src/pages/AdminRequests.jsx`
- [Update request](https://github.com/sittaroad04/dormfix/blob/main/frontend/src/pages/AdminRequestDetail.jsx): `frontend/src/pages/AdminRequestDetail.jsx`

### API service

- [HTTP server](https://github.com/sittaroad04/dormfix/blob/main/backend/server.js): `backend/server.js`
- [API handlers](https://github.com/sittaroad04/dormfix/blob/main/backend/app.js): `backend/app.js`

### Persistence

- [SQL connection pool](https://github.com/sittaroad04/dormfix/blob/main/backend/db.js): `backend/db.js`
- **Azure SQL**

### Other components

- **Resident**
- **Administrator**

## Connections

- Route app → Session layout: wraps routes (evidence: `frontend/src/App.jsx`)
- Route app → Sign in: routes to (evidence: `frontend/src/App.jsx`)
- Route app → Registration: routes to (evidence: `frontend/src/App.jsx`)
- Route app → Resident dashboard: routes to (evidence: `frontend/src/App.jsx`)
- Route app → New request: routes to (evidence: `frontend/src/App.jsx`)
- Route app → My requests: routes to (evidence: `frontend/src/App.jsx`)
- Route app → Request detail: routes to (evidence: `frontend/src/App.jsx`)
- Route app → Repair timeline: routes to (evidence: `frontend/src/App.jsx`)
- Route app → All requests: routes to (evidence: `frontend/src/App.jsx`)
- Route app → Update request: routes to (evidence: `frontend/src/App.jsx`)
- Session layout → Resident dashboard: renders outlet (evidence: `frontend/src/components/Layout.jsx`)
- Resident → Sign in: signs in
- Resident → Registration: registers
- Resident → New request: submits request
- Resident → My requests: reviews requests
- My requests → Status display: renders status (evidence: `frontend/src/pages/Requests.jsx`)
- Request detail → Status display: renders status (evidence: `frontend/src/pages/RequestDetail.jsx`)
- Repair timeline → Status display: renders status (evidence: `frontend/src/pages/History.jsx`)
- Administrator → All requests: reviews work
- Administrator → Update request: updates work
- All requests → Status display: renders status (evidence: `frontend/src/pages/AdminRequests.jsx`)
- Update request → Status display: renders status (evidence: `frontend/src/pages/AdminRequestDetail.jsx`)
- HTTP server → API handlers: serves (evidence: `backend/server.js`)
- API handlers → SQL connection pool: gets pool (evidence: `backend/app.js`)
- SQL connection pool → Azure SQL: connects (evidence: `backend/db.js`)
- All requests → API handlers: fetches requests
- Update request → API handlers: updates status
- Request detail → API handlers: fetches request history (evidence: `frontend/src/pages/RequestDetail.jsx`)
- Repair timeline → API handlers: fetches timelines (evidence: `frontend/src/pages/History.jsx`)
