How lukasgss/workerservicecrypto works
Key Components
a) External Systems:
• CoinLore API (external data source)
• SQL Server Database
• Hangfire Server
b) Internal Components:
• Worker Service
• API Controllers
• Domain Entities (Coin, Exchange)
• Application Services
• Repositories
Detailed Component Breakdown
Worker Service Section:
• HangfireWorker
• CryptoClient (for CoinLore API communication)
• InternalApiClient
• DatabaseInitializer
API Layer:
• CoinsController
• ExchangesController
• ErrorHandlerMiddleware
Application Layer:
• CoinService
• ExchangeService
• DTOs and Interfaces
Domain Layer:
• Coin Entity
• Exchange Entity
• Money ValueObject
Infrastructure Layer:
• AppDbContext
• Repositories
• Database Configurations
Connection and Flow Representation
• Hourly data flow from CoinLore API → Worker Service → Internal API
• API request flow: Client → API Controllers → Application Services → Repositories → Database
• Dependency flow between layers (following Clean Architecture)
Technical Details to Note
Annotations for:
• .NET Core framework
• Entity Framework Core
• Hangfire scheduling (1-hour interval)
• SQL Server database
• REST API endpoints
• The Clean Architecture pattern
• The separation between the worker service and the main application
• The data flow from external API to internal storage
• The relationship between different layers while maintaining dependency rules
Remember to maintain Clean Architecture's dependency rule: all dependencies should point inward, with the Domain layer having no dependencies on outer layers.