How naamaevenozz/investments-simulator works
Investment Simulator lets a user choose a virtual investment, submit it for queued processing, and see account changes and completion notifications in real time. The client fetches account data and investment options over HTTP, while SignalR carries live updates; the server validates and queues requests, persists investments, and processes their completion. The graph includes the principal domain models and the database layer. Some relationships are based on the supplied source index or README because those source excerpts were not provided.
Main entry points: InvestmentService.cs Investment service · InvestmentController.cs Investment API · App.tsx Investment UI · InvestmentQueueWorker.cs Queue worker
Components 16
Client
- Investment UI
investments-client/src/App.tsx - Web vitals
investments-client/src/reportWebVitals.ts
API and realtime
- Investment API
investments-server/Controllers/InvestmentController.cs - Update hub
investments-server/Hubs/InvestmentHub.cs
Investment processing
- Request queue
investments-server/Services/InvestmentQueue.cs - Queue worker
investments-server/Services/InvestmentQueueWorker.cs - Completion monitor
investments-server/Services/InvestmentBackgroundService.cs
Domain and persistence
- Investment service
investments-server/Services/InvestmentService.cs - Database context
investments-server/Data/InvestmentDbContext.cs - SQLite database
investments-server/investments.db - Investment request
investments-server/Models/InvestRequest.cs - Investment option
investments-server/Models/InvestmentOption.cs - User account
investments-server/Models/UserAccount.cs - Active investment
investments-server/Models/ActiveInvestment.cs - Investment fields
investments-server/Models/BaseInvestment.cs
Other components
- Investor
Connections 20
- Investor → Investment UI: uses
README.md - Investment UI → Investment API: requests data
investments-client/src/App.tsx - Investment UI → Investment API: submits investment
investments-client/src/App.tsx - Investment UI → Update hub: subscribes
investments-client/src/App.tsx - Investment API → Investment service: fetches account
investments-server/Controllers/InvestmentController.cs - Investment API → Investment service: validates request
investments-server/Controllers/InvestmentController.cs - Investment API → Request queue: enqueues request
investments-server/Controllers/InvestmentController.cs - Request queue → Investment request: stores request
investments-server/Services/InvestmentQueue.cs - Queue worker → Request queue: dequeues request
investments-server/Services/InvestmentQueueWorker.cs - Queue worker → Investment service: starts investment
investments-server/Services/InvestmentQueueWorker.cs - Queue worker → Update hub: sends updates
investments-server/Services/InvestmentQueueWorker.cs - Completion monitor → Investment service: checks completion
investments-server/Services/InvestmentBackgroundService.cs - Completion monitor → Update hub: sends completion
investments-server/Services/InvestmentBackgroundService.cs - Investment service → Database context: reads and writes
investments-server/Services/InvestmentService.cs - Database context → SQLite database: persists data
- Investment service → Investment option: uses options
investments-server/Services/InvestmentService.cs - Investment service → User account: loads account
investments-server/Services/InvestmentService.cs - Investment service → Active investment: creates and completes
investments-server/Services/InvestmentService.cs - Active investment → Investment fields: inherits fields
investments-server/Models/ActiveInvestment.cs - User account → Active investment: holds investments
investments-server/Models/UserAccount.cs