How pradeepxvi/tradesimbackend works
This Django REST API supports user accounts and profiles, market data browsing, watchlists, and simulated stock trading. Users authenticate and manage their profiles; market endpoints retrieve and normalize ShareHub data; watchlist endpoints combine saved symbols with market information; trading services check market status and prices before updating virtual wallets, holdings, orders, and trades. The graph includes the API and persistence layers. Some subsystems are represented from the source index rather than inspected excerpts, so their internal details and undocumented links are omitted.
Main entry points: urls.py API Routes · users/views.py Account and Profile API · watchlist/views.py Watchlist API · services.py Trading Services
Components 18
Accounts and Profiles
- Users and OTPs
apps/users/models.py - Account and Profile API
apps/users/views.py - Account Serializers
apps/users/serializers.py
Market Data
- Market API
apps/market/views.py - Market Serializers
apps/market/serializers.py - ShareHub Client
apps/market/clients/sharehub.py
Watchlists
- Watchlist API
apps/watchlist/views.py - Watchlist Serializers
apps/watchlist/serializers.py - Watchlist Items
apps/watchlist/models.py
Simulated Trading
- Trading API
apps/trading/views.py - Trading Services
apps/trading/services.py - Trading Serializers
apps/trading/serializers.py - Wallets and Trades
apps/trading/models.py - Trading Signals
apps/trading/signals.py
API and Persistence
- API Routes
config/urls.py - Relational Database
Other components
- ShareHub
- API Client
Connections 21
- API Client → API Routes: sends requests
- API Routes → Account and Profile API: routes to
- API Routes → Market API: routes to
- API Routes → Watchlist API: routes to
- API Routes → Trading API: routes to
- Account and Profile API → Account Serializers: validates with
apps/users/views.py - Account and Profile API → Users and OTPs: reads and updates
apps/users/views.py - Account and Profile API → Relational Database: persists account data
apps/users/views.py - Market API → ShareHub Client: requests data
apps/market/views.py - Market API → Market Serializers: serializes responses
apps/market/views.py - ShareHub Client → ShareHub: fetches quotes
apps/market/clients/sharehub.py - Watchlist API → Watchlist Items: reads and writes
apps/watchlist/views.py - Watchlist API → Watchlist Serializers: serializes responses
apps/watchlist/views.py - Watchlist API → ShareHub Client: requests market data
apps/watchlist/views.py - Trading API → Trading Services: executes trades
apps/trading/views.py - Trading API → Trading Serializers: serializes requests
apps/trading/views.py - Trading Services → ShareHub Client: checks prices
apps/trading/services.py - Trading Services → Wallets and Trades: updates records
apps/trading/services.py - Trading Services → Relational Database: persists trades
apps/trading/services.py - Trading Signals → Wallets and Trades: uses models
apps/trading/signals.py - Trading Signals → Users and OTPs: uses user model
apps/trading/signals.py