How renako223678/sneakershop works
Sneaker Shop is a .NET microservices e-commerce backend. The main purchase flow is client → gateway → order creation: Ordering requests authoritative variant prices from Catalog, saves a pending order, and publishes an event; Inventory reserves stock and reports the outcome to Ordering. Cancellation and shipping trigger inventory compensation or deduction. The graph also preserves identity, catalog management, inventory queries, and shared contracts. Cross-service event and HTTP links follow the README; several consumer implementations were not sampled, so those links are documented rather than source-verified.
Main entry points: SneakersController.cs Catalog API · OrderService.cs Order lifecycle · Program.cs API gateway · AuthController.cs Identity API
Components 23
Public access
- API gateway
src/Gateway/ApiGateway/Program.cs
Identity
- Identity API
src/Services/Identity/Identity.Api/Controllers/AuthController.cs - Identity database
src/Services/Identity/Identity.Api/Data/AuthDbContext.cs - JWT issuance
src/Services/Identity/Identity.Api/Services/TokenService.cs
Product catalog
- Catalog API
src/Services/Catalog/Catalog.Api/Controllers/SneakersController.cs - Brand management
src/Services/Catalog/Catalog.Api/Controllers/BrandsController.cs - Internal variant lookup
src/Services/Catalog/Catalog.Api/Controllers/InternalVariantsController.cs - Catalog database
src/Services/Catalog/Catalog.Api/Data/CatalogDbContext.cs
Orders and stock
- Order endpoints
src/Services/Ordering/Ordering.Api/Controllers/OrdersController.cs - Order lifecycle
src/Services/Ordering/Ordering.Api/Services/OrderService.cs - Catalog HTTP client
src/Services/Ordering/Ordering.Api/Services/CatalogClient.cs - Order database
src/Services/Ordering/Ordering.Api/Data/OrderDbContext.cs - Stock result handlers
src/Services/Ordering/Ordering.Api/Consumers/StockReservedConsumer.cs - Inventory endpoints
src/Services/Inventory/Inventory.Api/Controllers/InventoryController.cs - Inventory event handlers
src/Services/Inventory/Inventory.Api/Consumers/OrderCreatedConsumer.cs - Inventory database
src/Services/Inventory/Inventory.Api/Data/InventoryDbContext.cs
Shared infrastructure
- Event contracts
src/BuildingBlocks/SneakerShop.BuildingBlocks/Contracts/Events.cs - Catalog lookup contract
src/BuildingBlocks/SneakerShop.BuildingBlocks/Contracts/CatalogLookup.cs - Shared auth conventions
src/BuildingBlocks/SneakerShop.BuildingBlocks/Common/Roles.cs - Error handling
src/BuildingBlocks/SneakerShop.BuildingBlocks/Common/AppException.cs - Catalog seed data
src/BuildingBlocks/SneakerShop.BuildingBlocks/Seed/SeedCatalog.cs
Other components
- Shop client
- RabbitMQ
Connections 29
- Shop client → API gateway: sends requests
- API gateway → Identity API: routes auth
- API gateway → Catalog API: routes catalog
- API gateway → Inventory endpoints: routes inventory
- API gateway → Order endpoints: routes orders
- Identity API → Identity database: reads and writes
src/Services/Identity/Identity.Api/Controllers/AuthController.cs - Identity API → JWT issuance: issues tokens
src/Services/Identity/Identity.Api/Controllers/AuthController.cs - Identity API → Shared auth conventions: uses roles
src/Services/Identity/Identity.Api/Controllers/AuthController.cs - Catalog API → Catalog database: reads and writes
src/Services/Catalog/Catalog.Api/Controllers/SneakersController.cs - Brand management → Catalog database: reads and writes
src/Services/Catalog/Catalog.Api/Controllers/BrandsController.cs - Internal variant lookup → Catalog database: reads variants
src/Services/Catalog/Catalog.Api/Controllers/InternalVariantsController.cs - Catalog API → RabbitMQ: publishes variant event
src/Services/Catalog/Catalog.Api/Controllers/SneakersController.cs - Order endpoints → Order lifecycle: delegates requests
src/Services/Ordering/Ordering.Api/Controllers/OrdersController.cs - Order lifecycle → Catalog HTTP client: requests prices
src/Services/Ordering/Ordering.Api/Services/OrderService.cs - Catalog HTTP client → Internal variant lookup: looks up variants
- Order lifecycle → Order database: reads and writes
src/Services/Ordering/Ordering.Api/Services/OrderService.cs - Order lifecycle → RabbitMQ: publishes order events
src/Services/Ordering/Ordering.Api/Services/OrderService.cs - RabbitMQ → Inventory event handlers: delivers order events
- Inventory event handlers → Inventory database: reserves or adjusts stock
src/Services/Inventory/Inventory.Api/Consumers/OrderCreatedConsumer.cs - Inventory event handlers → RabbitMQ: publishes stock result
- RabbitMQ → Stock result handlers: delivers stock result
- Stock result handlers → Order database: updates order state
src/Services/Ordering/Ordering.Api/Consumers/StockReservedConsumer.cs - Inventory endpoints → Inventory database: reads and writes
src/Services/Inventory/Inventory.Api/Controllers/InventoryController.cs - Catalog API → Event contracts: publishes contract
src/Services/Catalog/Catalog.Api/Controllers/SneakersController.cs - Order lifecycle → Event contracts: publishes contracts
src/Services/Ordering/Ordering.Api/Services/OrderService.cs - Catalog HTTP client → Catalog lookup contract: uses lookup contract
- Catalog API → Error handling: raises API errors
src/Services/Catalog/Catalog.Api/Controllers/SneakersController.cs - Order lifecycle → Error handling: raises API errors
src/Services/Ordering/Ordering.Api/Services/OrderService.cs - Catalog API → Catalog seed data