# athallahd/upbit-dashboard-be architecture

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

- Interactive diagram: https://gitdiagram.com/athallahd/upbit-dashboard-be
- Repository: https://github.com/athallahd/upbit-dashboard-be

## Overview

This repository is a Django-based reporting and operational-monitoring platform, with APIs and admin-managed data for trading, deposits, monitoring, and executive metrics. A representative workflow is a user requesting dashboard metrics: the dashboard endpoint delegates period and metric calculations to its service, which reads reporting data and stores daily summaries. The tree and excerpts support the major subsystems below, but many app-to-app calls are unsampled; those links are omitted rather than inferred.

Main entry points: [`lens/urls.py`](https://github.com/athallahd/upbit-dashboard-be/blob/main/lens/urls.py) (Django entry points), [`executive_dashboard/services.py`](https://github.com/athallahd/upbit-dashboard-be/blob/main/executive_dashboard/services.py) (Metric calculations), [`lens_monitoring/views.py`](https://github.com/athallahd/upbit-dashboard-be/blob/main/lens_monitoring/views.py) (Monitoring API), [`lens_data/models/data.py`](https://github.com/athallahd/upbit-dashboard-be/blob/main/lens_data/models/data.py) (Reporting models)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and access"]
  node_django["Django entry points<br/>[urls.py]"]
  node_data_api["Data API<br/>[views.py]"]
  node_monitor_api["Monitoring API<br/>[views.py]"]
  node_master_api["Reference data API<br/>[views.py]"]
end

subgraph group_reporting["Reporting data"]
  node_data_models["Reporting models<br/>[data.py]"]
  node_master_models["Reference models<br/>[sec.py]"]
  node_router["Database router<br/>[routers.py]"]
  node_report_db[("Reporter database")]
  node_snapshot["Snapshots<br/>[snapshot.py]"]
  node_csv["CSV tasks<br/>[csv_task.py]"]
end

subgraph group_monitoring["Monitoring controls"]
  node_monitor_models["Monitoring records<br/>[monitoring.py]"]
  node_trigger["Rules and triggers<br/>[trigger.py]"]
  node_params["Rule parameters<br/>[ruleset_params.py]"]
end

subgraph group_integrations["External integrations"]
  node_exchange(("Exchange API"))
  node_market_prices(("Market price API"))
  node_banking(("Banking API"))
  node_slack(("Slack"))
  node_ccx_client["Exchange client<br/>[client.py]"]
  node_crix_client["Price client<br/>[client.py]"]
  node_cuma_client["Banking client<br/>[client.py]"]
  node_slack_client["Notification client<br/>[client.py]"]
end

subgraph group_dashboard["Executive dashboard"]
  node_dashboard_api["Dashboard endpoints<br/>[views.py]"]
  node_dashboard_service["Metric calculations<br/>[services.py]"]
  node_dashboard_model["Daily summaries<br/>[models.py]"]
  node_refresh["Dashboard refresh"]
end

node_user(("Dashboard user"))

node_user -->|"requests"| node_django
node_django -->|"dispatches"| node_data_api
node_django -->|"dispatches"| node_monitor_api
node_django -->|"dispatches"| node_master_api
node_django -->|"dispatches"| node_dashboard_api
node_data_api -->|"queries"| node_data_models
node_monitor_api -->|"queries"| node_monitor_models
node_monitor_api -.->|"fetches tickers"| node_market_prices
node_master_api -->|"queries"| node_master_models
node_router -->|"routes model I/O"| node_report_db
node_data_models -->|"maps tables"| node_report_db
node_master_models -->|"maps tables"| node_report_db
node_snapshot -->|"maps tables"| node_report_db
node_csv -->|"maps tasks"| node_report_db
node_monitor_models -->|"maps tables"| node_report_db
node_trigger -->|"maps rules"| node_report_db
node_params -->|"reads parameters"| node_master_models
node_ccx_client -.->|"calls"| node_exchange
node_crix_client -.->|"calls"| node_market_prices
node_cuma_client -.->|"calls"| node_banking
node_slack_client -.->|"sends messages"| node_slack
node_dashboard_api -->|"calculates metrics"| node_dashboard_service
node_dashboard_service -->|"reads source metrics"| node_data_models
node_dashboard_service -->|"reads and writes summaries"| node_dashboard_model
node_dashboard_model -->|"stores summaries"| node_report_db
node_refresh -->|"refreshes range"| node_dashboard_service

click node_django "https://github.com/athallahd/upbit-dashboard-be/blob/main/lens/urls.py"
click node_data_api "https://github.com/athallahd/upbit-dashboard-be/blob/main/lens_data/views.py"
click node_monitor_api "https://github.com/athallahd/upbit-dashboard-be/blob/main/lens_monitoring/views.py"
click node_master_api "https://github.com/athallahd/upbit-dashboard-be/blob/main/masterdata/views.py"
click node_data_models "https://github.com/athallahd/upbit-dashboard-be/blob/main/lens_data/models/data.py"
click node_master_models "https://github.com/athallahd/upbit-dashboard-be/blob/main/masterdata/models/sec.py"
click node_router "https://github.com/athallahd/upbit-dashboard-be/blob/main/lens/routers.py"
click node_snapshot "https://github.com/athallahd/upbit-dashboard-be/blob/main/snapshot/models/snapshot.py"
click node_csv "https://github.com/athallahd/upbit-dashboard-be/blob/main/lens_csv/models/csv_task.py"
click node_monitor_models "https://github.com/athallahd/upbit-dashboard-be/blob/main/lens_monitoring/models/monitoring.py"
click node_trigger "https://github.com/athallahd/upbit-dashboard-be/blob/main/trigger/models/trigger.py"
click node_params "https://github.com/athallahd/upbit-dashboard-be/blob/main/trigger/admin/ruleset_params.py"
click node_ccx_client "https://github.com/athallahd/upbit-dashboard-be/blob/main/libs/ccx/client.py"
click node_crix_client "https://github.com/athallahd/upbit-dashboard-be/blob/main/libs/crix/client.py"
click node_cuma_client "https://github.com/athallahd/upbit-dashboard-be/blob/main/libs/cuma/client.py"
click node_slack_client "https://github.com/athallahd/upbit-dashboard-be/blob/main/libs/slack/client.py"
click node_dashboard_api "https://github.com/athallahd/upbit-dashboard-be/blob/main/executive_dashboard/views.py"
click node_dashboard_service "https://github.com/athallahd/upbit-dashboard-be/blob/main/executive_dashboard/services.py"
click node_dashboard_model "https://github.com/athallahd/upbit-dashboard-be/blob/main/executive_dashboard/models.py"
click node_refresh "https://github.com/athallahd/upbit-dashboard-be/blob/main/executive_dashboard/management/commands/refresh_dashboard.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_django,node_data_api,node_monitor_api,node_master_api,node_user toneBlue
class node_data_models,node_master_models,node_router,node_report_db,node_snapshot,node_csv toneAmber
class node_monitor_models,node_trigger,node_params toneMint
class node_exchange,node_market_prices,node_banking,node_slack,node_ccx_client,node_crix_client,node_cuma_client,node_slack_client toneRose
class node_dashboard_api,node_dashboard_service,node_dashboard_model,node_refresh toneIndigo
```

## Components

### API and access

- [Django entry points](https://github.com/athallahd/upbit-dashboard-be/blob/main/lens/urls.py): `lens/urls.py`
- [Data API](https://github.com/athallahd/upbit-dashboard-be/blob/main/lens_data/views.py): `lens_data/views.py`
- [Monitoring API](https://github.com/athallahd/upbit-dashboard-be/blob/main/lens_monitoring/views.py): `lens_monitoring/views.py`
- [Reference data API](https://github.com/athallahd/upbit-dashboard-be/blob/main/masterdata/views.py): `masterdata/views.py`

### Reporting data

- [Reporting models](https://github.com/athallahd/upbit-dashboard-be/blob/main/lens_data/models/data.py): `lens_data/models/data.py`
- [Reference models](https://github.com/athallahd/upbit-dashboard-be/blob/main/masterdata/models/sec.py): `masterdata/models/sec.py`
- [Database router](https://github.com/athallahd/upbit-dashboard-be/blob/main/lens/routers.py): `lens/routers.py`
- **Reporter database**
- [Snapshots](https://github.com/athallahd/upbit-dashboard-be/blob/main/snapshot/models/snapshot.py): `snapshot/models/snapshot.py`
- [CSV tasks](https://github.com/athallahd/upbit-dashboard-be/blob/main/lens_csv/models/csv_task.py): `lens_csv/models/csv_task.py`

### Monitoring controls

- [Monitoring records](https://github.com/athallahd/upbit-dashboard-be/blob/main/lens_monitoring/models/monitoring.py): `lens_monitoring/models/monitoring.py`
- [Rules and triggers](https://github.com/athallahd/upbit-dashboard-be/blob/main/trigger/models/trigger.py): `trigger/models/trigger.py`
- [Rule parameters](https://github.com/athallahd/upbit-dashboard-be/blob/main/trigger/admin/ruleset_params.py): `trigger/admin/ruleset_params.py`

### External integrations

- **Exchange API**
- **Market price API**
- **Banking API**
- **Slack**
- [Exchange client](https://github.com/athallahd/upbit-dashboard-be/blob/main/libs/ccx/client.py): `libs/ccx/client.py`
- [Price client](https://github.com/athallahd/upbit-dashboard-be/blob/main/libs/crix/client.py): `libs/crix/client.py`
- [Banking client](https://github.com/athallahd/upbit-dashboard-be/blob/main/libs/cuma/client.py): `libs/cuma/client.py`
- [Notification client](https://github.com/athallahd/upbit-dashboard-be/blob/main/libs/slack/client.py): `libs/slack/client.py`

### Executive dashboard

- [Dashboard endpoints](https://github.com/athallahd/upbit-dashboard-be/blob/main/executive_dashboard/views.py): `executive_dashboard/views.py`
- [Metric calculations](https://github.com/athallahd/upbit-dashboard-be/blob/main/executive_dashboard/services.py): `executive_dashboard/services.py`
- [Daily summaries](https://github.com/athallahd/upbit-dashboard-be/blob/main/executive_dashboard/models.py): `executive_dashboard/models.py`
- [Dashboard refresh](https://github.com/athallahd/upbit-dashboard-be/blob/main/executive_dashboard/management/commands/refresh_dashboard.py): `executive_dashboard/management/commands/refresh_dashboard.py`

### Other components

- **Dashboard user**

## Connections

- Dashboard user → Django entry points: requests
- Django entry points → Data API: dispatches
- Django entry points → Monitoring API: dispatches
- Django entry points → Reference data API: dispatches
- Django entry points → Dashboard endpoints: dispatches
- Data API → Reporting models: queries
- Monitoring API → Monitoring records: queries
- Monitoring API → Market price API: fetches tickers
- Reference data API → Reference models: queries
- Database router → Reporter database: routes model I/O
- Reporting models → Reporter database: maps tables
- Reference models → Reporter database: maps tables
- Snapshots → Reporter database: maps tables
- CSV tasks → Reporter database: maps tasks
- Monitoring records → Reporter database: maps tables
- Rules and triggers → Reporter database: maps rules
- Rule parameters → Reference models: reads parameters
- Exchange client → Exchange API: calls
- Price client → Market price API: calls
- Banking client → Banking API: calls
- Notification client → Slack: sends messages
- Dashboard endpoints → Metric calculations: calculates metrics
- Metric calculations → Reporting models: reads source metrics
- Metric calculations → Daily summaries: reads and writes summaries
- Daily summaries → Reporter database: stores summaries
- Dashboard refresh → Metric calculations: refreshes range
