# itsnothuyy/stock architecture

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

- Interactive diagram: https://gitdiagram.com/itsnothuyy/stock
- Repository: https://github.com/itsnothuyy/stock

## Overview

Atlas Terminal is a local, single-user crypto research terminal, but the checked-in code is still a scaffold. Its only implemented user workflow is opening the client, which checks the local service’s health; that handler opens SQLite and runs a connection check. The README identifies Binance market-data ingestion, zone rules, charting, application tables, and simulated orders as product capabilities, but says they are future work. Those are shown as planned subsystems, not as an implemented pipeline. Edges reflect the sampled code or explicit README statements; unsampled implementation details are omitted.

Main entry points: [`src/service/main.ts`](https://github.com/itsnothuyy/stock/blob/main/src/service/main.ts) (Health endpoint), [`src/client/main.tsx`](https://github.com/itsnothuyy/stock/blob/main/src/client/main.tsx) (Terminal UI), [`src/service/sqlite.ts`](https://github.com/itsnothuyy/stock/blob/main/src/service/sqlite.ts) (SQLite boundary), [`src/service`](https://github.com/itsnothuyy/stock/tree/main/src/service) (Market ingestion)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client"]
  node_client_app["Terminal UI<br/>[main.tsx]"]
  node_charting["Charting"]
end

subgraph group_service["Local service"]
  node_health_api["Health endpoint<br/>[main.ts]"]
  node_sqlite_boundary["SQLite boundary<br/>[sqlite.ts]"]
  node_sqlite_db[("Local SQLite")]
  node_application_tables[("Application tables")]
end

subgraph group_research["Research capabilities"]
  node_analysis_contracts["Analysis contracts<br/>[types.ts]"]
  node_market_ingestion["Market ingestion"]
  node_zone_rules["Zone rules"]
  node_simulated_orders["Simulated orders"]
end

node_user(("Research user"))
node_binance["Binance Spot"]

node_user -->|"uses"| node_client_app
node_client_app -->|"checks health"| node_health_api
node_health_api -->|"opens database"| node_sqlite_boundary
node_health_api -->|"checks connection"| node_sqlite_db
node_sqlite_boundary -->|"opens"| node_sqlite_db
node_binance -.->|"provides data"| node_market_ingestion

click node_client_app "https://github.com/itsnothuyy/stock/blob/main/src/client/main.tsx"
click node_health_api "https://github.com/itsnothuyy/stock/blob/main/src/service/main.ts"
click node_sqlite_boundary "https://github.com/itsnothuyy/stock/blob/main/src/service/sqlite.ts"
click node_analysis_contracts "https://github.com/itsnothuyy/stock/blob/main/src/analysis/types.ts"
click node_market_ingestion "https://github.com/itsnothuyy/stock/tree/main/src/service"
click node_zone_rules "https://github.com/itsnothuyy/stock/tree/main/src/analysis"
click node_charting "https://github.com/itsnothuyy/stock/tree/main/src/client"
click node_application_tables "https://github.com/itsnothuyy/stock/tree/main/src/service"
click node_simulated_orders "https://github.com/itsnothuyy/stock/tree/main/src/service"

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_client_app,node_charting,node_user toneBlue
class node_health_api,node_sqlite_boundary,node_sqlite_db,node_application_tables toneAmber
class node_analysis_contracts,node_market_ingestion,node_zone_rules,node_simulated_orders toneMint
class node_binance toneIndigo
```

## Components

### Client

- [Terminal UI](https://github.com/itsnothuyy/stock/blob/main/src/client/main.tsx): `src/client/main.tsx`
- [Charting](https://github.com/itsnothuyy/stock/tree/main/src/client): `src/client`

### Local service

- [Health endpoint](https://github.com/itsnothuyy/stock/blob/main/src/service/main.ts): `src/service/main.ts`
- [SQLite boundary](https://github.com/itsnothuyy/stock/blob/main/src/service/sqlite.ts): `src/service/sqlite.ts`
- **Local SQLite**
- [Application tables](https://github.com/itsnothuyy/stock/tree/main/src/service): `src/service`

### Research capabilities

- [Analysis contracts](https://github.com/itsnothuyy/stock/blob/main/src/analysis/types.ts): `src/analysis/types.ts`
- [Market ingestion](https://github.com/itsnothuyy/stock/tree/main/src/service): `src/service`
- [Zone rules](https://github.com/itsnothuyy/stock/tree/main/src/analysis): `src/analysis`
- [Simulated orders](https://github.com/itsnothuyy/stock/tree/main/src/service): `src/service`

### Other components

- **Research user**
- **Binance Spot**

## Connections

- Research user → Terminal UI: uses (evidence: `README.md`)
- Terminal UI → Health endpoint: checks health (evidence: `src/client/main.tsx`)
- Health endpoint → SQLite boundary: opens database (evidence: `src/service/main.ts`)
- Health endpoint → Local SQLite: checks connection (evidence: `src/service/main.ts`)
- SQLite boundary → Local SQLite: opens (evidence: `src/service/sqlite.ts`)
- Binance Spot → Market ingestion: provides data (evidence: `README.md`)
