# divinegupta0611/hawkshield-frontend architecture

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

- Interactive diagram: https://gitdiagram.com/divinegupta0611/hawkshield-frontend
- Repository: https://github.com/divinegupta0611/hawkshield-frontend

## Overview

HawkShield is a React frontend for surveillance and threat monitoring. Users enter through the routed web app, authenticate, then use camera streaming, a multi-camera dashboard, or local-camera threat detection. The sampled code shows Supabase-backed camera/auth operations and WebSocket/WebRTC streaming; the detection screen excerpt shows camera capture and displayed results, but not a verified model-service connection. Several page implementations were not sampled, so their internal behavior is not inferred.

Main entry points: [`src/App.jsx`](https://github.com/divinegupta0611/hawkshield-frontend/blob/main/src/App.jsx) (Route Application), [`src/SupabaseClient.js`](https://github.com/divinegupta0611/hawkshield-frontend/blob/main/src/SupabaseClient.js) (Supabase Client), [`src/pages/Stream.jsx`](https://github.com/divinegupta0611/hawkshield-frontend/blob/main/src/pages/Stream.jsx) (Camera Streaming), [`src/pages/Dashboard.jsx`](https://github.com/divinegupta0611/hawkshield-frontend/blob/main/src/pages/Dashboard.jsx) (Camera Dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Web Application"]
  node_app["Route Application<br/>[App.jsx]"]
  node_home["Home Page<br/>[Home.jsx]"]
  node_navbar["Navigation<br/>[NavBar.jsx]"]
end

subgraph group_identity["Identity"]
  node_login["Login<br/>[Login.jsx]"]
  node_signup["Signup<br/>[Signup.jsx]"]
  node_forgot["Password Recovery<br/>[ForgotPassword.jsx]"]
  node_reset["Password Reset<br/>[ResetPassword.jsx]"]
  node_callback["Auth Callback<br/>[AuthCallback.jsx]"]
  node_authsuccess["Auth Success<br/>[AuthSuccess.jsx]"]
  node_supabase["Supabase Client<br/>[SupabaseClient.js]"]
end

subgraph group_monitoring["Camera Monitoring"]
  node_dashboard["Camera Dashboard<br/>[Dashboard.jsx]"]
  node_detect["Local Detection<br/>[Detect.jsx]"]
  node_stream["Camera Streaming<br/>[Stream.jsx]"]
end

subgraph group_support["Product Information"]
  node_about["About Page<br/>[About.jsx]"]
  node_contact["Contact Page<br/>[Contact.jsx]"]
end

node_user(("User"))
node_supabase_service[("Supabase")]
node_camera(("Camera Device"))
node_stream_service["Streaming Endpoint"]

node_user -->|"opens"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_about
node_app -->|"routes to"| node_contact
node_app -->|"routes to"| node_signup
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_detect
node_app -->|"routes to"| node_forgot
node_app -->|"routes to"| node_reset
node_app -->|"routes to"| node_callback
node_app -->|"routes to"| node_authsuccess
node_app -->|"routes to"| node_stream
node_navbar -->|"signs out via"| node_supabase
node_supabase -.->|"connects to"| node_supabase_service
node_callback -->|"sets session"| node_supabase
node_authsuccess -->|"fetches user"| node_supabase
node_authsuccess -->|"stores login"| node_user
node_dashboard -->|"renders"| node_navbar
node_dashboard -->|"queries cameras"| node_supabase
node_dashboard -->|"opens WebSocket"| node_stream_service
node_detect -->|"renders"| node_navbar
node_detect -->|"captures video"| node_camera
node_stream -->|"renders"| node_navbar
node_stream -->|"captures video"| node_camera
node_stream -->|"manages camera"| node_supabase
node_stream -->|"sends frames"| node_stream_service

click node_app "https://github.com/divinegupta0611/hawkshield-frontend/blob/main/src/App.jsx"
click node_home "https://github.com/divinegupta0611/hawkshield-frontend/blob/main/src/pages/Home.jsx"
click node_navbar "https://github.com/divinegupta0611/hawkshield-frontend/blob/main/src/components/NavBar.jsx"
click node_login "https://github.com/divinegupta0611/hawkshield-frontend/blob/main/src/pages/Login.jsx"
click node_signup "https://github.com/divinegupta0611/hawkshield-frontend/blob/main/src/pages/Signup.jsx"
click node_forgot "https://github.com/divinegupta0611/hawkshield-frontend/blob/main/src/pages/ForgotPassword.jsx"
click node_reset "https://github.com/divinegupta0611/hawkshield-frontend/blob/main/src/pages/ResetPassword.jsx"
click node_callback "https://github.com/divinegupta0611/hawkshield-frontend/blob/main/src/pages/AuthCallback.jsx"
click node_authsuccess "https://github.com/divinegupta0611/hawkshield-frontend/blob/main/src/pages/AuthSuccess.jsx"
click node_supabase "https://github.com/divinegupta0611/hawkshield-frontend/blob/main/src/SupabaseClient.js"
click node_dashboard "https://github.com/divinegupta0611/hawkshield-frontend/blob/main/src/pages/Dashboard.jsx"
click node_detect "https://github.com/divinegupta0611/hawkshield-frontend/blob/main/src/pages/Detect.jsx"
click node_stream "https://github.com/divinegupta0611/hawkshield-frontend/blob/main/src/pages/Stream.jsx"
click node_about "https://github.com/divinegupta0611/hawkshield-frontend/blob/main/src/pages/About.jsx"
click node_contact "https://github.com/divinegupta0611/hawkshield-frontend/blob/main/src/pages/Contact.jsx"

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_home,node_navbar,node_user toneBlue
class node_login,node_signup,node_forgot,node_reset,node_callback,node_authsuccess,node_supabase,node_supabase_service toneAmber
class node_dashboard,node_detect,node_stream toneMint
class node_about,node_contact toneRose
class node_camera,node_stream_service toneIndigo
```

## Components

### Web Application

- [Route Application](https://github.com/divinegupta0611/hawkshield-frontend/blob/main/src/App.jsx): `src/App.jsx`
- [Home Page](https://github.com/divinegupta0611/hawkshield-frontend/blob/main/src/pages/Home.jsx): `src/pages/Home.jsx`
- [Navigation](https://github.com/divinegupta0611/hawkshield-frontend/blob/main/src/components/NavBar.jsx): `src/components/NavBar.jsx`

### Identity

- [Login](https://github.com/divinegupta0611/hawkshield-frontend/blob/main/src/pages/Login.jsx): `src/pages/Login.jsx`
- [Signup](https://github.com/divinegupta0611/hawkshield-frontend/blob/main/src/pages/Signup.jsx): `src/pages/Signup.jsx`
- [Password Recovery](https://github.com/divinegupta0611/hawkshield-frontend/blob/main/src/pages/ForgotPassword.jsx): `src/pages/ForgotPassword.jsx`
- [Password Reset](https://github.com/divinegupta0611/hawkshield-frontend/blob/main/src/pages/ResetPassword.jsx): `src/pages/ResetPassword.jsx`
- [Auth Callback](https://github.com/divinegupta0611/hawkshield-frontend/blob/main/src/pages/AuthCallback.jsx): `src/pages/AuthCallback.jsx`
- [Auth Success](https://github.com/divinegupta0611/hawkshield-frontend/blob/main/src/pages/AuthSuccess.jsx): `src/pages/AuthSuccess.jsx`
- [Supabase Client](https://github.com/divinegupta0611/hawkshield-frontend/blob/main/src/SupabaseClient.js): `src/SupabaseClient.js`

### Camera Monitoring

- [Camera Dashboard](https://github.com/divinegupta0611/hawkshield-frontend/blob/main/src/pages/Dashboard.jsx): `src/pages/Dashboard.jsx`
- [Local Detection](https://github.com/divinegupta0611/hawkshield-frontend/blob/main/src/pages/Detect.jsx): `src/pages/Detect.jsx`
- [Camera Streaming](https://github.com/divinegupta0611/hawkshield-frontend/blob/main/src/pages/Stream.jsx): `src/pages/Stream.jsx`

### Product Information

- [About Page](https://github.com/divinegupta0611/hawkshield-frontend/blob/main/src/pages/About.jsx): `src/pages/About.jsx`
- [Contact Page](https://github.com/divinegupta0611/hawkshield-frontend/blob/main/src/pages/Contact.jsx): `src/pages/Contact.jsx`

### Other components

- **User**
- **Supabase**
- **Camera Device**
- **Streaming Endpoint**

## Connections

- User → Route Application: opens
- Route Application → Home Page: routes to (evidence: `src/App.jsx`)
- Route Application → About Page: routes to (evidence: `src/App.jsx`)
- Route Application → Contact Page: routes to (evidence: `src/App.jsx`)
- Route Application → Signup: routes to (evidence: `src/App.jsx`)
- Route Application → Login: routes to (evidence: `src/App.jsx`)
- Route Application → Camera Dashboard: routes to (evidence: `src/App.jsx`)
- Route Application → Local Detection: routes to (evidence: `src/App.jsx`)
- Route Application → Password Recovery: routes to (evidence: `src/App.jsx`)
- Route Application → Password Reset: routes to (evidence: `src/App.jsx`)
- Route Application → Auth Callback: routes to (evidence: `src/App.jsx`)
- Route Application → Auth Success: routes to (evidence: `src/App.jsx`)
- Route Application → Camera Streaming: routes to (evidence: `src/App.jsx`)
- Navigation → Supabase Client: signs out via (evidence: `src/components/NavBar.jsx`)
- Supabase Client → Supabase: connects to
- Auth Callback → Supabase Client: sets session (evidence: `src/pages/AuthCallback.jsx`)
- Auth Success → Supabase Client: fetches user (evidence: `src/pages/AuthSuccess.jsx`)
- Auth Success → User: stores login (evidence: `src/pages/AuthSuccess.jsx`)
- Camera Dashboard → Navigation: renders (evidence: `src/pages/Dashboard.jsx`)
- Camera Dashboard → Supabase Client: queries cameras (evidence: `src/pages/Dashboard.jsx`)
- Camera Dashboard → Streaming Endpoint: opens WebSocket (evidence: `src/pages/Dashboard.jsx`)
- Local Detection → Navigation: renders (evidence: `src/pages/Detect.jsx`)
- Local Detection → Camera Device: captures video (evidence: `src/pages/Detect.jsx`)
- Camera Streaming → Navigation: renders (evidence: `src/pages/Stream.jsx`)
- Camera Streaming → Camera Device: captures video (evidence: `src/pages/Stream.jsx`)
- Camera Streaming → Supabase Client: manages camera (evidence: `src/pages/Stream.jsx`)
- Camera Streaming → Streaming Endpoint: sends frames (evidence: `src/pages/Stream.jsx`)
