# felipe-delf/operion architecture

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

- Interactive diagram: https://gitdiagram.com/felipe-delf/operion
- Repository: https://github.com/felipe-delf/operion

## Overview

Operion is a retail-network operations platform. Staff sign in, then use permission-gated screens to manage SQL scripts and audit rules, monitor stores, run single-store or broadcast executions, manage teams, and review execution logs. The FastAPI API handles these requests, with ODBC workers reaching the central database and store SQL Servers; local application records are persisted separately. The README documents these capabilities, while some implementation paths were not sampled, so unsourced connections are omitted.

Main entry points: [`app/core/database.py`](https://github.com/felipe-delf/operion/blob/main/app/core/database.py) (Local application database), [`frontend/src/App.jsx`](https://github.com/felipe-delf/operion/blob/main/frontend/src/App.jsx) (React application), [`app/api/routes.py`](https://github.com/felipe-delf/operion/blob/main/app/api/routes.py) (Scripts and execution API), [`app/api/auth.py`](https://github.com/felipe-delf/operion/blob/main/app/api/auth.py) (Authentication API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Staff interface"]
  node_web["React application<br/>[App.jsx]"]
  node_login["Login screen<br/>[Login.jsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.jsx]"]
  node_storemonitor["Store monitor<br/>[StoreMonitor.jsx]"]
  node_scriptsui["SQL vault<br/>[AdminScripts.jsx]"]
  node_auditui["Audit rules<br/>[AuditRules.jsx]"]
  node_broadcastui["Mass execution<br/>[MassExecution.jsx]"]
  node_teamui["Team management<br/>[Team.jsx]"]
  node_logsui["Execution logs<br/>[ExecutionLogs.jsx]"]
end

subgraph group_api["API and access"]
  node_authapi["Authentication API<br/>[auth.py]"]
  node_usersapi["Users API<br/>[users.py]"]
  node_routesapi["Scripts and execution API<br/>[routes.py]"]
  node_auditapi["Audit API<br/>[audit.py]"]
  node_agentapi["Agent and scan API<br/>[agent.py]"]
  node_security["JWT and passwords<br/>[security.py]"]
end

subgraph group_execution["Store operations"]
  node_worker["ODBC execution worker<br/>[worker.py]"]
  node_scanner["WMI scanner<br/>[wmi_scanner.py]"]
end

subgraph group_records["Application records"]
  node_localdb[("Local application database<br/>[database.py]")]
  node_scriptsmodel["Script records<br/>[script.py]"]
  node_usersmodel["Users and groups<br/>[user.py]"]
  node_groupsmodel["Group records<br/>[user_group.py]"]
  node_auditmodel["Audit records<br/>[audit.py]"]
  node_statusmodel["PC status snapshots<br/>[agent.py]"]
  node_executionmodel["Execution records<br/>[execution_log.py]"]
end

node_staff(("Operations staff"))
node_centraldb[("Retail central SQL")]
node_stores[("Store SQL Servers")]

node_staff -->|"uses"| node_web
node_web -->|"routes to"| node_login
node_web -->|"routes to"| node_dashboard
node_web -->|"routes to"| node_storemonitor
node_web -->|"routes to"| node_scriptsui
node_web -->|"routes to"| node_auditui
node_web -->|"routes to"| node_broadcastui
node_web -->|"routes to"| node_teamui
node_web -->|"routes to"| node_logsui
node_login -.->|"authenticates via"| node_authapi
node_dashboard -.->|"loads store data"| node_routesapi
node_storemonitor -.->|"requests status"| node_agentapi
node_scriptsui -.->|"manages scripts"| node_routesapi
node_auditui -.->|"manages rules"| node_auditapi
node_broadcastui -.->|"starts broadcast"| node_routesapi
node_teamui -.->|"manages team"| node_usersapi
node_logsui -.->|"requests history"| node_routesapi
node_authapi -->|"creates tokens"| node_security
node_authapi -->|"checks accounts"| node_usersmodel
node_authapi -->|"resolves permissions"| node_groupsmodel
node_authapi -->|"opens session"| node_localdb
node_usersapi -->|"opens session"| node_localdb
node_usersapi -->|"manages users"| node_usersmodel
node_usersapi -->|"manages groups"| node_groupsmodel
node_routesapi -->|"opens session"| node_localdb
node_routesapi -->|"reads scripts"| node_scriptsmodel
node_routesapi -->|"dispatches execution"| node_worker
node_routesapi -->|"records runs"| node_executionmodel
node_routesapi -->|"lists stores"| node_centraldb
node_auditapi -->|"opens session"| node_localdb
node_auditapi -->|"manages rules"| node_auditmodel
node_agentapi -->|"opens session"| node_localdb
node_agentapi -->|"requests scan"| node_scanner
node_agentapi -->|"uses worker"| node_worker
node_agentapi -->|"uses snapshots"| node_statusmodel
node_worker -->|"queries store data"| node_centraldb
node_worker -->|"executes SQL"| node_stores
node_worker -->|"updates run state"| node_executionmodel
node_localdb -.->|"persists"| node_scriptsmodel
node_localdb -.->|"persists"| node_usersmodel
node_localdb -.->|"persists"| node_groupsmodel
node_localdb -.->|"persists"| node_auditmodel
node_localdb -.->|"persists"| node_statusmodel
node_localdb -.->|"persists"| node_executionmodel

click node_web "https://github.com/felipe-delf/operion/blob/main/frontend/src/App.jsx"
click node_login "https://github.com/felipe-delf/operion/blob/main/frontend/src/components/Login.jsx"
click node_dashboard "https://github.com/felipe-delf/operion/blob/main/frontend/src/components/Dashboard.jsx"
click node_storemonitor "https://github.com/felipe-delf/operion/blob/main/frontend/src/components/StoreMonitor.jsx"
click node_scriptsui "https://github.com/felipe-delf/operion/blob/main/frontend/src/components/AdminScripts.jsx"
click node_auditui "https://github.com/felipe-delf/operion/blob/main/frontend/src/components/AuditRules.jsx"
click node_broadcastui "https://github.com/felipe-delf/operion/blob/main/frontend/src/components/MassExecution.jsx"
click node_teamui "https://github.com/felipe-delf/operion/blob/main/frontend/src/components/Team.jsx"
click node_logsui "https://github.com/felipe-delf/operion/blob/main/frontend/src/components/ExecutionLogs.jsx"
click node_authapi "https://github.com/felipe-delf/operion/blob/main/app/api/auth.py"
click node_usersapi "https://github.com/felipe-delf/operion/blob/main/app/api/users.py"
click node_routesapi "https://github.com/felipe-delf/operion/blob/main/app/api/routes.py"
click node_auditapi "https://github.com/felipe-delf/operion/blob/main/app/api/audit.py"
click node_agentapi "https://github.com/felipe-delf/operion/blob/main/app/api/agent.py"
click node_security "https://github.com/felipe-delf/operion/blob/main/app/core/security.py"
click node_worker "https://github.com/felipe-delf/operion/blob/main/app/services/worker.py"
click node_scanner "https://github.com/felipe-delf/operion/blob/main/app/services/wmi_scanner.py"
click node_localdb "https://github.com/felipe-delf/operion/blob/main/app/core/database.py"
click node_scriptsmodel "https://github.com/felipe-delf/operion/blob/main/app/models/script.py"
click node_usersmodel "https://github.com/felipe-delf/operion/blob/main/app/models/user.py"
click node_groupsmodel "https://github.com/felipe-delf/operion/blob/main/app/models/user_group.py"
click node_auditmodel "https://github.com/felipe-delf/operion/blob/main/app/models/audit.py"
click node_statusmodel "https://github.com/felipe-delf/operion/blob/main/app/models/agent.py"
click node_executionmodel "https://github.com/felipe-delf/operion/blob/main/app/models/execution_log.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_web,node_login,node_dashboard,node_storemonitor,node_scriptsui,node_auditui,node_broadcastui,node_teamui,node_logsui toneBlue
class node_authapi,node_usersapi,node_routesapi,node_auditapi,node_agentapi,node_security,node_centraldb,node_stores toneAmber
class node_worker,node_scanner toneMint
class node_localdb,node_scriptsmodel,node_usersmodel,node_groupsmodel,node_auditmodel,node_statusmodel,node_executionmodel toneRose
class node_staff toneIndigo
```

## Components

### Staff interface

- [React application](https://github.com/felipe-delf/operion/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Login screen](https://github.com/felipe-delf/operion/blob/main/frontend/src/components/Login.jsx): `frontend/src/components/Login.jsx`
- [Dashboard](https://github.com/felipe-delf/operion/blob/main/frontend/src/components/Dashboard.jsx): `frontend/src/components/Dashboard.jsx`
- [Store monitor](https://github.com/felipe-delf/operion/blob/main/frontend/src/components/StoreMonitor.jsx): `frontend/src/components/StoreMonitor.jsx`
- [SQL vault](https://github.com/felipe-delf/operion/blob/main/frontend/src/components/AdminScripts.jsx): `frontend/src/components/AdminScripts.jsx`
- [Audit rules](https://github.com/felipe-delf/operion/blob/main/frontend/src/components/AuditRules.jsx): `frontend/src/components/AuditRules.jsx`
- [Mass execution](https://github.com/felipe-delf/operion/blob/main/frontend/src/components/MassExecution.jsx): `frontend/src/components/MassExecution.jsx`
- [Team management](https://github.com/felipe-delf/operion/blob/main/frontend/src/components/Team.jsx): `frontend/src/components/Team.jsx`
- [Execution logs](https://github.com/felipe-delf/operion/blob/main/frontend/src/components/ExecutionLogs.jsx): `frontend/src/components/ExecutionLogs.jsx`

### API and access

- [Authentication API](https://github.com/felipe-delf/operion/blob/main/app/api/auth.py): `app/api/auth.py`
- [Users API](https://github.com/felipe-delf/operion/blob/main/app/api/users.py): `app/api/users.py`
- [Scripts and execution API](https://github.com/felipe-delf/operion/blob/main/app/api/routes.py): `app/api/routes.py`
- [Audit API](https://github.com/felipe-delf/operion/blob/main/app/api/audit.py): `app/api/audit.py`
- [Agent and scan API](https://github.com/felipe-delf/operion/blob/main/app/api/agent.py): `app/api/agent.py`
- [JWT and passwords](https://github.com/felipe-delf/operion/blob/main/app/core/security.py): `app/core/security.py`

### Store operations

- [ODBC execution worker](https://github.com/felipe-delf/operion/blob/main/app/services/worker.py): `app/services/worker.py`
- [WMI scanner](https://github.com/felipe-delf/operion/blob/main/app/services/wmi_scanner.py): `app/services/wmi_scanner.py`

### Application records

- [Local application database](https://github.com/felipe-delf/operion/blob/main/app/core/database.py): `app/core/database.py`
- [Script records](https://github.com/felipe-delf/operion/blob/main/app/models/script.py): `app/models/script.py`
- [Users and groups](https://github.com/felipe-delf/operion/blob/main/app/models/user.py): `app/models/user.py`
- [Group records](https://github.com/felipe-delf/operion/blob/main/app/models/user_group.py): `app/models/user_group.py`
- [Audit records](https://github.com/felipe-delf/operion/blob/main/app/models/audit.py): `app/models/audit.py`
- [PC status snapshots](https://github.com/felipe-delf/operion/blob/main/app/models/agent.py): `app/models/agent.py`
- [Execution records](https://github.com/felipe-delf/operion/blob/main/app/models/execution_log.py): `app/models/execution_log.py`

### Other components

- **Operations staff**
- **Retail central SQL**
- **Store SQL Servers**

## Connections

- Operations staff → React application: uses
- React application → Login screen: routes to (evidence: `frontend/src/App.jsx`)
- React application → Dashboard: routes to (evidence: `frontend/src/App.jsx`)
- React application → Store monitor: routes to (evidence: `frontend/src/App.jsx`)
- React application → SQL vault: routes to (evidence: `frontend/src/App.jsx`)
- React application → Audit rules: routes to (evidence: `frontend/src/App.jsx`)
- React application → Mass execution: routes to (evidence: `frontend/src/App.jsx`)
- React application → Team management: routes to (evidence: `frontend/src/App.jsx`)
- React application → Execution logs: routes to (evidence: `frontend/src/App.jsx`)
- Login screen → Authentication API: authenticates via
- Dashboard → Scripts and execution API: loads store data
- Store monitor → Agent and scan API: requests status
- SQL vault → Scripts and execution API: manages scripts
- Audit rules → Audit API: manages rules
- Mass execution → Scripts and execution API: starts broadcast
- Team management → Users API: manages team
- Execution logs → Scripts and execution API: requests history
- Authentication API → JWT and passwords: creates tokens (evidence: `app/api/auth.py`)
- Authentication API → Users and groups: checks accounts (evidence: `app/api/auth.py`)
- Authentication API → Group records: resolves permissions (evidence: `app/api/auth.py`)
- Authentication API → Local application database: opens session (evidence: `app/api/auth.py`)
- Users API → Local application database: opens session (evidence: `app/api/users.py`)
- Users API → Users and groups: manages users (evidence: `app/api/users.py`)
- Users API → Group records: manages groups (evidence: `app/api/users.py`)
- Scripts and execution API → Local application database: opens session (evidence: `app/api/routes.py`)
- Scripts and execution API → Script records: reads scripts (evidence: `app/api/routes.py`)
- Scripts and execution API → ODBC execution worker: dispatches execution (evidence: `app/api/routes.py`)
- Scripts and execution API → Execution records: records runs (evidence: `app/api/routes.py`)
- Scripts and execution API → Retail central SQL: lists stores (evidence: `app/api/routes.py`)
- Audit API → Local application database: opens session (evidence: `app/api/audit.py`)
- Audit API → Audit records: manages rules (evidence: `app/api/audit.py`)
- Agent and scan API → Local application database: opens session (evidence: `app/api/agent.py`)
- Agent and scan API → WMI scanner: requests scan (evidence: `app/api/agent.py`)
- Agent and scan API → ODBC execution worker: uses worker (evidence: `app/api/agent.py`)
- Agent and scan API → PC status snapshots: uses snapshots (evidence: `app/api/agent.py`)
- ODBC execution worker → Retail central SQL: queries store data (evidence: `app/services/worker.py`)
- ODBC execution worker → Store SQL Servers: executes SQL (evidence: `app/services/worker.py`)
- ODBC execution worker → Execution records: updates run state (evidence: `app/services/worker.py`)
- Local application database → Script records: persists
- Local application database → Users and groups: persists
- Local application database → Group records: persists
- Local application database → Audit records: persists (evidence: `app/models/audit.py`)
- Local application database → PC status snapshots: persists (evidence: `app/models/agent.py`)
- Local application database → Execution records: persists
