How harjuniya/authservice works
This repository contains three ASP.NET services for user authentication, product inventory, and order management. The main user workflow is registering or logging in to obtain a JWT, then using it to access product and order APIs; administrators also manage products, while users create, view, and cancel orders. The sampled order logic persists orders but does not call the registered inventory client, so no order-to-inventory runtime link is asserted.
Main entry points: ProductController.cs Product API · AuthService.cs Auth logic · OrderController.cs Order API · AuthController.cs Auth API
Components 15
Authentication
- Auth API
AuthService/Controllers/AuthController.cs - Auth logic
AuthService/Services/AuthService.cs - User repository
AuthService/Repositories/UserRepository.cs - Auth database
AuthService/Data/AuthDbContext.cs - JWT token
Inventory
- Product API
InventoryService/Controllers/ProductController.cs - Product service
InventoryService/Services/ProductService.cs - Product repository
InventoryService/Repositories/ProductRepository.cs - Inventory database
InventoryService/Data/InventoryDbContext.cs
Orders
- Order API
OrderService/Controllers/OrderController.cs - Order service
OrderService/Services/OrderService.cs - Order repository
OrderService/Repositories/OrderRepository.cs - Order database
OrderService/Data/OrderDbContext.cs
Other components
- User
- Administrator
Connections 16
- User → Auth API: registers or logs in
- Auth API → Auth logic: calls
- Auth logic → User repository: reads and saves users
- User repository → Auth database: queries and writes
- Auth logic → JWT token: issues token
- User → Product API: requests products
- Administrator → Product API: manages products
- Product API → Product service: calls
- Product service → Product repository: loads and changes products
- Product repository → Inventory database: queries and writes
- User → Order API: requests orders
- Order API → Order service: calls
- Order service → Order repository: loads and saves orders
- Order repository → Order database: queries and writes
- JWT token → Product API: authorizes requests
- JWT token → Order API: authorizes requests