# jojo165556/cryptotracker-lab architecture

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

- Interactive diagram: https://gitdiagram.com/jojo165556/cryptotracker-lab
- Repository: https://github.com/jojo165556/cryptotracker-lab

## Overview

CryptoTracker Lab is a teaching-oriented modular Django crypto-trading application. A user interacts through the dashboard or an API; trading use cases create and execute orders, with wallet balances and positions updated through repositories. Separate modules provide identity, market data, analytics, notifications, and payment settlement. The README documents REST, GraphQL, WebSocket, SSE, gRPC, JSON-RPC, webhooks, and SOAP capabilities. Edges from sampled code are cited to their callers; protocol coverage and unsampled interface wiring rely on README statements, so some links remain unverified.

Main entry points: [`trading/application/use_cases.py`](https://github.com/jojo165556/cryptotracker-lab/blob/main/trading/application/use_cases.py) (Trading use cases), [`trading/infrastructure/repositories.py`](https://github.com/jojo165556/cryptotracker-lab/blob/main/trading/infrastructure/repositories.py) (Order repository), [`wallet/infrastructure/repositories.py`](https://github.com/jojo165556/cryptotracker-lab/blob/main/wallet/infrastructure/repositories.py) (Wallet repositories), [`frontend/static/js/app.js`](https://github.com/jojo165556/cryptotracker-lab/blob/main/frontend/static/js/app.js) (Dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["Client interfaces"]
  node_dashboard["Dashboard<br/>[app.js]"]
  node_rest["REST APIs<br/>[api.py]"]
  node_graphql["GraphQL API<br/>[schema.py]"]
  node_grpc["gRPC Order Engine<br/>[server.py]"]
  node_analytics_rpc["Analytics JSON-RPC<br/>[api.py]"]
  node_soap["Legacy SOAP<br/>[soap_service.py]"]
  node_market_ws["Market WebSocket<br/>[price_consumer.py]"]
  node_notification_sse["Notification SSE<br/>[sse.py]"]
  node_payment_webhook["Payment Webhook<br/>[views.py]"]
end

subgraph group_trading["Trading domain"]
  node_trading_usecases["Trading use cases<br/>[use_cases.py]"]
  node_trading_domain["Orders and trades<br/>[entities.py]"]
  node_order_repo["Order repository<br/>[repositories.py]"]
  node_market_service["Market service<br/>[use_cases.py]"]
end

subgraph group_finance["Wallet and payments"]
  node_wallet_usecases["Wallet use cases<br/>[use_cases.py]"]
  node_wallet_domain["Wallet and ledger<br/>[entities.py]"]
  node_wallet_repo["Wallet repositories<br/>[repositories.py]"]
  node_payment_usecases["Payment settlement<br/>[use_cases.py]"]
  node_payment_task["Payment task<br/>[tasks.py]"]
end

subgraph group_support["Product services"]
  node_identity["Identity and security<br/>[auth.py]"]
  node_analytics["Analytics service<br/>[service.py]"]
  node_notifications["Notifications<br/>[use_cases.py]"]
  node_legacy_bank["Legacy bank service<br/>[use_cases.py]"]
end

subgraph group_platform["Runtime platform"]
  node_graphql_loaders["GraphQL loaders<br/>[dataloaders.py]"]
  node_database[("Relational database")]
  node_redis[("Redis Pub/Sub")]
end

node_user(("User"))

node_user -->|"uses"| node_dashboard
node_dashboard -.->|"API requests"| node_rest
node_dashboard -.->|"queries"| node_graphql
node_dashboard -.->|"live updates"| node_market_ws
node_rest -.->|"dispatches"| node_trading_usecases
node_trading_usecases -->|"reads and writes"| node_order_repo
node_trading_usecases -->|"creates and executes"| node_trading_domain
node_trading_usecases -->|"loads wallet"| node_wallet_repo
node_trading_usecases -->|"updates positions"| node_wallet_domain
node_grpc -->|"invokes"| node_trading_usecases
node_grpc -->|"reads orders"| node_order_repo
node_wallet_usecases -->|"persists"| node_wallet_repo
node_wallet_usecases -->|"applies rules"| node_wallet_domain
node_payment_webhook -.->|"queues settlement"| node_payment_task
node_payment_task -->|"invokes"| node_payment_usecases
node_payment_task -->|"credits wallet"| node_wallet_usecases
node_payment_usecases -->|"settles payment"| node_wallet_repo
node_analytics_rpc -.->|"dispatches"| node_analytics
node_analytics -->|"queries orders"| node_order_repo
node_analytics -->|"queries wallet"| node_wallet_repo
node_graphql -.->|"uses loaders"| node_graphql_loaders
node_graphql_loaders -->|"loads market data"| node_order_repo
node_market_ws -.->|"publishes updates"| node_redis
node_notification_sse -.->|"streams notifications"| node_notifications
node_soap -->|"dispatches operations"| node_legacy_bank
node_order_repo -.->|"persists orders"| node_database
node_wallet_repo -.->|"persists wallets"| node_database

click node_dashboard "https://github.com/jojo165556/cryptotracker-lab/blob/main/frontend/static/js/app.js"
click node_rest "https://github.com/jojo165556/cryptotracker-lab/blob/main/trading/interfaces/api.py"
click node_graphql "https://github.com/jojo165556/cryptotracker-lab/blob/main/core/graphql_api/schema.py"
click node_grpc "https://github.com/jojo165556/cryptotracker-lab/blob/main/order_engine/server.py"
click node_analytics_rpc "https://github.com/jojo165556/cryptotracker-lab/blob/main/analytics/interfaces/api.py"
click node_soap "https://github.com/jojo165556/cryptotracker-lab/blob/main/legacy_bank/interfaces/soap_service.py"
click node_market_ws "https://github.com/jojo165556/cryptotracker-lab/blob/main/market/interfaces/consumers/price_consumer.py"
click node_notification_sse "https://github.com/jojo165556/cryptotracker-lab/blob/main/notification/interfaces/sse.py"
click node_payment_webhook "https://github.com/jojo165556/cryptotracker-lab/blob/main/payment/interfaces/views.py"
click node_trading_usecases "https://github.com/jojo165556/cryptotracker-lab/blob/main/trading/application/use_cases.py"
click node_trading_domain "https://github.com/jojo165556/cryptotracker-lab/blob/main/trading/domain/entities.py"
click node_order_repo "https://github.com/jojo165556/cryptotracker-lab/blob/main/trading/infrastructure/repositories.py"
click node_market_service "https://github.com/jojo165556/cryptotracker-lab/blob/main/market/application/use_cases.py"
click node_wallet_usecases "https://github.com/jojo165556/cryptotracker-lab/blob/main/wallet/application/use_cases.py"
click node_wallet_domain "https://github.com/jojo165556/cryptotracker-lab/blob/main/wallet/domain/entities.py"
click node_wallet_repo "https://github.com/jojo165556/cryptotracker-lab/blob/main/wallet/infrastructure/repositories.py"
click node_payment_usecases "https://github.com/jojo165556/cryptotracker-lab/blob/main/payment/application/use_cases.py"
click node_payment_task "https://github.com/jojo165556/cryptotracker-lab/blob/main/payment/interfaces/tasks.py"
click node_identity "https://github.com/jojo165556/cryptotracker-lab/blob/main/identity/infrastructure/auth.py"
click node_analytics "https://github.com/jojo165556/cryptotracker-lab/blob/main/analytics/service.py"
click node_notifications "https://github.com/jojo165556/cryptotracker-lab/blob/main/notification/application/use_cases.py"
click node_legacy_bank "https://github.com/jojo165556/cryptotracker-lab/blob/main/legacy_bank/application/use_cases.py"
click node_graphql_loaders "https://github.com/jojo165556/cryptotracker-lab/blob/main/core/graphql_api/dataloaders.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_dashboard,node_rest,node_graphql,node_grpc,node_analytics_rpc,node_soap,node_market_ws,node_notification_sse,node_payment_webhook,node_user toneBlue
class node_trading_usecases,node_trading_domain,node_order_repo,node_market_service toneAmber
class node_wallet_usecases,node_wallet_domain,node_wallet_repo,node_payment_usecases,node_payment_task toneMint
class node_identity,node_analytics,node_notifications,node_legacy_bank toneRose
class node_graphql_loaders,node_database,node_redis toneIndigo
```

## Components

### Client interfaces

- [Dashboard](https://github.com/jojo165556/cryptotracker-lab/blob/main/frontend/static/js/app.js): `frontend/static/js/app.js`
- [REST APIs](https://github.com/jojo165556/cryptotracker-lab/blob/main/trading/interfaces/api.py): `trading/interfaces/api.py`
- [GraphQL API](https://github.com/jojo165556/cryptotracker-lab/blob/main/core/graphql_api/schema.py): `core/graphql_api/schema.py`
- [gRPC Order Engine](https://github.com/jojo165556/cryptotracker-lab/blob/main/order_engine/server.py): `order_engine/server.py`
- [Analytics JSON-RPC](https://github.com/jojo165556/cryptotracker-lab/blob/main/analytics/interfaces/api.py): `analytics/interfaces/api.py`
- [Legacy SOAP](https://github.com/jojo165556/cryptotracker-lab/blob/main/legacy_bank/interfaces/soap_service.py): `legacy_bank/interfaces/soap_service.py`
- [Market WebSocket](https://github.com/jojo165556/cryptotracker-lab/blob/main/market/interfaces/consumers/price_consumer.py): `market/interfaces/consumers/price_consumer.py`
- [Notification SSE](https://github.com/jojo165556/cryptotracker-lab/blob/main/notification/interfaces/sse.py): `notification/interfaces/sse.py`
- [Payment Webhook](https://github.com/jojo165556/cryptotracker-lab/blob/main/payment/interfaces/views.py): `payment/interfaces/views.py`

### Trading domain

- [Trading use cases](https://github.com/jojo165556/cryptotracker-lab/blob/main/trading/application/use_cases.py): `trading/application/use_cases.py`
- [Orders and trades](https://github.com/jojo165556/cryptotracker-lab/blob/main/trading/domain/entities.py): `trading/domain/entities.py`
- [Order repository](https://github.com/jojo165556/cryptotracker-lab/blob/main/trading/infrastructure/repositories.py): `trading/infrastructure/repositories.py`
- [Market service](https://github.com/jojo165556/cryptotracker-lab/blob/main/market/application/use_cases.py): `market/application/use_cases.py`

### Wallet and payments

- [Wallet use cases](https://github.com/jojo165556/cryptotracker-lab/blob/main/wallet/application/use_cases.py): `wallet/application/use_cases.py`
- [Wallet and ledger](https://github.com/jojo165556/cryptotracker-lab/blob/main/wallet/domain/entities.py): `wallet/domain/entities.py`
- [Wallet repositories](https://github.com/jojo165556/cryptotracker-lab/blob/main/wallet/infrastructure/repositories.py): `wallet/infrastructure/repositories.py`
- [Payment settlement](https://github.com/jojo165556/cryptotracker-lab/blob/main/payment/application/use_cases.py): `payment/application/use_cases.py`
- [Payment task](https://github.com/jojo165556/cryptotracker-lab/blob/main/payment/interfaces/tasks.py): `payment/interfaces/tasks.py`

### Product services

- [Identity and security](https://github.com/jojo165556/cryptotracker-lab/blob/main/identity/infrastructure/auth.py): `identity/infrastructure/auth.py`
- [Analytics service](https://github.com/jojo165556/cryptotracker-lab/blob/main/analytics/service.py): `analytics/service.py`
- [Notifications](https://github.com/jojo165556/cryptotracker-lab/blob/main/notification/application/use_cases.py): `notification/application/use_cases.py`
- [Legacy bank service](https://github.com/jojo165556/cryptotracker-lab/blob/main/legacy_bank/application/use_cases.py): `legacy_bank/application/use_cases.py`

### Runtime platform

- [GraphQL loaders](https://github.com/jojo165556/cryptotracker-lab/blob/main/core/graphql_api/dataloaders.py): `core/graphql_api/dataloaders.py`
- **Relational database**
- **Redis Pub/Sub**

### Other components

- **User**

## Connections

- User → Dashboard: uses
- Dashboard → REST APIs: API requests
- Dashboard → GraphQL API: queries
- Dashboard → Market WebSocket: live updates
- REST APIs → Trading use cases: dispatches
- Trading use cases → Order repository: reads and writes (evidence: `trading/application/use_cases.py`)
- Trading use cases → Orders and trades: creates and executes (evidence: `trading/application/use_cases.py`)
- Trading use cases → Wallet repositories: loads wallet (evidence: `trading/application/use_cases.py`)
- Trading use cases → Wallet and ledger: updates positions (evidence: `trading/application/use_cases.py`)
- gRPC Order Engine → Trading use cases: invokes (evidence: `order_engine/server.py`)
- gRPC Order Engine → Order repository: reads orders (evidence: `order_engine/server.py`)
- Wallet use cases → Wallet repositories: persists (evidence: `wallet/application/use_cases.py`)
- Wallet use cases → Wallet and ledger: applies rules (evidence: `wallet/application/use_cases.py`)
- Payment Webhook → Payment task: queues settlement
- Payment task → Payment settlement: invokes (evidence: `payment/interfaces/tasks.py`)
- Payment task → Wallet use cases: credits wallet (evidence: `payment/interfaces/tasks.py`)
- Payment settlement → Wallet repositories: settles payment (evidence: `payment/application/use_cases.py`)
- Analytics JSON-RPC → Analytics service: dispatches
- Analytics service → Order repository: queries orders (evidence: `analytics/service.py`)
- Analytics service → Wallet repositories: queries wallet (evidence: `analytics/service.py`)
- GraphQL API → GraphQL loaders: uses loaders
- GraphQL loaders → Order repository: loads market data (evidence: `core/graphql_api/dataloaders.py`)
- Market WebSocket → Redis Pub/Sub: publishes updates
- Notification SSE → Notifications: streams notifications
- Legacy SOAP → Legacy bank service: dispatches operations (evidence: `legacy_bank/interfaces/soap_service.py`)
- Order repository → Relational database: persists orders
- Wallet repositories → Relational database: persists wallets
