# arvindkumar-ship-it/dumpydox architecture

> Architecture diagram of the GitHub repository arvindkumar-ship-it/dumpydox, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/arvindkumar-ship-it/dumpydox
- Repository: https://github.com/arvindkumar-ship-it/dumpydox

## Overview

PS-08 combines insider-behavior analytics with API/agent-abuse defenses and a security console. The primary workflow accepts an event, normalizes and publishes it through an outbox, relays it to a stream consumer, scores behavior, and publishes high-risk alerts for dashboard review. Separate paths support session revocation, request-abuse checks, and websocket access. The README documents graph/isolation-forest/ensemble detection and autonomous responses; the tree supports only some of those implementations, so unsampled subsystems are represented at their existing directory paths without speculative wiring.

Main entry points: [`apps/api/app/main.py`](https://github.com/arvindkumar-ship-it/dumpydox/blob/main/apps/api/app/main.py) (FastAPI application), [`apps/api/app/streaming/handlers.py`](https://github.com/arvindkumar-ship-it/dumpydox/blob/main/apps/api/app/streaming/handlers.py) (Event handler), [`frontend/frontend/src/main.jsx`](https://github.com/arvindkumar-ship-it/dumpydox/blob/main/frontend/frontend/src/main.jsx) (Security console), [`apps/api/app/response/session_revoke.py`](https://github.com/arvindkumar-ship-it/dumpydox/blob/main/apps/api/app/response/session_revoke.py) (Session revocation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and Console"]
  node_frontend["Security console<br/>[main.jsx]"]
  node_app["FastAPI application<br/>[main.py]"]
  node_event_api["Event endpoint<br/>[events.py]"]
  node_dashboard_api["Dashboard endpoint<br/>[dashboard.py]"]
  node_response_api["Response endpoint<br/>[response.py]"]
  node_ws_api["Websocket endpoint<br/>[ws.py]"]
end

subgraph group_events["Event Ingestion"]
  node_ingestion["Ingestion service<br/>[service.py]"]
  node_normalizer["Event normalizer<br/>[normalizer.py]"]
  node_publisher["Outbox publisher<br/>[publisher.py]"]
  node_relay["Outbox relay<br/>[outbox_relay.py]"]
  node_consumer["Stream consumer<br/>[consumer.py]"]
  node_models["Persistence models<br/>[models.py]"]
end

subgraph group_detection["Detection"]
  node_handler["Event handler<br/>[handlers.py]"]
  node_graph["Behavior graph<br/>[graph_store.py]"]
  node_baseline["Baseline scorer<br/>[baseline.py]"]
  node_rate_window["Rate window<br/>[rate_window.py]"]
  node_isolation["Isolation forest job"]
end

subgraph group_security["Security and Response"]
  node_alert_bus["Alert bus<br/>[alert_bus.py]"]
  node_abuse_middleware["Abuse middleware<br/>[api_abuse_check.py]"]
  node_abuse_detector["Abuse detectors<br/>[api_abuse.py]"]
  node_revocation_middleware["Revocation middleware"]
  node_revoke_adapter["Session revocation<br/>[session_revoke.py]"]
  node_ws_auth["Websocket tickets<br/>[ws_auth.py]"]
end

node_user(("Security operator"))
node_producer(("Event producer"))
node_postgres[("PostgreSQL")]
node_redis[("Redis")]

node_user -->|"uses console"| node_frontend
node_producer -->|"submits events"| node_event_api
node_frontend -->|"submits events"| node_event_api
node_frontend -->|"fetches alerts"| node_dashboard_api
node_frontend -->|"requests revocation"| node_response_api
node_app -->|"mounts route"| node_event_api
node_app -->|"mounts route"| node_dashboard_api
node_app -->|"mounts route"| node_response_api
node_app -->|"mounts route"| node_ws_api
node_app -->|"runs checks"| node_abuse_middleware
node_app -->|"runs checks"| node_revocation_middleware
node_event_api -->|"ingests event"| node_ingestion
node_ingestion -->|"normalizes event"| node_normalizer
node_ingestion -->|"publishes outbox"| node_publisher
node_publisher -->|"writes outbox"| node_postgres
node_relay -->|"reads outbox"| node_postgres
node_relay -->|"publishes stream"| node_redis
node_consumer -->|"reads stream"| node_redis
node_consumer -->|"dispatches event"| node_handler
node_handler -->|"records access"| node_graph
node_graph -->|"reads and writes"| node_postgres
node_handler -->|"counts activity"| node_rate_window
node_rate_window -->|"updates window"| node_redis
node_handler -->|"scores behavior"| node_baseline
node_handler -->|"publishes alert"| node_alert_bus
node_alert_bus -->|"publishes alerts"| node_redis
node_dashboard_api -->|"reads alerts"| node_postgres
node_abuse_middleware -->|"checks requests"| node_abuse_detector
node_abuse_detector -->|"tracks signals"| node_redis
node_revocation_middleware -->|"checks sessions"| node_revoke_adapter
node_response_api -->|"revokes session"| node_revoke_adapter
node_revoke_adapter -->|"checks and sets revocation"| node_redis
node_revoke_adapter -->|"records revocation"| node_postgres
node_ws_api -->|"validates ticket"| node_ws_auth
node_ws_auth -->|"stores tickets"| node_redis
node_handler -.->|"complements scoring"| node_isolation

click node_frontend "https://github.com/arvindkumar-ship-it/dumpydox/blob/main/frontend/frontend/src/main.jsx"
click node_app "https://github.com/arvindkumar-ship-it/dumpydox/blob/main/apps/api/app/main.py"
click node_event_api "https://github.com/arvindkumar-ship-it/dumpydox/blob/main/apps/api/app/api/v1/events.py"
click node_dashboard_api "https://github.com/arvindkumar-ship-it/dumpydox/blob/main/apps/api/app/api/v1/dashboard.py"
click node_response_api "https://github.com/arvindkumar-ship-it/dumpydox/blob/main/apps/api/app/api/v1/response.py"
click node_ws_api "https://github.com/arvindkumar-ship-it/dumpydox/blob/main/apps/api/app/api/v1/ws.py"
click node_ingestion "https://github.com/arvindkumar-ship-it/dumpydox/blob/main/apps/api/app/ingestion/service.py"
click node_normalizer "https://github.com/arvindkumar-ship-it/dumpydox/blob/main/apps/api/app/ingestion/normalizer.py"
click node_publisher "https://github.com/arvindkumar-ship-it/dumpydox/blob/main/apps/api/app/ingestion/publisher.py"
click node_relay "https://github.com/arvindkumar-ship-it/dumpydox/blob/main/apps/api/app/streaming/outbox_relay.py"
click node_consumer "https://github.com/arvindkumar-ship-it/dumpydox/blob/main/apps/api/app/streaming/consumer.py"
click node_handler "https://github.com/arvindkumar-ship-it/dumpydox/blob/main/apps/api/app/streaming/handlers.py"
click node_graph "https://github.com/arvindkumar-ship-it/dumpydox/blob/main/apps/api/app/insider/graph_store.py"
click node_baseline "https://github.com/arvindkumar-ship-it/dumpydox/blob/main/apps/api/app/insider/baseline.py"
click node_rate_window "https://github.com/arvindkumar-ship-it/dumpydox/blob/main/apps/api/app/insider/rate_window.py"
click node_isolation "https://github.com/arvindkumar-ship-it/dumpydox/blob/main/apps/api/app/insider/isolation_forest_job.py"
click node_alert_bus "https://github.com/arvindkumar-ship-it/dumpydox/blob/main/apps/api/app/streaming/alert_bus.py"
click node_abuse_middleware "https://github.com/arvindkumar-ship-it/dumpydox/blob/main/apps/api/app/middleware/api_abuse_check.py"
click node_abuse_detector "https://github.com/arvindkumar-ship-it/dumpydox/blob/main/apps/api/app/security/api_abuse.py"
click node_revocation_middleware "https://github.com/arvindkumar-ship-it/dumpydox/blob/main/apps/api/app/middleware/revocation_check.py"
click node_revoke_adapter "https://github.com/arvindkumar-ship-it/dumpydox/blob/main/apps/api/app/response/session_revoke.py"
click node_ws_auth "https://github.com/arvindkumar-ship-it/dumpydox/blob/main/apps/api/app/streaming/ws_auth.py"
click node_models "https://github.com/arvindkumar-ship-it/dumpydox/blob/main/apps/api/app/persistence/models.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_frontend,node_app,node_event_api,node_dashboard_api,node_response_api,node_ws_api toneBlue
class node_ingestion,node_normalizer,node_publisher,node_relay,node_consumer,node_models,node_postgres,node_redis toneAmber
class node_handler,node_graph,node_baseline,node_rate_window,node_isolation toneMint
class node_alert_bus,node_abuse_middleware,node_abuse_detector,node_revocation_middleware,node_revoke_adapter,node_ws_auth toneRose
class node_user,node_producer toneIndigo
```

## Components

### API and Console

- [Security console](https://github.com/arvindkumar-ship-it/dumpydox/blob/main/frontend/frontend/src/main.jsx): `frontend/frontend/src/main.jsx`
- [FastAPI application](https://github.com/arvindkumar-ship-it/dumpydox/blob/main/apps/api/app/main.py): `apps/api/app/main.py`
- [Event endpoint](https://github.com/arvindkumar-ship-it/dumpydox/blob/main/apps/api/app/api/v1/events.py): `apps/api/app/api/v1/events.py`
- [Dashboard endpoint](https://github.com/arvindkumar-ship-it/dumpydox/blob/main/apps/api/app/api/v1/dashboard.py): `apps/api/app/api/v1/dashboard.py`
- [Response endpoint](https://github.com/arvindkumar-ship-it/dumpydox/blob/main/apps/api/app/api/v1/response.py): `apps/api/app/api/v1/response.py`
- [Websocket endpoint](https://github.com/arvindkumar-ship-it/dumpydox/blob/main/apps/api/app/api/v1/ws.py): `apps/api/app/api/v1/ws.py`

### Event Ingestion

- [Ingestion service](https://github.com/arvindkumar-ship-it/dumpydox/blob/main/apps/api/app/ingestion/service.py): `apps/api/app/ingestion/service.py`
- [Event normalizer](https://github.com/arvindkumar-ship-it/dumpydox/blob/main/apps/api/app/ingestion/normalizer.py): `apps/api/app/ingestion/normalizer.py`
- [Outbox publisher](https://github.com/arvindkumar-ship-it/dumpydox/blob/main/apps/api/app/ingestion/publisher.py): `apps/api/app/ingestion/publisher.py`
- [Outbox relay](https://github.com/arvindkumar-ship-it/dumpydox/blob/main/apps/api/app/streaming/outbox_relay.py): `apps/api/app/streaming/outbox_relay.py`
- [Stream consumer](https://github.com/arvindkumar-ship-it/dumpydox/blob/main/apps/api/app/streaming/consumer.py): `apps/api/app/streaming/consumer.py`
- [Persistence models](https://github.com/arvindkumar-ship-it/dumpydox/blob/main/apps/api/app/persistence/models.py): `apps/api/app/persistence/models.py`

### Detection

- [Event handler](https://github.com/arvindkumar-ship-it/dumpydox/blob/main/apps/api/app/streaming/handlers.py): `apps/api/app/streaming/handlers.py`
- [Behavior graph](https://github.com/arvindkumar-ship-it/dumpydox/blob/main/apps/api/app/insider/graph_store.py): `apps/api/app/insider/graph_store.py`
- [Baseline scorer](https://github.com/arvindkumar-ship-it/dumpydox/blob/main/apps/api/app/insider/baseline.py): `apps/api/app/insider/baseline.py`
- [Rate window](https://github.com/arvindkumar-ship-it/dumpydox/blob/main/apps/api/app/insider/rate_window.py): `apps/api/app/insider/rate_window.py`
- [Isolation forest job](https://github.com/arvindkumar-ship-it/dumpydox/blob/main/apps/api/app/insider/isolation_forest_job.py): `apps/api/app/insider/isolation_forest_job.py`

### Security and Response

- [Alert bus](https://github.com/arvindkumar-ship-it/dumpydox/blob/main/apps/api/app/streaming/alert_bus.py): `apps/api/app/streaming/alert_bus.py`
- [Abuse middleware](https://github.com/arvindkumar-ship-it/dumpydox/blob/main/apps/api/app/middleware/api_abuse_check.py): `apps/api/app/middleware/api_abuse_check.py`
- [Abuse detectors](https://github.com/arvindkumar-ship-it/dumpydox/blob/main/apps/api/app/security/api_abuse.py): `apps/api/app/security/api_abuse.py`
- [Revocation middleware](https://github.com/arvindkumar-ship-it/dumpydox/blob/main/apps/api/app/middleware/revocation_check.py): `apps/api/app/middleware/revocation_check.py`
- [Session revocation](https://github.com/arvindkumar-ship-it/dumpydox/blob/main/apps/api/app/response/session_revoke.py): `apps/api/app/response/session_revoke.py`
- [Websocket tickets](https://github.com/arvindkumar-ship-it/dumpydox/blob/main/apps/api/app/streaming/ws_auth.py): `apps/api/app/streaming/ws_auth.py`

### Other components

- **Security operator**
- **Event producer**
- **PostgreSQL**
- **Redis**

## Connections

- Security operator → Security console: uses console
- Event producer → Event endpoint: submits events
- Security console → Event endpoint: submits events
- Security console → Dashboard endpoint: fetches alerts
- Security console → Response endpoint: requests revocation
- FastAPI application → Event endpoint: mounts route
- FastAPI application → Dashboard endpoint: mounts route
- FastAPI application → Response endpoint: mounts route
- FastAPI application → Websocket endpoint: mounts route
- FastAPI application → Abuse middleware: runs checks
- FastAPI application → Revocation middleware: runs checks
- Event endpoint → Ingestion service: ingests event
- Ingestion service → Event normalizer: normalizes event
- Ingestion service → Outbox publisher: publishes outbox
- Outbox publisher → PostgreSQL: writes outbox
- Outbox relay → PostgreSQL: reads outbox
- Outbox relay → Redis: publishes stream
- Stream consumer → Redis: reads stream
- Stream consumer → Event handler: dispatches event
- Event handler → Behavior graph: records access
- Behavior graph → PostgreSQL: reads and writes
- Event handler → Rate window: counts activity
- Rate window → Redis: updates window
- Event handler → Baseline scorer: scores behavior
- Event handler → Alert bus: publishes alert
- Alert bus → Redis: publishes alerts
- Dashboard endpoint → PostgreSQL: reads alerts
- Abuse middleware → Abuse detectors: checks requests
- Abuse detectors → Redis: tracks signals
- Revocation middleware → Session revocation: checks sessions
- Response endpoint → Session revocation: revokes session
- Session revocation → Redis: checks and sets revocation
- Session revocation → PostgreSQL: records revocation
- Websocket endpoint → Websocket tickets: validates ticket
- Websocket tickets → Redis: stores tickets
- Event handler → Isolation forest job: complements scoring
