How krishanth7/agent works
NIFTY Agent is a monitoring dashboard for an autonomous-trading concept, but this repository does not execute trades: displayed account and performance figures are mock or seeded data, while monthly targets persist in PostgreSQL/TimescaleDB. The main workflow is browser dashboard → HTTP API → services that read and derive account, target, performance, and calendar views → displayed cards. Exchange hours, holidays, and theme behavior are frontend-side. An explicitly configured, read-only Angel One connection test is a separate optional integration. Backend wiring beyond the sampled source is represented only where documented by the README or module descriptions.
Main entry points: v1 Dashboard routes · Dashboard.tsx Dashboard view · performance_service.py Performance service · postgres Postgres repositories
Components 22
Dashboard frontend
- Dashboard view
src/components/dashboard/Dashboard.tsx - Dashboard cards
src/components/dashboard - Market clock
src/lib/market.ts - Theme controls
src/lib/theme.ts - API resource state
src/hooks/useApiResource.ts - HTTP client
src/lib/api/client.ts - API resource modules
src/lib/api
API and services
- FastAPI application
backend/app/main.py - API route dispatch
backend/app/api/router.py - Dashboard routes
backend/app/api/v1 - Account service
backend/app/services/account_service.py - Target service
backend/app/services/target_service.py - Performance service
backend/app/services/performance_service.py - Domain calculations
backend/app/domain/calculations.py - Agent service
backend/app/services/agent_service.py
Data and persistence
- Mock repositories
backend/app/repositories/mock - Postgres repositories
backend/app/repositories/postgres - PostgreSQL / TimescaleDB
backend/app/db
Broker integration
- Broker service
backend/app/services/broker_service.py - Angel One adapter
backend/app/brokers/angel_one/adapter.py
Other components
- Dashboard user
- Angel One
Connections 23
- Dashboard user → Dashboard view: views
- Dashboard view → Dashboard cards: renders
- Dashboard view → Market clock: reads locally
- Dashboard view → Theme controls: toggles
- Dashboard cards → API resource state: loads data
- API resource state → API resource modules: invokes
- API resource modules → HTTP client: requests via
- HTTP client → FastAPI application: HTTP requests
- FastAPI application → API route dispatch: includes
- API route dispatch → Dashboard routes: dispatches
- Dashboard routes → Account service: invokes
- Dashboard routes → Target service: invokes
- Dashboard routes → Performance service: invokes
- Dashboard routes → Agent service: invokes
- Dashboard routes → Broker service: invokes
- Account service → Mock repositories: reads
- Target service → Postgres repositories: reads / writes
- Performance service → Mock repositories: reads
- Performance service → Postgres repositories: reads
- Performance service → Domain calculations: derives metrics
- Postgres repositories → PostgreSQL / TimescaleDB: reads / writes
- Broker service → Angel One adapter: creates / queries
- Angel One adapter → Angel One: read-only requests