# harishduda/esb_audit_portal architecture

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

- Interactive diagram: https://gitdiagram.com/harishduda/esb_audit_portal
- Repository: https://github.com/harishduda/esb_audit_portal

## Overview

ESB Audit Portal is a Flask support application for searching ESB records by RRN across configured Oracle environments. Operators use the browser UI to choose an environment and time range; the request is validated, queries retrieve service audit rows and detail-log payloads, and the UI presents summaries, error details, and a timeline. The README documents these capabilities, while the sampled source shows the route-to-service and database call paths. The template and configuration wiring are documented, but their source was not sampled.

Main entry points: [`services/audit_service.py`](https://github.com/harishduda/esb_audit_portal/blob/master/services/audit_service.py) (Validate and assemble), [`db/oracle.py`](https://github.com/harishduda/esb_audit_portal/blob/master/db/oracle.py) (Oracle connection and fetch), [`static/js/app.js`](https://github.com/harishduda/esb_audit_portal/blob/master/static/js/app.js) (Search and results UI), [`routes/audit_routes.py`](https://github.com/harishduda/esb_audit_portal/blob/master/routes/audit_routes.py) (Search endpoint)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_presentation["Operator interface"]
  node_browser["Search and results UI<br/>[app.js]"]
  node_search_page["Search page<br/>[index.html]"]
end

subgraph group_api["Search API"]
  node_flask_app["Flask app<br/>[app.py]"]
  node_search_route["Search endpoint<br/>[audit_routes.py]"]
end

subgraph group_audit["Audit retrieval"]
  node_audit_service["Validate and assemble<br/>[audit_service.py]"]
  node_environment_config["Environment settings<br/>[config.py]"]
  node_service_records["Service audit records"]
  node_timeline_records["Audit timeline entries"]
end

subgraph group_oracle["Oracle access"]
  node_query_definitions["ACE and DTL SQL<br/>[queries.py]"]
  node_oracle_access["Oracle connection and fetch<br/>[oracle.py]"]
end

node_operator(("Support operator"))
node_oracle_db[("Oracle database")]

node_operator -.->|"opens"| node_search_page
node_search_page -.->|"loads"| node_browser
node_browser -->|"posts search"| node_search_route
node_flask_app -->|"registers"| node_search_route
node_flask_app -->|"renders"| node_search_page
node_search_route -->|"calls search"| node_audit_service
node_audit_service -->|"loads settings"| node_environment_config
node_audit_service -->|"selects queries"| node_query_definitions
node_audit_service -->|"connects and fetches"| node_oracle_access
node_oracle_access -->|"uses connection settings"| node_environment_config
node_oracle_access -->|"executes queries"| node_oracle_db
node_oracle_access -->|"returns rows"| node_service_records
node_oracle_access -->|"returns rows"| node_timeline_records
node_audit_service -->|"returns response data"| node_search_route
node_search_route -.->|"returns JSON"| node_browser
node_browser -->|"renders services and errors"| node_service_records
node_browser -->|"renders payload timeline"| node_timeline_records

click node_browser "https://github.com/harishduda/esb_audit_portal/blob/master/static/js/app.js"
click node_search_page "https://github.com/harishduda/esb_audit_portal/blob/master/templates/index.html"
click node_flask_app "https://github.com/harishduda/esb_audit_portal/blob/master/app.py"
click node_search_route "https://github.com/harishduda/esb_audit_portal/blob/master/routes/audit_routes.py"
click node_audit_service "https://github.com/harishduda/esb_audit_portal/blob/master/services/audit_service.py"
click node_environment_config "https://github.com/harishduda/esb_audit_portal/blob/master/config.py"
click node_query_definitions "https://github.com/harishduda/esb_audit_portal/blob/master/db/queries.py"
click node_oracle_access "https://github.com/harishduda/esb_audit_portal/blob/master/db/oracle.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_browser,node_search_page toneBlue
class node_flask_app,node_search_route,node_oracle_db toneAmber
class node_audit_service,node_environment_config,node_service_records,node_timeline_records toneMint
class node_query_definitions,node_oracle_access toneRose
class node_operator toneIndigo
```

## Components

### Operator interface

- [Search and results UI](https://github.com/harishduda/esb_audit_portal/blob/master/static/js/app.js): `static/js/app.js`
- [Search page](https://github.com/harishduda/esb_audit_portal/blob/master/templates/index.html): `templates/index.html`

### Search API

- [Flask app](https://github.com/harishduda/esb_audit_portal/blob/master/app.py): `app.py`
- [Search endpoint](https://github.com/harishduda/esb_audit_portal/blob/master/routes/audit_routes.py): `routes/audit_routes.py`

### Audit retrieval

- [Validate and assemble](https://github.com/harishduda/esb_audit_portal/blob/master/services/audit_service.py): `services/audit_service.py`
- [Environment settings](https://github.com/harishduda/esb_audit_portal/blob/master/config.py): `config.py`
- **Service audit records**
- **Audit timeline entries**

### Oracle access

- [ACE and DTL SQL](https://github.com/harishduda/esb_audit_portal/blob/master/db/queries.py): `db/queries.py`
- [Oracle connection and fetch](https://github.com/harishduda/esb_audit_portal/blob/master/db/oracle.py): `db/oracle.py`

### Other components

- **Support operator**
- **Oracle database**

## Connections

- Support operator → Search page: opens (evidence: `README.md`)
- Search page → Search and results UI: loads (evidence: `README.md`)
- Search and results UI → Search endpoint: posts search (evidence: `static/js/app.js`)
- Flask app → Search endpoint: registers (evidence: `app.py`)
- Flask app → Search page: renders (evidence: `app.py`)
- Search endpoint → Validate and assemble: calls search (evidence: `routes/audit_routes.py`)
- Validate and assemble → Environment settings: loads settings (evidence: `services/audit_service.py`)
- Validate and assemble → ACE and DTL SQL: selects queries (evidence: `services/audit_service.py`)
- Validate and assemble → Oracle connection and fetch: connects and fetches (evidence: `services/audit_service.py`)
- Oracle connection and fetch → Environment settings: uses connection settings (evidence: `db/oracle.py`)
- Oracle connection and fetch → Oracle database: executes queries (evidence: `db/oracle.py`)
- Oracle connection and fetch → Service audit records: returns rows
- Oracle connection and fetch → Audit timeline entries: returns rows
- Validate and assemble → Search endpoint: returns response data (evidence: `routes/audit_routes.py`)
- Search endpoint → Search and results UI: returns JSON (evidence: `README.md`)
- Search and results UI → Service audit records: renders services and errors (evidence: `static/js/app.js`)
- Search and results UI → Audit timeline entries: renders payload timeline (evidence: `static/js/app.js`)
