How jit-stack/trade-api works
This repository is a small FastAPI mock trading API. Its user workflow is to create a session, request simulated market data, submit an order, and retrieve or list orders; orders are filled immediately. The runtime is concentrated in app/main.py, with in-memory session and order state and no external service integrations. The README also documents container, CI/CD, deployment, and monitoring practice, but these are DevOps exercises around the application, not implemented runtime subsystems in the supplied source tree. Edges reflect the sampled route handlers; no separate storage or pricing modules are shown.
Main entry points: main.py FastAPI service
Components 11
API endpoints
- FastAPI service
app/main.py - Service info
app/main.py - Health check
app/main.py
Trading behavior
- Session login
app/main.py - Market data
app/main.py - Order entry
app/main.py - Order status
app/main.py - Order listing
app/main.py
In-memory state
- Session state
app/main.py - Order state
app/main.py
Other components
- API client
Connections 13
- API client → FastAPI service: sends requests
README.md - FastAPI service → Service info: routes GET /
app/main.py - FastAPI service → Health check: routes GET /health
app/main.py - FastAPI service → Session login: routes POST /login
app/main.py - FastAPI service → Market data: routes market data
app/main.py - FastAPI service → Order entry: routes POST /orders
app/main.py - FastAPI service → Order status: routes order lookup
app/main.py - FastAPI service → Order listing: routes order list
app/main.py - Session login → Session state: writes session
app/main.py - Order entry → Session state: checks session
app/main.py - Order entry → Order state: writes order
app/main.py - Order status → Order state: reads order
app/main.py - Order listing → Order state: reads orders
app/main.py