# mt1504-coffee/aseoucp2 architecture

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

- Interactive diagram: https://gitdiagram.com/mt1504-coffee/aseoucp2
- Repository: https://github.com/mt1504-coffee/aseoucp2

## Overview

This is the Next.js frontend for an institutional cleaning and maintenance management platform. Staff authenticate, record cleaning work or incidents (including media evidence), and administrators review activity history, manage incident status/assignment, and manage users. The frontend centralizes JWT-bearing requests in an API client and persists session details in browser storage; the documented Spring Boot service is external. The graph follows documented capabilities and indexed imports, but several component internals and the backend implementation were not sampled, so uncertain internal links are omitted.

Main entry points: [`lib/api-client.ts`](https://github.com/mt1504-coffee/aseoucp2/blob/main/lib/api-client.ts) (API client), [`components/auth/auth-provider.tsx`](https://github.com/mt1504-coffee/aseoucp2/blob/main/components/auth/auth-provider.tsx) (Auth provider), [`components/staff/cleaning-form.tsx`](https://github.com/mt1504-coffee/aseoucp2/blob/main/components/staff/cleaning-form.tsx) (Cleaning record), [`components/auth/login-form.tsx`](https://github.com/mt1504-coffee/aseoucp2/blob/main/components/auth/login-form.tsx) (Login form)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_auth["Authentication"]
  node_login["Login form<br/>[login-form.tsx]"]
  node_register["Registration form<br/>[register-form.tsx]"]
  node_session["Auth provider<br/>[auth-provider.tsx]"]
  node_auth_store["Session storage<br/>[auth.ts]"]
end

subgraph group_staff["Staff Reporting"]
  node_cleaning_form["Cleaning record<br/>[cleaning-form.tsx]"]
  node_incident_form["Incident report<br/>[incident-form.tsx]"]
end

subgraph group_admin["Administration"]
  node_incident_dashboard["Incident dashboard"]
  node_cleaning_history["Cleaning history"]
  node_user_management["User management<br/>[users-list.tsx]"]
end

subgraph group_integration["API Integration"]
  node_backend{{"Spring Boot API"}}
  node_api_client["API client<br/>[api-client.ts]"]
end

node_staff_actor(("Cleaning staff"))
node_admin_actor(("Administrator"))

node_staff_actor -->|"signs in"| node_login
node_admin_actor -->|"signs in"| node_login
node_login -->|"submits credentials"| node_session
node_register -->|"authenticates"| node_session
node_session -->|"requests login"| node_api_client
node_session -->|"stores session"| node_auth_store
node_staff_actor -->|"records cleaning"| node_cleaning_form
node_staff_actor -->|"reports incident"| node_incident_form
node_cleaning_form -->|"uploads evidence"| node_api_client
node_cleaning_form -->|"submits activity"| node_api_client
node_incident_form -->|"submits incident"| node_api_client
node_admin_actor -->|"reviews incidents"| node_incident_dashboard
node_admin_actor -->|"reviews activity"| node_cleaning_history
node_admin_actor -->|"manages users"| node_user_management
node_incident_dashboard -->|"updates status"| node_api_client
node_cleaning_history -->|"loads history"| node_api_client
node_user_management -->|"manages accounts"| node_api_client
node_api_client -->|"sends API requests"| node_backend

click node_login "https://github.com/mt1504-coffee/aseoucp2/blob/main/components/auth/login-form.tsx"
click node_register "https://github.com/mt1504-coffee/aseoucp2/blob/main/components/auth/register-form.tsx"
click node_session "https://github.com/mt1504-coffee/aseoucp2/blob/main/components/auth/auth-provider.tsx"
click node_auth_store "https://github.com/mt1504-coffee/aseoucp2/blob/main/lib/auth.ts"
click node_cleaning_form "https://github.com/mt1504-coffee/aseoucp2/blob/main/components/staff/cleaning-form.tsx"
click node_incident_form "https://github.com/mt1504-coffee/aseoucp2/blob/main/components/staff/incident-form.tsx"
click node_api_client "https://github.com/mt1504-coffee/aseoucp2/blob/main/lib/api-client.ts"
click node_incident_dashboard "https://github.com/mt1504-coffee/aseoucp2/blob/main/components/admin/incidents-dashboard.tsx"
click node_cleaning_history "https://github.com/mt1504-coffee/aseoucp2/blob/main/components/admin/cleaning-history.tsx"
click node_user_management "https://github.com/mt1504-coffee/aseoucp2/blob/main/components/admin/users-list.tsx"

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,node_register,node_session,node_auth_store toneBlue
class node_cleaning_form,node_incident_form toneAmber
class node_incident_dashboard,node_cleaning_history,node_user_management toneMint
class node_backend,node_api_client toneRose
class node_staff_actor,node_admin_actor toneIndigo
```

## Components

### Authentication

- [Login form](https://github.com/mt1504-coffee/aseoucp2/blob/main/components/auth/login-form.tsx): `components/auth/login-form.tsx`
- [Registration form](https://github.com/mt1504-coffee/aseoucp2/blob/main/components/auth/register-form.tsx): `components/auth/register-form.tsx`
- [Auth provider](https://github.com/mt1504-coffee/aseoucp2/blob/main/components/auth/auth-provider.tsx): `components/auth/auth-provider.tsx`
- [Session storage](https://github.com/mt1504-coffee/aseoucp2/blob/main/lib/auth.ts): `lib/auth.ts`

### Staff Reporting

- [Cleaning record](https://github.com/mt1504-coffee/aseoucp2/blob/main/components/staff/cleaning-form.tsx): `components/staff/cleaning-form.tsx`
- [Incident report](https://github.com/mt1504-coffee/aseoucp2/blob/main/components/staff/incident-form.tsx): `components/staff/incident-form.tsx`

### Administration

- [Incident dashboard](https://github.com/mt1504-coffee/aseoucp2/blob/main/components/admin/incidents-dashboard.tsx): `components/admin/incidents-dashboard.tsx`
- [Cleaning history](https://github.com/mt1504-coffee/aseoucp2/blob/main/components/admin/cleaning-history.tsx): `components/admin/cleaning-history.tsx`
- [User management](https://github.com/mt1504-coffee/aseoucp2/blob/main/components/admin/users-list.tsx): `components/admin/users-list.tsx`

### API Integration

- **Spring Boot API**
- [API client](https://github.com/mt1504-coffee/aseoucp2/blob/main/lib/api-client.ts): `lib/api-client.ts`

### Other components

- **Cleaning staff**
- **Administrator**

## Connections

- Cleaning staff → Login form: signs in (evidence: `README.md`)
- Administrator → Login form: signs in (evidence: `README.md`)
- Login form → Auth provider: submits credentials (evidence: `components/auth/login-form.tsx`)
- Registration form → Auth provider: authenticates (evidence: `components/auth/register-form.tsx`)
- Auth provider → API client: requests login (evidence: `components/auth/auth-provider.tsx`)
- Auth provider → Session storage: stores session (evidence: `components/auth/auth-provider.tsx`)
- Cleaning staff → Cleaning record: records cleaning (evidence: `README.md`)
- Cleaning staff → Incident report: reports incident (evidence: `README.md`)
- Cleaning record → API client: uploads evidence (evidence: `components/staff/cleaning-form.tsx`)
- Cleaning record → API client: submits activity (evidence: `components/staff/cleaning-form.tsx`)
- Incident report → API client: submits incident (evidence: `components/staff/incident-form.tsx`)
- Administrator → Incident dashboard: reviews incidents (evidence: `README.md`)
- Administrator → Cleaning history: reviews activity (evidence: `README.md`)
- Administrator → User management: manages users (evidence: `README.md`)
- Incident dashboard → API client: updates status (evidence: `components/admin/incidents-dashboard.tsx`)
- Cleaning history → API client: loads history (evidence: `components/admin/cleaning-history.tsx`)
- User management → API client: manages accounts (evidence: `components/admin/users-list.tsx`)
- API client → Spring Boot API: sends API requests (evidence: `README.md`)
