# cafm-system/cafm-frontend architecture

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

- Interactive diagram: https://gitdiagram.com/cafm-system/cafm-frontend
- Repository: https://github.com/cafm-system/cafm-frontend

## Overview

This is a React frontend for a property-management workflow covering resident maintenance tickets, technician ticket handling, administrative oversight, user management, and front-desk visitor registration. Users enter through routed role-specific pages; those pages present dashboards and forms, while service modules make authenticated API requests. The supplied excerpts show ticket and visitor operations, authentication, report downloads, and theme state. Some listed pages and services were not sampled, so their internal call relationships are left out rather than inferred.

Main entry points: [`src/App.jsx`](https://github.com/cafm-system/cafm-frontend/blob/main/src/App.jsx) (Route dispatcher), [`src/services/apiclient.js`](https://github.com/cafm-system/cafm-frontend/blob/main/src/services/apiclient.js) (API client), [`src/pages/admin/AdminDashboard.jsx`](https://github.com/cafm-system/cafm-frontend/blob/main/src/pages/admin/AdminDashboard.jsx) (Admin dashboard), [`src/services/ticket.service.js`](https://github.com/cafm-system/cafm-frontend/blob/main/src/services/ticket.service.js) (Ticket service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["App and access"]
  node_app["Route dispatcher<br/>[App.jsx]"]
  node_login["Sign in<br/>[LoginPage.jsx]"]
  node_register["Account registration<br/>[RegisterPg.jsx]"]
  node_authsvc["Authentication service<br/>[auth.service.js]"]
end

subgraph group_tickets["Maintenance tickets"]
  node_residentdash["Resident dashboard"]
  node_residentcreate["Create ticket form"]
  node_residentdetail["Resident ticket detail"]
  node_techdash["Technician dashboard"]
  node_techactions["Technician actions"]
  node_ticketcard["Ticket card<br/>[ticketCard.jsx]"]
  node_ticketservice["Ticket service<br/>[ticket.service.js]"]
  node_ticketdata["Ticket data helpers<br/>[newTicketData.js]"]
  node_ticketupdates["Ticket update data"]
end

subgraph group_visitors["Visitor management"]
  node_frontdesk["Front-desk dashboard<br/>[FDeskDashBoard.jsx]"]
  node_visitorform["Visitor registration<br/>[VisitorRegForm.jsx]"]
  node_visitorservice["Visitor service<br/>[visitor.service.js]"]
end

subgraph group_admin["Administration"]
  node_admindash["Admin dashboard<br/>[AdminDashboard.jsx]"]
  node_adminusers["User management<br/>[AdminUsers.jsx]"]
  node_analytics["Reports analytics"]
  node_visitorrecords["Visitor records"]
  node_reportservice["Report service<br/>[report.service.js]"]
end

subgraph group_platform["Shared services"]
  node_apiclient["API client<br/>[apiclient.js]"]
  node_theme["Theme state<br/>[useTheme.js]"]
end

node_user(("User"))
node_backend{{"Backend API"}}

node_user -->|"opens routes"| node_app
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_register
node_app -->|"routes to"| node_admindash
node_app -->|"routes to"| node_adminusers
node_app -->|"routes to"| node_frontdesk
node_app -->|"routes to"| node_visitorform
node_login -->|"authenticates with"| node_authsvc
node_register -->|"registers through"| node_authsvc
node_authsvc -->|"sends requests"| node_apiclient
node_residentdash -->|"fetches tickets"| node_apiclient
node_residentdash -->|"opens form"| node_residentcreate
node_residentdash -->|"opens details"| node_residentdetail
node_residentcreate -->|"creates tickets"| node_ticketservice
node_residentdetail -->|"updates tickets"| node_ticketservice
node_residentdetail -->|"uses ticket data"| node_ticketdata
node_residentdetail -->|"uses update data"| node_ticketupdates
node_techdash -->|"loads tickets"| node_ticketservice
node_techdash -->|"renders tickets"| node_ticketcard
node_techactions -->|"changes tickets"| node_ticketservice
node_ticketservice -->|"sends requests"| node_apiclient
node_frontdesk -->|"opens registration"| node_visitorform
node_frontdesk -->|"loads visitor data"| node_visitorservice
node_visitorservice -->|"sends requests"| node_apiclient
node_admindash -->|"renders reports"| node_analytics
node_admindash -->|"renders records"| node_visitorrecords
node_admindash -->|"renders tickets"| node_ticketcard
node_analytics -->|"downloads reports"| node_reportservice
node_visitorrecords -->|"downloads reports"| node_reportservice
node_reportservice -->|"sends requests"| node_apiclient
node_apiclient -->|"sends API calls"| node_backend
node_ticketcard -->|"reads theme"| node_theme
node_admindash -->|"reads theme"| node_theme

click node_app "https://github.com/cafm-system/cafm-frontend/blob/main/src/App.jsx"
click node_login "https://github.com/cafm-system/cafm-frontend/blob/main/src/pages/auth/LoginPage.jsx"
click node_register "https://github.com/cafm-system/cafm-frontend/blob/main/src/pages/auth/RegisterPg.jsx"
click node_authsvc "https://github.com/cafm-system/cafm-frontend/blob/main/src/services/auth.service.js"
click node_residentdash "https://github.com/cafm-system/cafm-frontend/blob/main/src/pages/ResidentDashboad.jsx"
click node_residentcreate "https://github.com/cafm-system/cafm-frontend/blob/main/src/components/resident/CreateTicketDialog.jsx"
click node_residentdetail "https://github.com/cafm-system/cafm-frontend/blob/main/src/components/resident/residentTicketDialog.jsx"
click node_techdash "https://github.com/cafm-system/cafm-frontend/blob/main/src/pages/technician/TechnicianDashboard.jsx"
click node_techactions "https://github.com/cafm-system/cafm-frontend/blob/main/src/components/technician/TechnicianActions.jsx"
click node_ticketcard "https://github.com/cafm-system/cafm-frontend/blob/main/src/components/common/ticketCard.jsx"
click node_ticketservice "https://github.com/cafm-system/cafm-frontend/blob/main/src/services/ticket.service.js"
click node_ticketdata "https://github.com/cafm-system/cafm-frontend/blob/main/src/services/newTicketData.js"
click node_ticketupdates "https://github.com/cafm-system/cafm-frontend/blob/main/src/services/ticketUpdatesData.js"
click node_frontdesk "https://github.com/cafm-system/cafm-frontend/blob/main/src/pages/frontDesk/FDeskDashBoard.jsx"
click node_visitorform "https://github.com/cafm-system/cafm-frontend/blob/main/src/pages/frontDesk/VisitorRegForm.jsx"
click node_visitorservice "https://github.com/cafm-system/cafm-frontend/blob/main/src/services/visitor.service.js"
click node_admindash "https://github.com/cafm-system/cafm-frontend/blob/main/src/pages/admin/AdminDashboard.jsx"
click node_adminusers "https://github.com/cafm-system/cafm-frontend/blob/main/src/components/admin/AdminUsers.jsx"
click node_analytics "https://github.com/cafm-system/cafm-frontend/blob/main/src/components/admin/ReportsAnalytics.jsx"
click node_visitorrecords "https://github.com/cafm-system/cafm-frontend/blob/main/src/components/admin/TotalVisitorRecords.jsx"
click node_reportservice "https://github.com/cafm-system/cafm-frontend/blob/main/src/services/report.service.js"
click node_apiclient "https://github.com/cafm-system/cafm-frontend/blob/main/src/services/apiclient.js"
click node_theme "https://github.com/cafm-system/cafm-frontend/blob/main/src/hooks/useTheme.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_login,node_register,node_authsvc,node_user toneBlue
class node_residentdash,node_residentcreate,node_residentdetail,node_techdash,node_techactions,node_ticketcard,node_ticketservice,node_ticketdata,node_ticketupdates toneAmber
class node_frontdesk,node_visitorform,node_visitorservice,node_backend toneMint
class node_admindash,node_adminusers,node_analytics,node_visitorrecords,node_reportservice toneRose
class node_apiclient,node_theme toneIndigo
```

## Components

### App and access

- [Route dispatcher](https://github.com/cafm-system/cafm-frontend/blob/main/src/App.jsx): `src/App.jsx`
- [Sign in](https://github.com/cafm-system/cafm-frontend/blob/main/src/pages/auth/LoginPage.jsx): `src/pages/auth/LoginPage.jsx`
- [Account registration](https://github.com/cafm-system/cafm-frontend/blob/main/src/pages/auth/RegisterPg.jsx): `src/pages/auth/RegisterPg.jsx`
- [Authentication service](https://github.com/cafm-system/cafm-frontend/blob/main/src/services/auth.service.js): `src/services/auth.service.js`

### Maintenance tickets

- [Resident dashboard](https://github.com/cafm-system/cafm-frontend/blob/main/src/pages/ResidentDashboad.jsx): `src/pages/ResidentDashboad.jsx`
- [Create ticket form](https://github.com/cafm-system/cafm-frontend/blob/main/src/components/resident/CreateTicketDialog.jsx): `src/components/resident/CreateTicketDialog.jsx`
- [Resident ticket detail](https://github.com/cafm-system/cafm-frontend/blob/main/src/components/resident/residentTicketDialog.jsx): `src/components/resident/residentTicketDialog.jsx`
- [Technician dashboard](https://github.com/cafm-system/cafm-frontend/blob/main/src/pages/technician/TechnicianDashboard.jsx): `src/pages/technician/TechnicianDashboard.jsx`
- [Technician actions](https://github.com/cafm-system/cafm-frontend/blob/main/src/components/technician/TechnicianActions.jsx): `src/components/technician/TechnicianActions.jsx`
- [Ticket card](https://github.com/cafm-system/cafm-frontend/blob/main/src/components/common/ticketCard.jsx): `src/components/common/ticketCard.jsx`
- [Ticket service](https://github.com/cafm-system/cafm-frontend/blob/main/src/services/ticket.service.js): `src/services/ticket.service.js`
- [Ticket data helpers](https://github.com/cafm-system/cafm-frontend/blob/main/src/services/newTicketData.js): `src/services/newTicketData.js`
- [Ticket update data](https://github.com/cafm-system/cafm-frontend/blob/main/src/services/ticketUpdatesData.js): `src/services/ticketUpdatesData.js`

### Visitor management

- [Front-desk dashboard](https://github.com/cafm-system/cafm-frontend/blob/main/src/pages/frontDesk/FDeskDashBoard.jsx): `src/pages/frontDesk/FDeskDashBoard.jsx`
- [Visitor registration](https://github.com/cafm-system/cafm-frontend/blob/main/src/pages/frontDesk/VisitorRegForm.jsx): `src/pages/frontDesk/VisitorRegForm.jsx`
- [Visitor service](https://github.com/cafm-system/cafm-frontend/blob/main/src/services/visitor.service.js): `src/services/visitor.service.js`

### Administration

- [Admin dashboard](https://github.com/cafm-system/cafm-frontend/blob/main/src/pages/admin/AdminDashboard.jsx): `src/pages/admin/AdminDashboard.jsx`
- [User management](https://github.com/cafm-system/cafm-frontend/blob/main/src/components/admin/AdminUsers.jsx): `src/components/admin/AdminUsers.jsx`
- [Reports analytics](https://github.com/cafm-system/cafm-frontend/blob/main/src/components/admin/ReportsAnalytics.jsx): `src/components/admin/ReportsAnalytics.jsx`
- [Visitor records](https://github.com/cafm-system/cafm-frontend/blob/main/src/components/admin/TotalVisitorRecords.jsx): `src/components/admin/TotalVisitorRecords.jsx`
- [Report service](https://github.com/cafm-system/cafm-frontend/blob/main/src/services/report.service.js): `src/services/report.service.js`

### Shared services

- [API client](https://github.com/cafm-system/cafm-frontend/blob/main/src/services/apiclient.js): `src/services/apiclient.js`
- [Theme state](https://github.com/cafm-system/cafm-frontend/blob/main/src/hooks/useTheme.js): `src/hooks/useTheme.js`

### Other components

- **User**
- **Backend API**

## Connections

- User → Route dispatcher: opens routes (evidence: `src/App.jsx`)
- Route dispatcher → Sign in: routes to (evidence: `src/App.jsx`)
- Route dispatcher → Account registration: routes to (evidence: `src/App.jsx`)
- Route dispatcher → Admin dashboard: routes to (evidence: `src/App.jsx`)
- Route dispatcher → User management: routes to (evidence: `src/App.jsx`)
- Route dispatcher → Front-desk dashboard: routes to (evidence: `src/App.jsx`)
- Route dispatcher → Visitor registration: routes to (evidence: `src/App.jsx`)
- Sign in → Authentication service: authenticates with (evidence: `src/pages/auth/LoginPage.jsx`)
- Account registration → Authentication service: registers through (evidence: `src/pages/auth/RegisterPg.jsx`)
- Authentication service → API client: sends requests (evidence: `src/services/auth.service.js`)
- Resident dashboard → API client: fetches tickets (evidence: `src/pages/ResidentDashboad.jsx`)
- Resident dashboard → Create ticket form: opens form (evidence: `src/pages/ResidentDashboad.jsx`)
- Resident dashboard → Resident ticket detail: opens details (evidence: `src/pages/ResidentDashboad.jsx`)
- Create ticket form → Ticket service: creates tickets (evidence: `src/components/resident/CreateTicketDialog.jsx`)
- Resident ticket detail → Ticket service: updates tickets (evidence: `src/components/resident/residentTicketDialog.jsx`)
- Resident ticket detail → Ticket data helpers: uses ticket data (evidence: `src/components/resident/residentTicketDialog.jsx`)
- Resident ticket detail → Ticket update data: uses update data (evidence: `src/components/resident/residentTicketDialog.jsx`)
- Technician dashboard → Ticket service: loads tickets (evidence: `src/pages/technician/TechnicianDashboard.jsx`)
- Technician dashboard → Ticket card: renders tickets (evidence: `src/pages/technician/TechnicianDashboard.jsx`)
- Technician actions → Ticket service: changes tickets (evidence: `src/components/technician/TechnicianActions.jsx`)
- Ticket service → API client: sends requests (evidence: `src/services/ticket.service.js`)
- Front-desk dashboard → Visitor registration: opens registration (evidence: `src/pages/frontDesk/FDeskDashBoard.jsx`)
- Front-desk dashboard → Visitor service: loads visitor data (evidence: `src/pages/frontDesk/FDeskDashBoard.jsx`)
- Visitor service → API client: sends requests (evidence: `src/services/visitor.service.js`)
- Admin dashboard → Reports analytics: renders reports (evidence: `src/pages/admin/AdminDashboard.jsx`)
- Admin dashboard → Visitor records: renders records (evidence: `src/pages/admin/AdminDashboard.jsx`)
- Admin dashboard → Ticket card: renders tickets (evidence: `src/pages/admin/AdminDashboard.jsx`)
- Reports analytics → Report service: downloads reports (evidence: `src/components/admin/ReportsAnalytics.jsx`)
- Visitor records → Report service: downloads reports (evidence: `src/components/admin/TotalVisitorRecords.jsx`)
- Report service → API client: sends requests (evidence: `src/services/report.service.js`)
- API client → Backend API: sends API calls (evidence: `src/services/apiclient.js`)
- Ticket card → Theme state: reads theme (evidence: `src/components/common/ticketCard.jsx`)
- Admin dashboard → Theme state: reads theme (evidence: `src/pages/admin/AdminDashboard.jsx`)
