# 02paming/securetech_was architecture

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

- Interactive diagram: https://gitdiagram.com/02paming/securetech_was
- Repository: https://github.com/02paming/securetech_was

## Overview

SecureTech WAS is an internal-network access-control and security-monitoring product with a React console and Django API. The documented workflow runs from employee or administrator actions through the console and API to authentication, employee and policy management, and persisted logs; network monitoring and enforcement are described as a separate PCAP-side capability. The tree contains pcap_checker.py but no C engine or model implementation, so those internals are not expanded. Edges reflect shown routes, imports, calls, or README statements; unsampled feature wiring is omitted where uncertain.

Main entry points: [`api/models.py`](https://github.com/02paming/securetech_was/blob/main/api/models.py) (Security data models), [`config/urls.py`](https://github.com/02paming/securetech_was/blob/main/config/urls.py) (API routing), [`frontend/src/App.jsx`](https://github.com/02paming/securetech_was/blob/main/frontend/src/App.jsx) (Console routing), [`frontend/src/api.jsx`](https://github.com/02paming/securetech_was/blob/main/frontend/src/api.jsx) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_console["Web console"]
  node_app["Console routing<br/>[App.jsx]"]
  node_authui["Sign-in and captive auth"]
  node_home["Access home<br/>[Home.jsx]"]
  node_employeeui["Employee operations"]
  node_policyui["Policy and AI console"]
  node_client["API client<br/>[api.jsx]"]
end

subgraph group_api["API services"]
  node_api_routes["API routing<br/>[urls.py]"]
  node_auth["Authentication<br/>[auth_views.py]"]
  node_employee["Employee management<br/>[employee_views.py]"]
  node_policies["Policy management<br/>[policy_views.py]"]
  node_dashboard["Dashboard metrics<br/>[dashboard_views.py]"]
  node_logs["Threat and access logs<br/>[log_views.py]"]
  node_thresholds["AI thresholds history"]
  node_sync["Policy synchronization<br/>[utils.py]"]
end

subgraph group_security["Network security"]
  node_pcap["PCAP monitoring and enforcement<br/>[pcap_checker.py]"]
  node_watcher["MAC alert watcher"]
  node_alerts["Webhook alerts<br/>[alert_services.py]"]
end

subgraph group_state["Persistence and audit"]
  node_models[("Security data models<br/>[models.py]")]
  node_audit["Audit records<br/>[audit.py]"]
end

node_user(("Employees and admins"))

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_authui
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_employeeui
node_app -->|"routes to"| node_policyui
node_authui -->|"calls"| node_client
node_employeeui -->|"calls"| node_client
node_policyui -->|"calls"| node_client
node_client -->|"sends requests"| node_api_routes
node_api_routes -->|"routes to"| node_auth
node_api_routes -->|"routes to"| node_employee
node_api_routes -->|"routes to"| node_policies
node_api_routes -->|"routes to"| node_dashboard
node_api_routes -->|"routes to"| node_logs
node_auth -->|"reads and writes"| node_models
node_employee -->|"reads and writes"| node_models
node_policies -->|"reads and writes"| node_models
node_dashboard -->|"reads"| node_models
node_logs -->|"reads and writes"| node_models
node_auth -->|"records actions"| node_audit
node_employee -->|"records actions"| node_audit
node_policies -->|"records actions"| node_audit
node_logs -->|"records actions"| node_audit
node_sync -->|"reads policies"| node_models
node_sync -->|"sends policy sync"| node_pcap
node_pcap -->|"exchanges data"| node_models
node_watcher -->|"dispatches alerts"| node_alerts
node_alerts -.->|"notifies"| node_user
node_thresholds -.->|"tracks settings"| node_models

click node_app "https://github.com/02paming/securetech_was/blob/main/frontend/src/App.jsx"
click node_authui "https://github.com/02paming/securetech_was/tree/main/frontend/src/pages/auth"
click node_home "https://github.com/02paming/securetech_was/blob/main/frontend/src/pages/Home.jsx"
click node_employeeui "https://github.com/02paming/securetech_was/tree/main/frontend/src/pages/employee"
click node_policyui "https://github.com/02paming/securetech_was/tree/main/frontend/src/pages/policy"
click node_client "https://github.com/02paming/securetech_was/blob/main/frontend/src/api.jsx"
click node_api_routes "https://github.com/02paming/securetech_was/blob/main/config/urls.py"
click node_auth "https://github.com/02paming/securetech_was/blob/main/api/views/auth_views.py"
click node_employee "https://github.com/02paming/securetech_was/blob/main/api/views/employee_views.py"
click node_policies "https://github.com/02paming/securetech_was/blob/main/api/views/policy_views.py"
click node_dashboard "https://github.com/02paming/securetech_was/blob/main/api/views/dashboard_views.py"
click node_logs "https://github.com/02paming/securetech_was/blob/main/api/views/log_views.py"
click node_thresholds "https://github.com/02paming/securetech_was/blob/main/api/views/threshold_history.py"
click node_pcap "https://github.com/02paming/securetech_was/blob/main/pcap_checker.py"
click node_sync "https://github.com/02paming/securetech_was/blob/main/api/views/utils.py"
click node_watcher "https://github.com/02paming/securetech_was/blob/main/api/management/commands/watch_mac_alerts.py"
click node_alerts "https://github.com/02paming/securetech_was/blob/main/api/views/alert_services.py"
click node_models "https://github.com/02paming/securetech_was/blob/main/api/models.py"
click node_audit "https://github.com/02paming/securetech_was/blob/main/api/views/audit.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_authui,node_home,node_employeeui,node_policyui,node_client toneBlue
class node_api_routes,node_auth,node_employee,node_policies,node_dashboard,node_logs,node_thresholds,node_sync toneAmber
class node_pcap,node_watcher,node_alerts toneMint
class node_models,node_audit toneRose
class node_user toneIndigo
```

## Components

### Web console

- [Console routing](https://github.com/02paming/securetech_was/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Sign-in and captive auth](https://github.com/02paming/securetech_was/tree/main/frontend/src/pages/auth): `frontend/src/pages/auth`
- [Access home](https://github.com/02paming/securetech_was/blob/main/frontend/src/pages/Home.jsx): `frontend/src/pages/Home.jsx`
- [Employee operations](https://github.com/02paming/securetech_was/tree/main/frontend/src/pages/employee): `frontend/src/pages/employee`
- [Policy and AI console](https://github.com/02paming/securetech_was/tree/main/frontend/src/pages/policy): `frontend/src/pages/policy`
- [API client](https://github.com/02paming/securetech_was/blob/main/frontend/src/api.jsx): `frontend/src/api.jsx`

### API services

- [API routing](https://github.com/02paming/securetech_was/blob/main/config/urls.py): `config/urls.py`
- [Authentication](https://github.com/02paming/securetech_was/blob/main/api/views/auth_views.py): `api/views/auth_views.py`
- [Employee management](https://github.com/02paming/securetech_was/blob/main/api/views/employee_views.py): `api/views/employee_views.py`
- [Policy management](https://github.com/02paming/securetech_was/blob/main/api/views/policy_views.py): `api/views/policy_views.py`
- [Dashboard metrics](https://github.com/02paming/securetech_was/blob/main/api/views/dashboard_views.py): `api/views/dashboard_views.py`
- [Threat and access logs](https://github.com/02paming/securetech_was/blob/main/api/views/log_views.py): `api/views/log_views.py`
- [AI thresholds history](https://github.com/02paming/securetech_was/blob/main/api/views/threshold_history.py): `api/views/threshold_history.py`
- [Policy synchronization](https://github.com/02paming/securetech_was/blob/main/api/views/utils.py): `api/views/utils.py`

### Network security

- [PCAP monitoring and enforcement](https://github.com/02paming/securetech_was/blob/main/pcap_checker.py): `pcap_checker.py`
- [MAC alert watcher](https://github.com/02paming/securetech_was/blob/main/api/management/commands/watch_mac_alerts.py): `api/management/commands/watch_mac_alerts.py`
- [Webhook alerts](https://github.com/02paming/securetech_was/blob/main/api/views/alert_services.py): `api/views/alert_services.py`

### Persistence and audit

- [Security data models](https://github.com/02paming/securetech_was/blob/main/api/models.py): `api/models.py`
- [Audit records](https://github.com/02paming/securetech_was/blob/main/api/views/audit.py): `api/views/audit.py`

### Other components

- **Employees and admins**

## Connections

- Employees and admins → Console routing: uses (evidence: `README.md`)
- Console routing → Sign-in and captive auth: routes to (evidence: `frontend/src/App.jsx`)
- Console routing → Access home: routes to (evidence: `frontend/src/App.jsx`)
- Console routing → Employee operations: routes to (evidence: `frontend/src/App.jsx`)
- Console routing → Policy and AI console: routes to (evidence: `frontend/src/App.jsx`)
- Sign-in and captive auth → API client: calls (evidence: `frontend/src/pages/auth/CaptiveAuth.jsx`)
- Employee operations → API client: calls (evidence: `frontend/src/pages/employee/EmployeeManage.jsx`)
- Policy and AI console → API client: calls (evidence: `frontend/src/pages/policy/Dashboard.jsx`)
- API client → API routing: sends requests (evidence: `README.md`)
- API routing → Authentication: routes to (evidence: `config/urls.py`)
- API routing → Employee management: routes to (evidence: `config/urls.py`)
- API routing → Policy management: routes to (evidence: `config/urls.py`)
- API routing → Dashboard metrics: routes to (evidence: `config/urls.py`)
- API routing → Threat and access logs: routes to (evidence: `config/urls.py`)
- Authentication → Security data models: reads and writes (evidence: `api/views/auth_views.py`)
- Employee management → Security data models: reads and writes (evidence: `api/views/employee_views.py`)
- Policy management → Security data models: reads and writes (evidence: `api/views/policy_views.py`)
- Dashboard metrics → Security data models: reads (evidence: `api/views/dashboard_views.py`)
- Threat and access logs → Security data models: reads and writes (evidence: `api/views/log_views.py`)
- Authentication → Audit records: records actions (evidence: `api/views/auth_views.py`)
- Employee management → Audit records: records actions (evidence: `api/views/employee_views.py`)
- Policy management → Audit records: records actions (evidence: `api/views/policy_views.py`)
- Threat and access logs → Audit records: records actions (evidence: `api/views/log_views.py`)
- Policy synchronization → Security data models: reads policies (evidence: `api/views/utils.py`)
- Policy synchronization → PCAP monitoring and enforcement: sends policy sync (evidence: `api/views/utils.py`)
- PCAP monitoring and enforcement → Security data models: exchanges data (evidence: `pcap_checker.py`)
- MAC alert watcher → Webhook alerts: dispatches alerts (evidence: `api/management/commands/watch_mac_alerts.py`)
- Webhook alerts → Employees and admins: notifies (evidence: `api/views/alert_services.py`)
- AI thresholds history → Security data models: tracks settings
