How lildibbb/crypto_trading works
Project type and purpose
• This is a full-stack “Crypto Trading Bot” application.
• Frontend: a React + TypeScript SPA built with Vite, TanStack Router, ShadCN UI, Recharts.
• Backend: a FastAPI service in Python, using TortoiseORM + aerich for migrations, PostgreSQL for storage, and a Binance WebSocket client for real-time market data.
File structure
• Top‐level directories:
• backend/ → FastAPI app, models, database layer, scripts, WebSocket client
• frontend/ → Vite‐powered React app with components, routes, API client, UI library
• Root files: .env.example (env vars), package.json + bun.lockb (frontend toolchain), README.md
• Patterns:
• Clear frontend/backend separation
• Backend organized around modules: main.py (app entry), models.py (ORM), database.py (connection), binance_ws.py (market feed), scripts.py (batch jobs)
• Frontend follows a component + route tree structure with lib/api.ts as HTTP client
README for additional insights
• Tech stack calls out React/Vite/TanStack Router on the front, FastAPI/TortoiseORM/PostgreSQL on the back
• Future features: candle charts (live + historical via Binance API), order management via Binance WebSocket
Don’t overthink—break the system into as many logical parts as needed
• Presentation (React SPA)
• API Layer (FastAPI routers)
• Services (market-data client, order manager)
• Data Access (ORM + migrations)
• Persistence (PostgreSQL)
• External (Binance REST & WS)