# remimatteo/security-setup-automation architecture

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

- Interactive diagram: https://gitdiagram.com/remimatteo/security-setup-automation
- Repository: https://github.com/remimatteo/security-setup-automation

## Overview

Security Setup Automation is a Flask web app for turning a CUSIP or ticker into a reviewed security-master submission. The workflow runs from browser lookup through OpenFIGI matching, asset-class enrichment and editable review, then submission and SQLite audit logging. The registry, dashboard and CSV export expose stored submission history. The graph follows the sampled route and service calls; README-described UI and reporting capabilities are included, but their unsampled implementation links are not inferred beyond documented workflow.

Main entry points: [`app.py`](https://github.com/remimatteo/security-setup-automation/blob/main/app.py) (API routes), [`static/js/app.js`](https://github.com/remimatteo/security-setup-automation/blob/main/static/js/app.js) (Lookup and review UI), [`services/enrichment.py`](https://github.com/remimatteo/security-setup-automation/blob/main/services/enrichment.py) (Security enrichment), [`db/database.py`](https://github.com/remimatteo/security-setup-automation/blob/main/db/database.py) (Submission persistence)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web workflow"]
  node_webui["Lookup and review UI<br/>[app.js]"]
  node_page["Application page<br/>[index.html]"]
  node_flask["API routes<br/>[app.py]"]
end

subgraph group_lookup["Lookup and enrichment"]
  node_figi{{"OpenFIGI"}}
  node_lookupservice["Identifier lookup<br/>[cusip_lookup.py]"]
  node_enrichment["Security enrichment<br/>[enrichment.py]"]
  node_bondfields["Bond profile fields<br/>[enrichment.py]"]
  node_equityfields["Equity profile fields<br/>[enrichment.py]"]
end

subgraph group_submission["Submission and audit"]
  node_vendor["Security Master submission<br/>[vendor.py]"]
  node_database[("Submission persistence<br/>[database.py]")]
  node_sqlite[("SQLite database<br/>[config.py]")]
end

subgraph group_reporting["Registry and reporting"]
  node_registry["Searchable registry<br/>[app.js]"]
  node_dashboard["Dashboard statistics<br/>[app.js]"]
  node_csv["CSV export<br/>[app.py]"]
end

node_operator(("Operations user"))

node_operator -->|"uses"| node_webui
node_webui -->|"calls lookup API"| node_flask
node_flask -->|"dispatches lookup"| node_lookupservice
node_lookupservice -->|"queries"| node_figi
node_flask -->|"enriches result"| node_enrichment
node_enrichment -->|"builds bond fields"| node_bondfields
node_enrichment -->|"builds equity fields"| node_equityfields
node_flask -->|"submits security"| node_vendor
node_flask -->|"saves submission"| node_database
node_database -->|"reads and writes"| node_sqlite
node_webui -->|"loads history"| node_registry
node_registry -->|"requests submissions"| node_flask
node_webui -->|"loads stats"| node_dashboard
node_dashboard -->|"requests statistics"| node_flask
node_flask -->|"queries history"| node_database
node_flask -->|"exports CSV"| node_csv
node_operator -->|"opens app"| node_page
node_page -.->|"presents workflow"| node_webui

click node_webui "https://github.com/remimatteo/security-setup-automation/blob/main/static/js/app.js"
click node_page "https://github.com/remimatteo/security-setup-automation/blob/main/templates/index.html"
click node_flask "https://github.com/remimatteo/security-setup-automation/blob/main/app.py"
click node_lookupservice "https://github.com/remimatteo/security-setup-automation/blob/main/services/cusip_lookup.py"
click node_enrichment "https://github.com/remimatteo/security-setup-automation/blob/main/services/enrichment.py"
click node_bondfields "https://github.com/remimatteo/security-setup-automation/blob/main/services/enrichment.py"
click node_equityfields "https://github.com/remimatteo/security-setup-automation/blob/main/services/enrichment.py"
click node_vendor "https://github.com/remimatteo/security-setup-automation/blob/main/services/vendor.py"
click node_database "https://github.com/remimatteo/security-setup-automation/blob/main/db/database.py"
click node_sqlite "https://github.com/remimatteo/security-setup-automation/blob/main/config.py"
click node_registry "https://github.com/remimatteo/security-setup-automation/blob/main/static/js/app.js"
click node_dashboard "https://github.com/remimatteo/security-setup-automation/blob/main/static/js/app.js"
click node_csv "https://github.com/remimatteo/security-setup-automation/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_webui,node_page,node_flask,node_operator toneBlue
class node_figi,node_lookupservice,node_enrichment,node_bondfields,node_equityfields toneAmber
class node_vendor,node_database,node_sqlite toneMint
class node_registry,node_dashboard,node_csv toneRose
```

## Components

### Web workflow

- [Lookup and review UI](https://github.com/remimatteo/security-setup-automation/blob/main/static/js/app.js): `static/js/app.js`
- [Application page](https://github.com/remimatteo/security-setup-automation/blob/main/templates/index.html): `templates/index.html`
- [API routes](https://github.com/remimatteo/security-setup-automation/blob/main/app.py): `app.py`

### Lookup and enrichment

- **OpenFIGI**
- [Identifier lookup](https://github.com/remimatteo/security-setup-automation/blob/main/services/cusip_lookup.py): `services/cusip_lookup.py`
- [Security enrichment](https://github.com/remimatteo/security-setup-automation/blob/main/services/enrichment.py): `services/enrichment.py`
- [Bond profile fields](https://github.com/remimatteo/security-setup-automation/blob/main/services/enrichment.py): `services/enrichment.py`
- [Equity profile fields](https://github.com/remimatteo/security-setup-automation/blob/main/services/enrichment.py): `services/enrichment.py`

### Submission and audit

- [Security Master submission](https://github.com/remimatteo/security-setup-automation/blob/main/services/vendor.py): `services/vendor.py`
- [Submission persistence](https://github.com/remimatteo/security-setup-automation/blob/main/db/database.py): `db/database.py`
- [SQLite database](https://github.com/remimatteo/security-setup-automation/blob/main/config.py): `config.py`

### Registry and reporting

- [Searchable registry](https://github.com/remimatteo/security-setup-automation/blob/main/static/js/app.js): `static/js/app.js`
- [Dashboard statistics](https://github.com/remimatteo/security-setup-automation/blob/main/static/js/app.js): `static/js/app.js`
- [CSV export](https://github.com/remimatteo/security-setup-automation/blob/main/app.py): `app.py`

### Other components

- **Operations user**

## Connections

- Operations user → Lookup and review UI: uses (evidence: `README.md`)
- Lookup and review UI → API routes: calls lookup API (evidence: `static/js/app.js`)
- API routes → Identifier lookup: dispatches lookup (evidence: `app.py`)
- Identifier lookup → OpenFIGI: queries (evidence: `services/cusip_lookup.py`)
- API routes → Security enrichment: enriches result (evidence: `app.py`)
- Security enrichment → Bond profile fields: builds bond fields (evidence: `services/enrichment.py`)
- Security enrichment → Equity profile fields: builds equity fields (evidence: `services/enrichment.py`)
- API routes → Security Master submission: submits security (evidence: `app.py`)
- API routes → Submission persistence: saves submission (evidence: `app.py`)
- Submission persistence → SQLite database: reads and writes (evidence: `db/database.py`)
- Lookup and review UI → Searchable registry: loads history (evidence: `static/js/app.js`)
- Searchable registry → API routes: requests submissions (evidence: `static/js/app.js`)
- Lookup and review UI → Dashboard statistics: loads stats (evidence: `static/js/app.js`)
- Dashboard statistics → API routes: requests statistics (evidence: `static/js/app.js`)
- API routes → Submission persistence: queries history (evidence: `app.py`)
- API routes → CSV export: exports CSV (evidence: `app.py`)
- Operations user → Application page: opens app (evidence: `README.md`)
- Application page → Lookup and review UI: presents workflow
