# sanskruti0616/hostelfix architecture

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

- Interactive diagram: https://gitdiagram.com/sanskruti0616/hostelfix
- Repository: https://github.com/sanskruti0616/hostelfix

## Overview

HostelFix is a hostel maintenance complaint-management application. Students sign in, submit complaints, and review their complaint history and details; wardens oversee complaints and assign staff; staff view assigned work and update status; administrators monitor complaints. The React app coordinates role-based views and calls the Express API, which uses MySQL for complaint operations. Source excerpts show the UI/API and server/database boundary, but do not establish every endpoint or frontend-to-backend interaction; unverified links are omitted.

Main entry points: [`src/App.tsx`](https://github.com/sanskruti0616/hostelfix/blob/main/src/App.tsx) (App coordinator), [`src/types/index.ts`](https://github.com/sanskruti0616/hostelfix/blob/main/src/types/index.ts) (Complaint types), [`src/pages/StudentDashboard.tsx`](https://github.com/sanskruti0616/hostelfix/blob/main/src/pages/StudentDashboard.tsx) (Student dashboard), [`src/pages/Login.tsx`](https://github.com/sanskruti0616/hostelfix/blob/main/src/pages/Login.tsx) (Login)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Role-based interface"]
  node_app["App coordinator<br/>[App.tsx]"]
  node_login["Login<br/>[Login.tsx]"]
  node_student_dashboard["Student dashboard"]
  node_warden_dashboard["Warden dashboard"]
  node_staff_dashboard["Staff dashboard<br/>[StaffDashboard.tsx]"]
  node_admin_dashboard["Admin dashboard<br/>[AdminDashboard.tsx]"]
end

subgraph group_complaint["Complaint workflow"]
  node_raise["Raise complaint<br/>[RaiseComplaint.tsx]"]
  node_history["Complaint history"]
  node_details["Complaint details"]
end

subgraph group_service["Backend service"]
  node_complaint_api["Complaint API<br/>[server.js]"]
end

subgraph group_data["Shared data"]
  node_mysql[("MySQL pool<br/>[db.js]")]
  node_users["User records<br/>[users.ts]"]
  node_complaint_types["Complaint types<br/>[index.ts]"]
  node_complaint_data["Complaint data module<br/>[complaints.ts]"]
end

node_student(("Student"))
node_warden(("Warden"))
node_staff(("Maintenance staff"))
node_admin(("Administrator"))

node_student -->|"uses"| node_app
node_warden -->|"uses"| node_app
node_staff -->|"uses"| node_app
node_admin -->|"uses"| node_app
node_app -->|"renders"| node_login
node_app -->|"renders"| node_student_dashboard
node_app -->|"renders"| node_warden_dashboard
node_app -->|"renders"| node_staff_dashboard
node_app -->|"renders"| node_admin_dashboard
node_app -->|"renders"| node_raise
node_app -->|"renders"| node_history
node_app -->|"renders"| node_details
node_login -->|"reads"| node_users
node_student_dashboard -->|"reads"| node_users
node_app -->|"fetches complaints"| node_complaint_api
node_complaint_api -->|"queries"| node_mysql
node_app -->|"uses types"| node_complaint_types
node_raise -->|"uses types"| node_complaint_types
node_history -->|"uses types"| node_complaint_types
node_details -->|"uses types"| node_complaint_types
node_student_dashboard -->|"uses types"| node_complaint_types
node_warden_dashboard -->|"uses types"| node_complaint_types
node_staff_dashboard -->|"uses types"| node_complaint_types
node_admin_dashboard -->|"uses types"| node_complaint_types

click node_app "https://github.com/sanskruti0616/hostelfix/blob/main/src/App.tsx"
click node_login "https://github.com/sanskruti0616/hostelfix/blob/main/src/pages/Login.tsx"
click node_student_dashboard "https://github.com/sanskruti0616/hostelfix/blob/main/src/pages/StudentDashboard.tsx"
click node_warden_dashboard "https://github.com/sanskruti0616/hostelfix/blob/main/src/pages/WardenDashboard.tsx"
click node_staff_dashboard "https://github.com/sanskruti0616/hostelfix/blob/main/src/pages/StaffDashboard.tsx"
click node_admin_dashboard "https://github.com/sanskruti0616/hostelfix/blob/main/src/pages/AdminDashboard.tsx"
click node_raise "https://github.com/sanskruti0616/hostelfix/blob/main/src/pages/RaiseComplaint.tsx"
click node_history "https://github.com/sanskruti0616/hostelfix/blob/main/src/pages/ComplaintHistory.tsx"
click node_details "https://github.com/sanskruti0616/hostelfix/blob/main/src/pages/ComplaintDetails.tsx"
click node_complaint_api "https://github.com/sanskruti0616/hostelfix/blob/main/HostelFix-backend/server.js"
click node_mysql "https://github.com/sanskruti0616/hostelfix/blob/main/HostelFix-backend/db.js"
click node_users "https://github.com/sanskruti0616/hostelfix/blob/main/src/data/users.ts"
click node_complaint_types "https://github.com/sanskruti0616/hostelfix/blob/main/src/types/index.ts"
click node_complaint_data "https://github.com/sanskruti0616/hostelfix/blob/main/src/data/complaints.ts"

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_login,node_student_dashboard,node_warden_dashboard,node_staff_dashboard,node_admin_dashboard toneBlue
class node_raise,node_history,node_details toneAmber
class node_complaint_api toneMint
class node_mysql,node_users,node_complaint_types,node_complaint_data toneRose
class node_student,node_warden,node_staff,node_admin toneIndigo
```

## Components

### Role-based interface

- [App coordinator](https://github.com/sanskruti0616/hostelfix/blob/main/src/App.tsx): `src/App.tsx`
- [Login](https://github.com/sanskruti0616/hostelfix/blob/main/src/pages/Login.tsx): `src/pages/Login.tsx`
- [Student dashboard](https://github.com/sanskruti0616/hostelfix/blob/main/src/pages/StudentDashboard.tsx): `src/pages/StudentDashboard.tsx`
- [Warden dashboard](https://github.com/sanskruti0616/hostelfix/blob/main/src/pages/WardenDashboard.tsx): `src/pages/WardenDashboard.tsx`
- [Staff dashboard](https://github.com/sanskruti0616/hostelfix/blob/main/src/pages/StaffDashboard.tsx): `src/pages/StaffDashboard.tsx`
- [Admin dashboard](https://github.com/sanskruti0616/hostelfix/blob/main/src/pages/AdminDashboard.tsx): `src/pages/AdminDashboard.tsx`

### Complaint workflow

- [Raise complaint](https://github.com/sanskruti0616/hostelfix/blob/main/src/pages/RaiseComplaint.tsx): `src/pages/RaiseComplaint.tsx`
- [Complaint history](https://github.com/sanskruti0616/hostelfix/blob/main/src/pages/ComplaintHistory.tsx): `src/pages/ComplaintHistory.tsx`
- [Complaint details](https://github.com/sanskruti0616/hostelfix/blob/main/src/pages/ComplaintDetails.tsx): `src/pages/ComplaintDetails.tsx`

### Backend service

- [Complaint API](https://github.com/sanskruti0616/hostelfix/blob/main/HostelFix-backend/server.js): `HostelFix-backend/server.js`

### Shared data

- [MySQL pool](https://github.com/sanskruti0616/hostelfix/blob/main/HostelFix-backend/db.js): `HostelFix-backend/db.js`
- [User records](https://github.com/sanskruti0616/hostelfix/blob/main/src/data/users.ts): `src/data/users.ts`
- [Complaint types](https://github.com/sanskruti0616/hostelfix/blob/main/src/types/index.ts): `src/types/index.ts`
- [Complaint data module](https://github.com/sanskruti0616/hostelfix/blob/main/src/data/complaints.ts): `src/data/complaints.ts`

### Other components

- **Student**
- **Warden**
- **Maintenance staff**
- **Administrator**

## Connections

- Student → App coordinator: uses
- Warden → App coordinator: uses
- Maintenance staff → App coordinator: uses
- Administrator → App coordinator: uses
- App coordinator → Login: renders (evidence: `src/App.tsx`)
- App coordinator → Student dashboard: renders (evidence: `src/App.tsx`)
- App coordinator → Warden dashboard: renders (evidence: `src/App.tsx`)
- App coordinator → Staff dashboard: renders (evidence: `src/App.tsx`)
- App coordinator → Admin dashboard: renders (evidence: `src/App.tsx`)
- App coordinator → Raise complaint: renders (evidence: `src/App.tsx`)
- App coordinator → Complaint history: renders (evidence: `src/App.tsx`)
- App coordinator → Complaint details: renders (evidence: `src/App.tsx`)
- Login → User records: reads (evidence: `src/pages/Login.tsx`)
- Student dashboard → User records: reads (evidence: `src/pages/StudentDashboard.tsx`)
- App coordinator → Complaint API: fetches complaints (evidence: `src/App.tsx`)
- Complaint API → MySQL pool: queries (evidence: `HostelFix-backend/server.js`)
- App coordinator → Complaint types: uses types (evidence: `src/App.tsx`)
- Raise complaint → Complaint types: uses types (evidence: `src/pages/RaiseComplaint.tsx`)
- Complaint history → Complaint types: uses types (evidence: `src/pages/ComplaintHistory.tsx`)
- Complaint details → Complaint types: uses types (evidence: `src/pages/ComplaintDetails.tsx`)
- Student dashboard → Complaint types: uses types (evidence: `src/pages/StudentDashboard.tsx`)
- Warden dashboard → Complaint types: uses types (evidence: `src/pages/WardenDashboard.tsx`)
- Staff dashboard → Complaint types: uses types (evidence: `src/pages/StaffDashboard.tsx`)
- Admin dashboard → Complaint types: uses types (evidence: `src/pages/AdminDashboard.tsx`)
