How yamakazeankk/backend-inventory-asset-tracking-system works
Project Type and Purpose
– This is a .NET 8–based microservices system for inventory and asset tracking.
– Domains split into independent Web API services, each encapsulating its own data and logic.
– An API Gateway (Ocelot) fronts all external requests; a SharedKernel library holds reusable DTOs, constants, and interfaces.
File Structure
– Top-level folders = microservices plus shared and gateway:
• AssetService, InventoryService, UserService, AssignmentService, ReportingService, ApiGateway, SharedKernel
– Each service contains Controllers, Program.cs, appsettings, and may include Services, Repositories, Models, Data, Mappings (per README).
– ApiGateway contains ocelot.json, middleware, and configuration.
– SharedKernel is a class library consumed by each service.
Key Insights from README
– Microservices architecture with one service per domain.
– API Gateway handles routing, authentication (JWT), logging.
– Each service uses EF Core, AutoMapper, Swagger (http files) as needed.
Main Components & Relationships
– API Gateway
– AssetService
– InventoryService
– UserService
– AssignmentService
– ReportingService
– SharedKernel (indicate as shared library)
– Databases (one per service)
– External systems (e.g., Authentication provider if separate)
b. Interactions:
– All client requests first hit the API Gateway → routed to appropriate service.
– Services are autonomous; some may call others internally (e.g., AssignmentService calls UserService & AssetService to validate users/assets).
– ReportingService aggregates data; may read from multiple service databases or expose separate endpoints.
c. Architectural Patterns:
– API Gateway pattern (Ocelot) for routing & cross-cutting concerns (auth, logging).
– Domain-driven microservices (one domain one service).
– Shared Kernel for common code.
– Each service follows layered architecture: Controllers → Services → Repositories → Data.
d. Technologies & Frameworks:
– .NET 8 Web API, EF Core (for data), AutoMapper (Mappings), Ocelot (API Gateway).
– JSON config files (appsettings.json, ocelot.json).
– Swagger HTTP definition files (.http) for testing/endpoints.