# maharshkewat-india/n-one architecture

> Architecture diagram of the GitHub repository maharshkewat-india/n-one, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/maharshkewat-india/n-one
- Repository: https://github.com/maharshkewat-india/n-one
- Video tour (about a minute): https://gitdiagram.com/maharshkewat-india/n-one/video

## Overview

N-ONE is a Streamlit surveillance platform for authenticated operators and administrators. Its principal workflow is to select a surveillance mode and video source, analyze frames for faces or threats, then display and log results; registered profiles support attendance and lost-person search, while unknown-person tracking is documented as a separate capability. The runtime is concentrated in app.py, with deepface_adapter.py providing the documented OpenCV fallback and optional DeepFace compatibility. The source excerpts are partial, so the graph omits uncertain internal call wiring and represents documented capabilities without claiming their precise implementation boundaries.

Main entry points: [`app.py`](https://github.com/maharshkewat-india/n-one/blob/main/app.py) (Streamlit Dashboard), [`deepface_adapter.py`](https://github.com/maharshkewat-india/n-one/blob/main/deepface_adapter.py) (Recognition Adapter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and Profiles"]
  node_dashboard["Streamlit Dashboard<br/>[app.py]"]
  node_authentication["Role Authentication<br/>[app.py]"]
  node_profile_management["Profile Management<br/>[app.py]"]
  node_profile_capture["Face Capture<br/>[app.py]"]
end

subgraph group_surveillance["Surveillance Runtime"]
  node_video_ingestion["Video Ingestion<br/>[app.py]"]
  node_mode_selection["Mode Selection<br/>[app.py]"]
  node_frame_analysis["Frame Analysis<br/>[app.py]"]
  node_attendance["Attendance Logging<br/>[app.py]"]
  node_victim_search["Victim Search<br/>[app.py]"]
  node_unknown_tracking["Unknown Tracking<br/>[app.py]"]
  node_threat_detection["Threat Detection<br/>[app.py]"]
end

subgraph group_results["Results and Records"]
  node_result_display["Result Display<br/>[app.py]"]
  node_audit_logs[("Audit and Event Logs<br/>[app.py]")]
end

subgraph group_recognition["Recognition Backend"]
  node_face_recognition["Face Recognition<br/>[app.py]"]
  node_recognition_adapter["Recognition Adapter"]
end

node_user(("Admin or Operator"))
node_opencv["OpenCV Runtime"]
node_deepface["DeepFace Runtime"]
node_operator(("Monitoring Operator"))

node_user -->|"uses"| node_dashboard
node_dashboard -->|"checks access"| node_authentication
node_dashboard -->|"manages profiles"| node_profile_management
node_profile_management -->|"captures face"| node_profile_capture
node_dashboard -->|"selects mode"| node_mode_selection
node_dashboard -->|"starts feed"| node_video_ingestion
node_video_ingestion -->|"supplies frames"| node_frame_analysis
node_frame_analysis -->|"analyzes faces"| node_face_recognition
node_face_recognition -->|"requests matching"| node_recognition_adapter
node_recognition_adapter -->|"falls back to"| node_opencv
node_recognition_adapter -.->|"uses when available"| node_deepface
node_mode_selection -->|"runs attendance"| node_attendance
node_mode_selection -->|"runs search"| node_victim_search
node_mode_selection -->|"runs detection"| node_threat_detection
node_face_recognition -->|"tracks unknowns"| node_unknown_tracking
node_dashboard -->|"renders results"| node_result_display
node_dashboard -->|"records events"| node_audit_logs
node_operator -->|"monitors"| node_dashboard
node_operator -->|"views results"| node_result_display

click node_dashboard "https://github.com/maharshkewat-india/n-one/blob/main/app.py"
click node_authentication "https://github.com/maharshkewat-india/n-one/blob/main/app.py"
click node_profile_management "https://github.com/maharshkewat-india/n-one/blob/main/app.py"
click node_profile_capture "https://github.com/maharshkewat-india/n-one/blob/main/app.py"
click node_video_ingestion "https://github.com/maharshkewat-india/n-one/blob/main/app.py"
click node_mode_selection "https://github.com/maharshkewat-india/n-one/blob/main/app.py"
click node_frame_analysis "https://github.com/maharshkewat-india/n-one/blob/main/app.py"
click node_face_recognition "https://github.com/maharshkewat-india/n-one/blob/main/app.py"
click node_recognition_adapter "https://github.com/maharshkewat-india/n-one/blob/main/deepface_adapter.py"
click node_attendance "https://github.com/maharshkewat-india/n-one/blob/main/app.py"
click node_victim_search "https://github.com/maharshkewat-india/n-one/blob/main/app.py"
click node_unknown_tracking "https://github.com/maharshkewat-india/n-one/blob/main/app.py"
click node_threat_detection "https://github.com/maharshkewat-india/n-one/blob/main/app.py"
click node_result_display "https://github.com/maharshkewat-india/n-one/blob/main/app.py"
click node_audit_logs "https://github.com/maharshkewat-india/n-one/blob/main/app.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_dashboard,node_authentication,node_profile_management,node_profile_capture toneBlue
class node_video_ingestion,node_mode_selection,node_frame_analysis,node_attendance,node_victim_search,node_unknown_tracking,node_threat_detection toneAmber
class node_result_display,node_audit_logs toneMint
class node_face_recognition,node_recognition_adapter toneRose
class node_user,node_opencv,node_deepface,node_operator toneIndigo
```

## Components

### Access and Profiles

- [Streamlit Dashboard](https://github.com/maharshkewat-india/n-one/blob/main/app.py): `app.py`
- [Role Authentication](https://github.com/maharshkewat-india/n-one/blob/main/app.py): `app.py`
- [Profile Management](https://github.com/maharshkewat-india/n-one/blob/main/app.py): `app.py`
- [Face Capture](https://github.com/maharshkewat-india/n-one/blob/main/app.py): `app.py`

### Surveillance Runtime

- [Video Ingestion](https://github.com/maharshkewat-india/n-one/blob/main/app.py): `app.py`
- [Mode Selection](https://github.com/maharshkewat-india/n-one/blob/main/app.py): `app.py`
- [Frame Analysis](https://github.com/maharshkewat-india/n-one/blob/main/app.py): `app.py`
- [Attendance Logging](https://github.com/maharshkewat-india/n-one/blob/main/app.py): `app.py`
- [Victim Search](https://github.com/maharshkewat-india/n-one/blob/main/app.py): `app.py`
- [Unknown Tracking](https://github.com/maharshkewat-india/n-one/blob/main/app.py): `app.py`
- [Threat Detection](https://github.com/maharshkewat-india/n-one/blob/main/app.py): `app.py`

### Results and Records

- [Result Display](https://github.com/maharshkewat-india/n-one/blob/main/app.py): `app.py`
- [Audit and Event Logs](https://github.com/maharshkewat-india/n-one/blob/main/app.py): `app.py`

### Recognition Backend

- [Face Recognition](https://github.com/maharshkewat-india/n-one/blob/main/app.py): `app.py`
- [Recognition Adapter](https://github.com/maharshkewat-india/n-one/blob/main/deepface_adapter.py): `deepface_adapter.py`

### Other components

- **Admin or Operator**
- **OpenCV Runtime**
- **DeepFace Runtime**
- **Monitoring Operator**

## Connections

- Admin or Operator → Streamlit Dashboard: uses
- Streamlit Dashboard → Role Authentication: checks access
- Streamlit Dashboard → Profile Management: manages profiles
- Profile Management → Face Capture: captures face
- Streamlit Dashboard → Mode Selection: selects mode
- Streamlit Dashboard → Video Ingestion: starts feed
- Video Ingestion → Frame Analysis: supplies frames
- Frame Analysis → Face Recognition: analyzes faces
- Face Recognition → Recognition Adapter: requests matching
- Recognition Adapter → OpenCV Runtime: falls back to
- Recognition Adapter → DeepFace Runtime: uses when available
- Mode Selection → Attendance Logging: runs attendance
- Mode Selection → Victim Search: runs search
- Mode Selection → Threat Detection: runs detection
- Face Recognition → Unknown Tracking: tracks unknowns
- Streamlit Dashboard → Result Display: renders results
- Streamlit Dashboard → Audit and Event Logs: records events
- Monitoring Operator → Streamlit Dashboard: monitors
- Monitoring Operator → Result Display: views results
