# sumeshpatva97/cctv-admin-panel architecture

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

- Interactive diagram: https://gitdiagram.com/sumeshpatva97/cctv-admin-panel
- Repository: https://github.com/sumeshpatva97/cctv-admin-panel

## Overview

This is a role-based React application for CCTV operations and workforce attendance. Users enter through authenticated, permission-guarded routes; feature screens manage operational data, camera monitoring, attendance corrections, reporting and employee self-service through a shared API client. The repository excerpts show route dispatch, session handling and list-query plumbing. Most individual feature implementations were not sampled, so those documented capabilities are represented at feature level; the live-stream service relationship is left unverified.

Main entry points: [`src/routes/routes.tsx`](https://github.com/sumeshpatva97/cctv-admin-panel/blob/develop/src/routes/routes.tsx) (Guarded routes), [`src/app/App.tsx`](https://github.com/sumeshpatva97/cctv-admin-panel/blob/develop/src/app/App.tsx) (Application), [`src/services/api/client.ts`](https://github.com/sumeshpatva97/cctv-admin-panel/blob/develop/src/services/api/client.ts) (API client), [`src/features/live-monitoring`](https://github.com/sumeshpatva97/cctv-admin-panel/tree/develop/src/features/live-monitoring) (Live monitoring)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["App runtime"]
  node_app["Application<br/>[App.tsx]"]
  node_routes["Guarded routes<br/>[routes.tsx]"]
  node_shell["App shell<br/>[AppShell.tsx]"]
end

subgraph group_workforce["Workforce operations"]
  node_employees["Employees and departments"]
  node_attendance["Attendance and corrections"]
  node_shifts["Shifts and work hours"]
  node_selfservice["Employee self-service"]
end

subgraph group_cctv["CCTV operations"]
  node_cameras["Camera management"]
  node_monitoring["Live monitoring"]
  node_player["WHEP player<br/>[WhepClient.ts]"]
end

subgraph group_insights["Insights and access"]
  node_dashboard["Dashboard"]
  node_reports["Reports"]
  node_audit["Audit logs"]
  node_usersroles["Users and roles"]
  node_settings["Organization settings"]
end

subgraph group_shared["Shared services"]
  node_auth["Session and permissions<br/>[AuthProvider.tsx]"]
  node_query["Query and list state<br/>[useListQuery.ts]"]
  node_api["API client<br/>[client.ts]"]
end

node_users(("App users"))
node_backend["CCTV API"]

node_users -->|"use"| node_app
node_app -->|"renders routes"| node_routes
node_app -->|"provides session"| node_auth
node_routes -->|"mounts shell"| node_shell
node_routes -->|"dispatches"| node_employees
node_routes -->|"dispatches"| node_attendance
node_routes -->|"dispatches"| node_shifts
node_routes -->|"dispatches"| node_selfservice
node_routes -->|"dispatches"| node_cameras
node_routes -->|"dispatches"| node_monitoring
node_routes -->|"dispatches"| node_dashboard
node_routes -->|"dispatches"| node_reports
node_routes -->|"dispatches"| node_audit
node_routes -->|"dispatches"| node_usersroles
node_routes -->|"dispatches"| node_settings
node_auth -->|"requests session"| node_api
node_query -->|"loads lists"| node_api
node_api -->|"HTTP requests"| node_backend
node_monitoring -.->|"uses player"| node_player
node_player -.->|"requests stream"| node_backend

click node_app "https://github.com/sumeshpatva97/cctv-admin-panel/blob/develop/src/app/App.tsx"
click node_routes "https://github.com/sumeshpatva97/cctv-admin-panel/blob/develop/src/routes/routes.tsx"
click node_shell "https://github.com/sumeshpatva97/cctv-admin-panel/blob/develop/src/components/layout/AppShell.tsx"
click node_employees "https://github.com/sumeshpatva97/cctv-admin-panel/tree/develop/src/features/employees"
click node_attendance "https://github.com/sumeshpatva97/cctv-admin-panel/tree/develop/src/features/attendance"
click node_shifts "https://github.com/sumeshpatva97/cctv-admin-panel/tree/develop/src/features/shifts"
click node_selfservice "https://github.com/sumeshpatva97/cctv-admin-panel/tree/develop/src/features/self-service"
click node_cameras "https://github.com/sumeshpatva97/cctv-admin-panel/tree/develop/src/features/cameras"
click node_monitoring "https://github.com/sumeshpatva97/cctv-admin-panel/tree/develop/src/features/live-monitoring"
click node_player "https://github.com/sumeshpatva97/cctv-admin-panel/blob/develop/src/features/live-monitoring/player/WhepClient.ts"
click node_dashboard "https://github.com/sumeshpatva97/cctv-admin-panel/tree/develop/src/features/dashboard"
click node_reports "https://github.com/sumeshpatva97/cctv-admin-panel/tree/develop/src/features/reports"
click node_audit "https://github.com/sumeshpatva97/cctv-admin-panel/tree/develop/src/features/audit"
click node_usersroles "https://github.com/sumeshpatva97/cctv-admin-panel/tree/develop/src/features/users-roles"
click node_settings "https://github.com/sumeshpatva97/cctv-admin-panel/tree/develop/src/features/settings"
click node_auth "https://github.com/sumeshpatva97/cctv-admin-panel/blob/develop/src/state/auth/AuthProvider.tsx"
click node_query "https://github.com/sumeshpatva97/cctv-admin-panel/blob/develop/src/hooks/useListQuery.ts"
click node_api "https://github.com/sumeshpatva97/cctv-admin-panel/blob/develop/src/services/api/client.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_routes,node_shell,node_users toneBlue
class node_employees,node_attendance,node_shifts,node_selfservice toneAmber
class node_cameras,node_monitoring,node_player,node_backend toneMint
class node_dashboard,node_reports,node_audit,node_usersroles,node_settings toneRose
class node_auth,node_query,node_api toneIndigo
```

## Components

### App runtime

- [Application](https://github.com/sumeshpatva97/cctv-admin-panel/blob/develop/src/app/App.tsx): `src/app/App.tsx`
- [Guarded routes](https://github.com/sumeshpatva97/cctv-admin-panel/blob/develop/src/routes/routes.tsx): `src/routes/routes.tsx`
- [App shell](https://github.com/sumeshpatva97/cctv-admin-panel/blob/develop/src/components/layout/AppShell.tsx): `src/components/layout/AppShell.tsx`

### Workforce operations

- [Employees and departments](https://github.com/sumeshpatva97/cctv-admin-panel/tree/develop/src/features/employees): `src/features/employees`
- [Attendance and corrections](https://github.com/sumeshpatva97/cctv-admin-panel/tree/develop/src/features/attendance): `src/features/attendance`
- [Shifts and work hours](https://github.com/sumeshpatva97/cctv-admin-panel/tree/develop/src/features/shifts): `src/features/shifts`
- [Employee self-service](https://github.com/sumeshpatva97/cctv-admin-panel/tree/develop/src/features/self-service): `src/features/self-service`

### CCTV operations

- [Camera management](https://github.com/sumeshpatva97/cctv-admin-panel/tree/develop/src/features/cameras): `src/features/cameras`
- [Live monitoring](https://github.com/sumeshpatva97/cctv-admin-panel/tree/develop/src/features/live-monitoring): `src/features/live-monitoring`
- [WHEP player](https://github.com/sumeshpatva97/cctv-admin-panel/blob/develop/src/features/live-monitoring/player/WhepClient.ts): `src/features/live-monitoring/player/WhepClient.ts`

### Insights and access

- [Dashboard](https://github.com/sumeshpatva97/cctv-admin-panel/tree/develop/src/features/dashboard): `src/features/dashboard`
- [Reports](https://github.com/sumeshpatva97/cctv-admin-panel/tree/develop/src/features/reports): `src/features/reports`
- [Audit logs](https://github.com/sumeshpatva97/cctv-admin-panel/tree/develop/src/features/audit): `src/features/audit`
- [Users and roles](https://github.com/sumeshpatva97/cctv-admin-panel/tree/develop/src/features/users-roles): `src/features/users-roles`
- [Organization settings](https://github.com/sumeshpatva97/cctv-admin-panel/tree/develop/src/features/settings): `src/features/settings`

### Shared services

- [Session and permissions](https://github.com/sumeshpatva97/cctv-admin-panel/blob/develop/src/state/auth/AuthProvider.tsx): `src/state/auth/AuthProvider.tsx`
- [Query and list state](https://github.com/sumeshpatva97/cctv-admin-panel/blob/develop/src/hooks/useListQuery.ts): `src/hooks/useListQuery.ts`
- [API client](https://github.com/sumeshpatva97/cctv-admin-panel/blob/develop/src/services/api/client.ts): `src/services/api/client.ts`

### Other components

- **App users**
- **CCTV API**

## Connections

- App users → Application: use
- Application → Guarded routes: renders routes (evidence: `src/app/App.tsx`)
- Application → Session and permissions: provides session
- Guarded routes → App shell: mounts shell (evidence: `src/routes/routes.tsx`)
- Guarded routes → Employees and departments: dispatches (evidence: `src/routes/routes.tsx`)
- Guarded routes → Attendance and corrections: dispatches (evidence: `src/routes/routes.tsx`)
- Guarded routes → Shifts and work hours: dispatches (evidence: `src/routes/routes.tsx`)
- Guarded routes → Employee self-service: dispatches (evidence: `src/routes/routes.tsx`)
- Guarded routes → Camera management: dispatches (evidence: `src/routes/routes.tsx`)
- Guarded routes → Live monitoring: dispatches (evidence: `src/routes/routes.tsx`)
- Guarded routes → Dashboard: dispatches (evidence: `src/routes/routes.tsx`)
- Guarded routes → Reports: dispatches (evidence: `src/routes/routes.tsx`)
- Guarded routes → Audit logs: dispatches (evidence: `src/routes/routes.tsx`)
- Guarded routes → Users and roles: dispatches (evidence: `src/routes/routes.tsx`)
- Guarded routes → Organization settings: dispatches (evidence: `src/routes/routes.tsx`)
- Session and permissions → API client: requests session (evidence: `src/state/auth/AuthProvider.tsx`)
- Query and list state → API client: loads lists (evidence: `src/hooks/useListQuery.ts`)
- API client → CCTV API: HTTP requests
- Live monitoring → WHEP player: uses player (evidence: `src/features/live-monitoring/player/WhepClient.ts`)
- WHEP player → CCTV API: requests stream
