How ali-hassan1590/tradingapp works
Trading Backend is a Django REST API for paper trading. A client reaches app endpoints through the root router; the documented buy-order workflow validates a request, then order execution coordinates wallet funds, portfolio positions, and a trade notification before returning a response. Other product stages include account authentication, market browsing, wallet management, portfolio tracking, and analytics. The order, wallet, portfolio, authentication, and notification service relationships are supported by sampled source or explicit README documentation; other app internals were not sampled, so their wiring is left unspecified.
Main entry points: urls.py API router · orders/services.py Order execution · wallet/services.py Wallet operations · portfolio/services.py Portfolio operations
Components 21
API and identity
- API router
backend/config/urls.py - Authentication API
backend/apps/authentication/views.py - Authentication service
backend/apps/authentication/services.py - Accounts
backend/apps/accounts/models.py
Trading lifecycle
- Market API
backend/apps/market/views.py - Market assets
backend/apps/market/models.py - Orders API
backend/apps/orders/views.py - Order execution
backend/apps/orders/services.py - Orders and trades
backend/apps/orders/models.py
Wallet and portfolio
- Wallet API
backend/apps/wallet/views.py - Wallet operations
backend/apps/wallet/services.py - Wallet ledger
backend/apps/wallet/models.py - Portfolio API
backend/apps/portfolio/views.py - Portfolio operations
backend/apps/portfolio/services.py - Positions
backend/apps/portfolio/models.py
Alerts and analytics
- Notifications API
backend/apps/notifications/views.py - Notification service
backend/apps/notifications/services.py - Notifications
backend/apps/notifications/models.py - Analytics API
backend/apps/analytics/views.py
Other components
- Trading client
- Application database
Connections 27
- Trading client → API router: sends requests
- API router → Authentication API: routes auth
- API router → Market API: routes market
- API router → Orders API: routes orders
- API router → Wallet API: routes wallet
- API router → Portfolio API: routes portfolio
- API router → Notifications API: routes alerts
- API router → Analytics API: routes analytics
- Authentication API → Authentication service: calls service
- Authentication service → Accounts: records login
- Orders API → Order execution: calls service
- Order execution → Wallet operations: locks or moves funds
- Order execution → Portfolio operations: updates position
- Order execution → Notification service: creates alert
- Order execution → Market assets: reads asset price
- Wallet API → Wallet operations: uses operations
- Portfolio API → Portfolio operations: uses operations
- Wallet operations → Wallet ledger: updates ledger
- Portfolio operations → Positions: updates positions
- Notification service → Notifications: creates alerts
- Order execution → Orders and trades: stores orders and trades
- Authentication service → Application database: writes login history
- Order execution → Application database: reads and writes
- Wallet operations → Application database: reads and writes
- Portfolio operations → Application database: reads and writes
- Notification service → Application database: writes alerts
- Market API → Market assets: serves market data