# charansaiburra/campusheild architecture

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

- Interactive diagram: https://gitdiagram.com/charansaiburra/campusheild
- Repository: https://github.com/charansaiburra/campusheild

## Overview

CampusShield is a campus CCTV security platform: operators use a React dashboard to manage cameras, members, restricted zones, and security activity, while a FastAPI backend exposes authenticated APIs and AI/video modules support monitoring and face verification. The graph shows the documented product areas, sampled API registration and UI routing, plus the vision runtime and substantial Supervision toolkit modules. Several route implementations and the stream processor were not excerpted, so their internal behavior and data flow are not inferred.

Main entry points: [`ai_engine/pipeline/stream_processor.py`](https://github.com/charansaiburra/campusheild/blob/main/ai_engine/pipeline/stream_processor.py) (Video stream processing), [`backend/app/api/v1`](https://github.com/charansaiburra/campusheild/tree/main/backend/app/api/v1) (Versioned API routes), [`supervision/detection/core.py`](https://github.com/charansaiburra/campusheild/blob/main/supervision/detection/core.py) (Detection data model), [`services/enrollment_service.py`](https://github.com/charansaiburra/campusheild/blob/main/services/enrollment_service.py) (Member enrollment)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Operator dashboard"]
  node_app["Dashboard shell<br/>[App.tsx]"]
  node_members_ui["Member management<br/>[MembersPage.tsx]"]
  node_api_client["API client<br/>[api.ts]"]
end

subgraph group_backend["API and services"]
  node_api_entry["FastAPI application<br/>[main.py]"]
  node_routes["Versioned API routes"]
  node_auth_service["Authentication<br/>[auth_service.py]"]
  node_enrollment["Member enrollment"]
  node_events["Event handling<br/>[event_service.py]"]
  node_alerts["Alert handling<br/>[alert_service.py]"]
  node_notifications["Notifications"]
  node_database[("SQL database<br/>[database.py]")]
  node_models["Domain records<br/>[models.py]"]
end

subgraph group_vision["AI monitoring"]
  node_stream["Video stream processing"]
  node_video_source["Video input<br/>[video_source.py]"]
  node_person_detector["Person detection<br/>[person_detector.py]"]
  node_face_detector["Face detection<br/>[face_detector.py]"]
  node_tracker["Object tracking<br/>[tracker.py]"]
  node_embedder["Face embeddings<br/>[face_embedder.py]"]
  node_verifier["Face verification<br/>[face_verifier.py]"]
  node_zones["Zone detection<br/>[zone_detector.py]"]
  node_crowd["Crowd detection<br/>[crowd_detector.py]"]
end

subgraph group_sv["Vision toolkit"]
  node_sv_detection["Detection data model<br/>[core.py]"]
  node_sv_geometry["Geometry primitives<br/>[core.py]"]
  node_sv_utils["Detection utilities<br/>[utils.py]"]
  node_sv_overlap["Overlap filtering<br/>[overlap_filter.py]"]
  node_sv_slicer["Sliced inference"]
  node_sv_annotators["Detection annotators<br/>[core.py]"]
  node_sv_base["Annotator base<br/>[base.py]"]
  node_sv_colors["Color utilities<br/>[color.py]"]
  node_sv_images["Image utilities<br/>[image.py]"]
  node_sv_dataset["Detection datasets<br/>[core.py]"]
  node_sv_classification["Classifications<br/>[core.py]"]
  node_sv_keypoints["Keypoint data<br/>[core.py]"]
end

node_operator(("Security operator"))

node_operator -->|"uses dashboard"| node_app
node_app -->|"renders"| node_members_ui
node_app -->|"calls identity API"| node_api_client
node_app -.->|"sends API requests"| node_api_entry
node_api_entry -->|"registers routers"| node_routes
node_routes -->|"uses authentication"| node_auth_service
node_routes -.->|"handles enrollment"| node_enrollment
node_routes -.->|"handles events"| node_events
node_routes -.->|"handles alerts"| node_alerts
node_routes -.->|"handles notifications"| node_notifications
node_database -->|"creates schema"| node_models
node_enrollment -->|"uses database"| node_database
node_enrollment -->|"uses records"| node_models
node_enrollment -->|"generates embeddings"| node_embedder
node_enrollment -->|"detects faces"| node_face_detector
node_events -->|"uses database"| node_database
node_events -->|"uses records"| node_models
node_verifier -->|"uses database"| node_database
node_verifier -->|"uses records"| node_models
node_stream -->|"calls detector"| node_face_detector
node_stream -->|"calls detector"| node_person_detector
node_stream -->|"calls tracker"| node_tracker
node_stream -->|"calls embedder"| node_embedder
node_stream -->|"calls verifier"| node_verifier
node_stream -.->|"reads video"| node_video_source
node_sv_detection -->|"uses geometry"| node_sv_geometry
node_sv_detection -->|"uses utilities"| node_sv_utils
node_sv_detection -->|"uses filtering"| node_sv_overlap
node_sv_slicer -->|"merges detections"| node_sv_detection
node_sv_slicer -->|"filters overlaps"| node_sv_overlap
node_sv_slicer -->|"crops images"| node_sv_images
node_sv_annotators -->|"extends base"| node_sv_base
node_sv_annotators -->|"annotates detections"| node_sv_detection
node_sv_annotators -->|"uses colors"| node_sv_colors
node_sv_dataset -->|"stores annotations"| node_sv_detection
node_sv_classification -->|"supports datasets"| node_sv_dataset
node_sv_keypoints -->|"uses detection utilities"| node_sv_utils

click node_app "https://github.com/charansaiburra/campusheild/blob/main/frontend/src/App.tsx"
click node_members_ui "https://github.com/charansaiburra/campusheild/blob/main/frontend/src/pages/MembersPage.tsx"
click node_api_client "https://github.com/charansaiburra/campusheild/blob/main/frontend/src/services/api.ts"
click node_api_entry "https://github.com/charansaiburra/campusheild/blob/main/backend/app/main.py"
click node_routes "https://github.com/charansaiburra/campusheild/tree/main/backend/app/api/v1"
click node_auth_service "https://github.com/charansaiburra/campusheild/blob/main/services/auth_service.py"
click node_enrollment "https://github.com/charansaiburra/campusheild/blob/main/services/enrollment_service.py"
click node_events "https://github.com/charansaiburra/campusheild/blob/main/services/event_service.py"
click node_alerts "https://github.com/charansaiburra/campusheild/blob/main/services/alert_service.py"
click node_notifications "https://github.com/charansaiburra/campusheild/blob/main/services/notification_service.py"
click node_database "https://github.com/charansaiburra/campusheild/blob/main/db/database.py"
click node_models "https://github.com/charansaiburra/campusheild/blob/main/db/models.py"
click node_stream "https://github.com/charansaiburra/campusheild/blob/main/ai_engine/pipeline/stream_processor.py"
click node_video_source "https://github.com/charansaiburra/campusheild/blob/main/ai_engine/pipeline/video_source.py"
click node_person_detector "https://github.com/charansaiburra/campusheild/blob/main/ai_engine/detection/person_detector.py"
click node_face_detector "https://github.com/charansaiburra/campusheild/blob/main/ai_engine/detection/face_detector.py"
click node_tracker "https://github.com/charansaiburra/campusheild/blob/main/ai_engine/tracking/tracker.py"
click node_embedder "https://github.com/charansaiburra/campusheild/blob/main/ai_engine/face/face_embedder.py"
click node_verifier "https://github.com/charansaiburra/campusheild/blob/main/ai_engine/face/face_verifier.py"
click node_zones "https://github.com/charansaiburra/campusheild/blob/main/ai_engine/zones/zone_detector.py"
click node_crowd "https://github.com/charansaiburra/campusheild/blob/main/ai_engine/crowd/crowd_detector.py"
click node_sv_detection "https://github.com/charansaiburra/campusheild/blob/main/supervision/detection/core.py"
click node_sv_geometry "https://github.com/charansaiburra/campusheild/blob/main/supervision/geometry/core.py"
click node_sv_utils "https://github.com/charansaiburra/campusheild/blob/main/supervision/detection/utils.py"
click node_sv_overlap "https://github.com/charansaiburra/campusheild/blob/main/supervision/detection/overlap_filter.py"
click node_sv_slicer "https://github.com/charansaiburra/campusheild/blob/main/supervision/detection/tools/inference_slicer.py"
click node_sv_annotators "https://github.com/charansaiburra/campusheild/blob/main/supervision/annotators/core.py"
click node_sv_base "https://github.com/charansaiburra/campusheild/blob/main/supervision/annotators/base.py"
click node_sv_colors "https://github.com/charansaiburra/campusheild/blob/main/supervision/draw/color.py"
click node_sv_images "https://github.com/charansaiburra/campusheild/blob/main/supervision/utils/image.py"
click node_sv_dataset "https://github.com/charansaiburra/campusheild/blob/main/supervision/dataset/core.py"
click node_sv_classification "https://github.com/charansaiburra/campusheild/blob/main/supervision/classification/core.py"
click node_sv_keypoints "https://github.com/charansaiburra/campusheild/blob/main/supervision/keypoint/core.py"

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_members_ui,node_api_client toneBlue
class node_api_entry,node_routes,node_auth_service,node_enrollment,node_events,node_alerts,node_notifications,node_database,node_models toneAmber
class node_stream,node_video_source,node_person_detector,node_face_detector,node_tracker,node_embedder,node_verifier,node_zones,node_crowd toneMint
class node_sv_detection,node_sv_geometry,node_sv_utils,node_sv_overlap,node_sv_slicer,node_sv_annotators,node_sv_base,node_sv_colors,node_sv_images,node_sv_dataset,node_sv_classification,node_sv_keypoints toneRose
class node_operator toneIndigo
```

## Components

### Operator dashboard

- [Dashboard shell](https://github.com/charansaiburra/campusheild/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Member management](https://github.com/charansaiburra/campusheild/blob/main/frontend/src/pages/MembersPage.tsx): `frontend/src/pages/MembersPage.tsx`
- [API client](https://github.com/charansaiburra/campusheild/blob/main/frontend/src/services/api.ts): `frontend/src/services/api.ts`

### API and services

- [FastAPI application](https://github.com/charansaiburra/campusheild/blob/main/backend/app/main.py): `backend/app/main.py`
- [Versioned API routes](https://github.com/charansaiburra/campusheild/tree/main/backend/app/api/v1): `backend/app/api/v1`
- [Authentication](https://github.com/charansaiburra/campusheild/blob/main/services/auth_service.py): `services/auth_service.py`
- [Member enrollment](https://github.com/charansaiburra/campusheild/blob/main/services/enrollment_service.py): `services/enrollment_service.py`
- [Event handling](https://github.com/charansaiburra/campusheild/blob/main/services/event_service.py): `services/event_service.py`
- [Alert handling](https://github.com/charansaiburra/campusheild/blob/main/services/alert_service.py): `services/alert_service.py`
- [Notifications](https://github.com/charansaiburra/campusheild/blob/main/services/notification_service.py): `services/notification_service.py`
- [SQL database](https://github.com/charansaiburra/campusheild/blob/main/db/database.py): `db/database.py`
- [Domain records](https://github.com/charansaiburra/campusheild/blob/main/db/models.py): `db/models.py`

### AI monitoring

- [Video stream processing](https://github.com/charansaiburra/campusheild/blob/main/ai_engine/pipeline/stream_processor.py): `ai_engine/pipeline/stream_processor.py`
- [Video input](https://github.com/charansaiburra/campusheild/blob/main/ai_engine/pipeline/video_source.py): `ai_engine/pipeline/video_source.py`
- [Person detection](https://github.com/charansaiburra/campusheild/blob/main/ai_engine/detection/person_detector.py): `ai_engine/detection/person_detector.py`
- [Face detection](https://github.com/charansaiburra/campusheild/blob/main/ai_engine/detection/face_detector.py): `ai_engine/detection/face_detector.py`
- [Object tracking](https://github.com/charansaiburra/campusheild/blob/main/ai_engine/tracking/tracker.py): `ai_engine/tracking/tracker.py`
- [Face embeddings](https://github.com/charansaiburra/campusheild/blob/main/ai_engine/face/face_embedder.py): `ai_engine/face/face_embedder.py`
- [Face verification](https://github.com/charansaiburra/campusheild/blob/main/ai_engine/face/face_verifier.py): `ai_engine/face/face_verifier.py`
- [Zone detection](https://github.com/charansaiburra/campusheild/blob/main/ai_engine/zones/zone_detector.py): `ai_engine/zones/zone_detector.py`
- [Crowd detection](https://github.com/charansaiburra/campusheild/blob/main/ai_engine/crowd/crowd_detector.py): `ai_engine/crowd/crowd_detector.py`

### Vision toolkit

- [Detection data model](https://github.com/charansaiburra/campusheild/blob/main/supervision/detection/core.py): `supervision/detection/core.py`
- [Geometry primitives](https://github.com/charansaiburra/campusheild/blob/main/supervision/geometry/core.py): `supervision/geometry/core.py`
- [Detection utilities](https://github.com/charansaiburra/campusheild/blob/main/supervision/detection/utils.py): `supervision/detection/utils.py`
- [Overlap filtering](https://github.com/charansaiburra/campusheild/blob/main/supervision/detection/overlap_filter.py): `supervision/detection/overlap_filter.py`
- [Sliced inference](https://github.com/charansaiburra/campusheild/blob/main/supervision/detection/tools/inference_slicer.py): `supervision/detection/tools/inference_slicer.py`
- [Detection annotators](https://github.com/charansaiburra/campusheild/blob/main/supervision/annotators/core.py): `supervision/annotators/core.py`
- [Annotator base](https://github.com/charansaiburra/campusheild/blob/main/supervision/annotators/base.py): `supervision/annotators/base.py`
- [Color utilities](https://github.com/charansaiburra/campusheild/blob/main/supervision/draw/color.py): `supervision/draw/color.py`
- [Image utilities](https://github.com/charansaiburra/campusheild/blob/main/supervision/utils/image.py): `supervision/utils/image.py`
- [Detection datasets](https://github.com/charansaiburra/campusheild/blob/main/supervision/dataset/core.py): `supervision/dataset/core.py`
- [Classifications](https://github.com/charansaiburra/campusheild/blob/main/supervision/classification/core.py): `supervision/classification/core.py`
- [Keypoint data](https://github.com/charansaiburra/campusheild/blob/main/supervision/keypoint/core.py): `supervision/keypoint/core.py`

### Other components

- **Security operator**

## Connections

- Security operator → Dashboard shell: uses dashboard (evidence: `README.md`)
- Dashboard shell → Member management: renders (evidence: `frontend/src/App.tsx`)
- Dashboard shell → API client: calls identity API (evidence: `frontend/src/App.tsx`)
- Dashboard shell → FastAPI application: sends API requests
- FastAPI application → Versioned API routes: registers routers (evidence: `backend/app/main.py`)
- Versioned API routes → Authentication: uses authentication (evidence: `backend/app/api/v1/auth.py`)
- Versioned API routes → Member enrollment: handles enrollment
- Versioned API routes → Event handling: handles events
- Versioned API routes → Alert handling: handles alerts
- Versioned API routes → Notifications: handles notifications
- SQL database → Domain records: creates schema (evidence: `db/database.py`)
- Member enrollment → SQL database: uses database (evidence: `services/enrollment_service.py`)
- Member enrollment → Domain records: uses records (evidence: `services/enrollment_service.py`)
- Member enrollment → Face embeddings: generates embeddings (evidence: `services/enrollment_service.py`)
- Member enrollment → Face detection: detects faces (evidence: `services/enrollment_service.py`)
- Event handling → SQL database: uses database (evidence: `services/event_service.py`)
- Event handling → Domain records: uses records (evidence: `services/event_service.py`)
- Face verification → SQL database: uses database (evidence: `ai_engine/face/face_verifier.py`)
- Face verification → Domain records: uses records (evidence: `ai_engine/face/face_verifier.py`)
- Video stream processing → Face detection: calls detector (evidence: `ai_engine/pipeline/stream_processor.py`)
- Video stream processing → Person detection: calls detector (evidence: `ai_engine/pipeline/stream_processor.py`)
- Video stream processing → Object tracking: calls tracker (evidence: `ai_engine/pipeline/stream_processor.py`)
- Video stream processing → Face embeddings: calls embedder (evidence: `ai_engine/pipeline/stream_processor.py`)
- Video stream processing → Face verification: calls verifier (evidence: `ai_engine/pipeline/stream_processor.py`)
- Video stream processing → Video input: reads video
- Detection data model → Geometry primitives: uses geometry (evidence: `supervision/detection/core.py`)
- Detection data model → Detection utilities: uses utilities (evidence: `supervision/detection/core.py`)
- Detection data model → Overlap filtering: uses filtering (evidence: `supervision/detection/core.py`)
- Sliced inference → Detection data model: merges detections (evidence: `supervision/detection/tools/inference_slicer.py`)
- Sliced inference → Overlap filtering: filters overlaps (evidence: `supervision/detection/tools/inference_slicer.py`)
- Sliced inference → Image utilities: crops images (evidence: `supervision/detection/tools/inference_slicer.py`)
- Detection annotators → Annotator base: extends base (evidence: `supervision/annotators/core.py`)
- Detection annotators → Detection data model: annotates detections (evidence: `supervision/annotators/core.py`)
- Detection annotators → Color utilities: uses colors (evidence: `supervision/annotators/core.py`)
- Detection datasets → Detection data model: stores annotations (evidence: `supervision/dataset/core.py`)
- Classifications → Detection datasets: supports datasets (evidence: `supervision/dataset/core.py`)
- Keypoint data → Detection utilities: uses detection utilities (evidence: `supervision/keypoint/core.py`)
