# mickiie0/senior_project architecture

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

- Interactive diagram: https://gitdiagram.com/mickiie0/senior_project
- Repository: https://github.com/mickiie0/senior_project

## Overview

This repository presents a fire-and-smoke monitoring system with account registration/login and dashboard, event-history, statistics, and camera-management screens. The visible user flow routes through the React app, authenticates against a Go backend, then loads profile data for protected screens. Several monitoring screens are placeholders, and the README provides no further capability details. Backend implementation files are indexed as read but their contents are not excerpted, so internal backend relationships and storage are not asserted.

Main entry points: [`frontend/src/App.js`](https://github.com/mickiie0/senior_project/blob/main/frontend/src/App.js) (Route dispatcher), [`frontend/src/components/MainLayout.jsx`](https://github.com/mickiie0/senior_project/blob/main/frontend/src/components/MainLayout.jsx) (Authenticated layout), [`frontend/src/pages/Login.js`](https://github.com/mickiie0/senior_project/blob/main/frontend/src/pages/Login.js) (Login), [`frontend/src/pages/Register.js`](https://github.com/mickiie0/senior_project/blob/main/frontend/src/pages/Register.js) (Registration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend application"]
  node_app["Route dispatcher<br/>[App.js]"]
  node_login["Login<br/>[Login.js]"]
  node_register["Registration<br/>[Register.js]"]
  node_formstyles["Auth form styles<br/>[styles.js]"]
  node_dashboard["Dashboard<br/>[Dashboard.js]"]
  node_events["Event history<br/>[EventHistory.js]"]
  node_statistics["Statistics<br/>[Statistics.js]"]
  node_cameras["Camera management"]
  node_layout["Authenticated layout<br/>[MainLayout.jsx]"]
  node_vitals["Web vitals<br/>[reportWebVitals.js]"]
end

subgraph group_backend["Backend services"]
  node_server["HTTP server entry<br/>[main.go]"]
  node_authhandler["Auth handlers<br/>[handler.go]"]
  node_authservice["Auth service<br/>[service.go]"]
  node_authrepo["Auth repository<br/>[repository.go]"]
  node_authmodel["Auth model<br/>[model.go]"]
  node_jwt["JWT handling<br/>[jwt.go]"]
  node_middleware["Auth middleware<br/>[middleware.go]"]
  node_camera["Camera line<br/>[camera.go]"]
end

node_user(("User"))
node_api["Go HTTP API"]

node_user -->|"opens"| node_app
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_register
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_events
node_app -->|"routes to"| node_statistics
node_app -->|"routes to"| node_cameras
node_login -->|"posts login"| node_api
node_register -->|"posts registration"| node_api
node_dashboard -->|"fetches profile"| node_api
node_events -->|"fetches profile"| node_api
node_statistics -->|"fetches profile"| node_api
node_cameras -->|"fetches profile"| node_api
node_login -->|"uses"| node_formstyles
node_register -->|"uses"| node_formstyles
node_dashboard -->|"renders in"| node_layout
node_events -->|"renders in"| node_layout
node_statistics -->|"renders in"| node_layout
node_cameras -->|"renders in"| node_layout

click node_app "https://github.com/mickiie0/senior_project/blob/main/frontend/src/App.js"
click node_login "https://github.com/mickiie0/senior_project/blob/main/frontend/src/pages/Login.js"
click node_register "https://github.com/mickiie0/senior_project/blob/main/frontend/src/pages/Register.js"
click node_formstyles "https://github.com/mickiie0/senior_project/blob/main/frontend/src/pages/styles.js"
click node_dashboard "https://github.com/mickiie0/senior_project/blob/main/frontend/src/pages/Dashboard.js"
click node_events "https://github.com/mickiie0/senior_project/blob/main/frontend/src/pages/EventHistory.js"
click node_statistics "https://github.com/mickiie0/senior_project/blob/main/frontend/src/pages/Statistics.js"
click node_cameras "https://github.com/mickiie0/senior_project/blob/main/frontend/src/pages/CameraManagement.js"
click node_layout "https://github.com/mickiie0/senior_project/blob/main/frontend/src/components/MainLayout.jsx"
click node_vitals "https://github.com/mickiie0/senior_project/blob/main/frontend/src/reportWebVitals.js"
click node_server "https://github.com/mickiie0/senior_project/blob/main/backend/main.go"
click node_authhandler "https://github.com/mickiie0/senior_project/blob/main/backend/internal/auth/handler.go"
click node_authservice "https://github.com/mickiie0/senior_project/blob/main/backend/internal/auth/service.go"
click node_authrepo "https://github.com/mickiie0/senior_project/blob/main/backend/internal/auth/repository.go"
click node_authmodel "https://github.com/mickiie0/senior_project/blob/main/backend/internal/auth/model.go"
click node_jwt "https://github.com/mickiie0/senior_project/blob/main/backend/internal/auth/jwt.go"
click node_middleware "https://github.com/mickiie0/senior_project/blob/main/backend/internal/auth/middleware.go"
click node_camera "https://github.com/mickiie0/senior_project/blob/main/backend/camera_line/camera.go"

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_formstyles,node_dashboard,node_events,node_statistics,node_cameras,node_layout,node_vitals,node_user toneBlue
class node_server,node_authhandler,node_authservice,node_authrepo,node_authmodel,node_jwt,node_middleware,node_camera toneAmber
class node_api toneMint
```

## Components

### Frontend application

- [Route dispatcher](https://github.com/mickiie0/senior_project/blob/main/frontend/src/App.js): `frontend/src/App.js`
- [Login](https://github.com/mickiie0/senior_project/blob/main/frontend/src/pages/Login.js): `frontend/src/pages/Login.js`
- [Registration](https://github.com/mickiie0/senior_project/blob/main/frontend/src/pages/Register.js): `frontend/src/pages/Register.js`
- [Auth form styles](https://github.com/mickiie0/senior_project/blob/main/frontend/src/pages/styles.js): `frontend/src/pages/styles.js`
- [Dashboard](https://github.com/mickiie0/senior_project/blob/main/frontend/src/pages/Dashboard.js): `frontend/src/pages/Dashboard.js`
- [Event history](https://github.com/mickiie0/senior_project/blob/main/frontend/src/pages/EventHistory.js): `frontend/src/pages/EventHistory.js`
- [Statistics](https://github.com/mickiie0/senior_project/blob/main/frontend/src/pages/Statistics.js): `frontend/src/pages/Statistics.js`
- [Camera management](https://github.com/mickiie0/senior_project/blob/main/frontend/src/pages/CameraManagement.js): `frontend/src/pages/CameraManagement.js`
- [Authenticated layout](https://github.com/mickiie0/senior_project/blob/main/frontend/src/components/MainLayout.jsx): `frontend/src/components/MainLayout.jsx`
- [Web vitals](https://github.com/mickiie0/senior_project/blob/main/frontend/src/reportWebVitals.js): `frontend/src/reportWebVitals.js`

### Backend services

- [HTTP server entry](https://github.com/mickiie0/senior_project/blob/main/backend/main.go): `backend/main.go`
- [Auth handlers](https://github.com/mickiie0/senior_project/blob/main/backend/internal/auth/handler.go): `backend/internal/auth/handler.go`
- [Auth service](https://github.com/mickiie0/senior_project/blob/main/backend/internal/auth/service.go): `backend/internal/auth/service.go`
- [Auth repository](https://github.com/mickiie0/senior_project/blob/main/backend/internal/auth/repository.go): `backend/internal/auth/repository.go`
- [Auth model](https://github.com/mickiie0/senior_project/blob/main/backend/internal/auth/model.go): `backend/internal/auth/model.go`
- [JWT handling](https://github.com/mickiie0/senior_project/blob/main/backend/internal/auth/jwt.go): `backend/internal/auth/jwt.go`
- [Auth middleware](https://github.com/mickiie0/senior_project/blob/main/backend/internal/auth/middleware.go): `backend/internal/auth/middleware.go`
- [Camera line](https://github.com/mickiie0/senior_project/blob/main/backend/camera_line/camera.go): `backend/camera_line/camera.go`

### Other components

- **User**
- **Go HTTP API**

## Connections

- User → Route dispatcher: opens (evidence: `frontend/src/App.js`)
- Route dispatcher → Login: routes to (evidence: `frontend/src/App.js`)
- Route dispatcher → Registration: routes to (evidence: `frontend/src/App.js`)
- Route dispatcher → Dashboard: routes to (evidence: `frontend/src/App.js`)
- Route dispatcher → Event history: routes to (evidence: `frontend/src/App.js`)
- Route dispatcher → Statistics: routes to (evidence: `frontend/src/App.js`)
- Route dispatcher → Camera management: routes to (evidence: `frontend/src/App.js`)
- Login → Go HTTP API: posts login (evidence: `frontend/src/pages/Login.js`)
- Registration → Go HTTP API: posts registration (evidence: `frontend/src/pages/Register.js`)
- Dashboard → Go HTTP API: fetches profile (evidence: `frontend/src/pages/Dashboard.js`)
- Event history → Go HTTP API: fetches profile (evidence: `frontend/src/pages/EventHistory.js`)
- Statistics → Go HTTP API: fetches profile (evidence: `frontend/src/pages/Statistics.js`)
- Camera management → Go HTTP API: fetches profile (evidence: `frontend/src/pages/CameraManagement.js`)
- Login → Auth form styles: uses (evidence: `frontend/src/pages/Login.js`)
- Registration → Auth form styles: uses (evidence: `frontend/src/pages/Register.js`)
- Dashboard → Authenticated layout: renders in (evidence: `frontend/src/pages/Dashboard.js`)
- Event history → Authenticated layout: renders in (evidence: `frontend/src/pages/EventHistory.js`)
- Statistics → Authenticated layout: renders in (evidence: `frontend/src/pages/Statistics.js`)
- Camera management → Authenticated layout: renders in (evidence: `frontend/src/pages/CameraManagement.js`)
