# gunadecoder/ordermanagement architecture

> Architecture diagram of the GitHub repository gunadecoder/ordermanagement, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gunadecoder/ordermanagement
- Repository: https://github.com/gunadecoder/ordermanagement

## Overview

This is an order-management application with a React client and separate .NET identity, orders, gateway, and notification components. A user registers or logs in, then accesses protected order screens to create, view, update, and delete their orders. Identity issues JWTs; the orders service scopes order operations to the authenticated user and persists orders. The notification service has a hub and an order-created consumer. The README is empty, and gateway routing, order-screen behavior, and event publication are not shown, so those connections are omitted or marked unverified.

Main entry points: [`frontend/order-management-web/src/routes/AppRoutes.jsx`](https://github.com/gunadecoder/ordermanagement/blob/main/frontend/order-management-web/src/routes/AppRoutes.jsx) (App routes), [`backend/src/Services/Identity/OrderManagement.Identity/Controllers/AuthController.cs`](https://github.com/gunadecoder/ordermanagement/blob/main/backend/src/Services/Identity/OrderManagement.Identity/Controllers/AuthController.cs) (Auth endpoints), [`backend/src/Services/Orders/OrderManagement.Orders/Services/OrderService.cs`](https://github.com/gunadecoder/ordermanagement/blob/main/backend/src/Services/Orders/OrderManagement.Orders/Services/OrderService.cs) (Order service), [`frontend/order-management-web/src/features/auth/authService.js`](https://github.com/gunadecoder/ordermanagement/blob/main/frontend/order-management-web/src/features/auth/authService.js) (Auth API service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_routes["App routes<br/>[AppRoutes.jsx]"]
  node_protected["Protected route<br/>[ProtectedRoute.jsx]"]
  node_login["Login and registration<br/>[Login.jsx]"]
  node_authstate["Auth state<br/>[authSlice.js]"]
  node_authservice["Auth API service<br/>[authService.js]"]
  node_apiclient["API client<br/>[api.js]"]
  node_ordersui["Orders screen<br/>[orders.jsx]"]
  node_ordersclient["Orders API service<br/>[orderService.js]"]
  node_signalr["SignalR client<br/>[signalR.js]"]
end

subgraph group_identity["Identity"]
  node_authcontroller["Auth endpoints<br/>[AuthController.cs]"]
  node_token["JWT token service<br/>[TokenService.cs]"]
  node_identitydb[("Identity database")]
end

subgraph group_orders["Order management"]
  node_orderscontroller["Order endpoints"]
  node_orderservice["Order service<br/>[OrderService.cs]"]
  node_orderrepo["Order repository<br/>[OrderRepository.cs]"]
  node_ordersdb[("Orders database<br/>[OrdersDbContext.cs]")]
end

subgraph group_notifications["Notifications"]
  node_eventconsumer["Order-created consumer"]
  node_hub["Notification hub<br/>[NotificationHub.cs]"]
end

subgraph group_shared["Shared contracts"]
  node_event["Order-created event"]
end

node_user(("User"))
node_gateway["API gateway<br/>[Program.cs]"]

node_user -->|"uses"| node_routes
node_routes -->|"routes to"| node_login
node_routes -->|"protects"| node_protected
node_routes -->|"routes to"| node_ordersui
node_login -->|"dispatches"| node_authstate
node_authstate -->|"calls"| node_authservice
node_authservice -->|"sends requests"| node_apiclient
node_authservice -->|"calls auth routes"| node_authcontroller
node_ordersui -.->|"uses"| node_ordersclient
node_ordersclient -->|"sends requests"| node_apiclient
node_apiclient -.->|"routes through"| node_gateway
node_gateway -.->|"forwards requests"| node_authcontroller
node_gateway -.->|"forwards requests"| node_orderscontroller
node_authcontroller -->|"creates tokens"| node_token
node_authcontroller -->|"uses identity store"| node_identitydb
node_orderscontroller -->|"calls"| node_orderservice
node_orderservice -->|"calls"| node_orderrepo
node_orderrepo -->|"reads and writes"| node_ordersdb
node_ordersdb -->|"stores order models"| node_orderservice
node_orderservice -.->|"publishes"| node_event
node_eventconsumer -.->|"consumes"| node_event
node_eventconsumer -.->|"notifies"| node_hub
node_signalr -.->|"connects to"| node_hub

click node_routes "https://github.com/gunadecoder/ordermanagement/blob/main/frontend/order-management-web/src/routes/AppRoutes.jsx"
click node_protected "https://github.com/gunadecoder/ordermanagement/blob/main/frontend/order-management-web/src/components/common/ProtectedRoute.jsx"
click node_login "https://github.com/gunadecoder/ordermanagement/blob/main/frontend/order-management-web/src/pages/Login/Login.jsx"
click node_authstate "https://github.com/gunadecoder/ordermanagement/blob/main/frontend/order-management-web/src/features/auth/authSlice.js"
click node_authservice "https://github.com/gunadecoder/ordermanagement/blob/main/frontend/order-management-web/src/features/auth/authService.js"
click node_apiclient "https://github.com/gunadecoder/ordermanagement/blob/main/frontend/order-management-web/src/services/api.js"
click node_ordersui "https://github.com/gunadecoder/ordermanagement/blob/main/frontend/order-management-web/src/pages/Orders/orders.jsx"
click node_ordersclient "https://github.com/gunadecoder/ordermanagement/blob/main/frontend/order-management-web/src/pages/Orders/orderService.js"
click node_signalr "https://github.com/gunadecoder/ordermanagement/blob/main/frontend/order-management-web/src/services/signalR.js"
click node_gateway "https://github.com/gunadecoder/ordermanagement/blob/main/backend/src/Gateway/OrderManagement.Gateway/Program.cs"
click node_authcontroller "https://github.com/gunadecoder/ordermanagement/blob/main/backend/src/Services/Identity/OrderManagement.Identity/Controllers/AuthController.cs"
click node_token "https://github.com/gunadecoder/ordermanagement/blob/main/backend/src/Services/Identity/OrderManagement.Identity/Services/TokenService.cs"
click node_identitydb "https://github.com/gunadecoder/ordermanagement/blob/main/backend/src/Services/Identity/OrderManagement.Identity/Data/ApplicationDbContext.cs"
click node_orderscontroller "https://github.com/gunadecoder/ordermanagement/blob/main/backend/src/Services/Orders/OrderManagement.Orders/Controllers/OrdersController.cs"
click node_orderservice "https://github.com/gunadecoder/ordermanagement/blob/main/backend/src/Services/Orders/OrderManagement.Orders/Services/OrderService.cs"
click node_orderrepo "https://github.com/gunadecoder/ordermanagement/blob/main/backend/src/Services/Orders/OrderManagement.Orders/Repositories/OrderRepository.cs"
click node_ordersdb "https://github.com/gunadecoder/ordermanagement/blob/main/backend/src/Services/Orders/OrderManagement.Orders/Data/OrdersDbContext.cs"
click node_event "https://github.com/gunadecoder/ordermanagement/blob/main/backend/src/Shared/OrderManagement.Contracts/Events/OrderCreatedEvent.cs"
click node_eventconsumer "https://github.com/gunadecoder/ordermanagement/blob/main/backend/src/Services/Notification/OrderManagement.Notification/Consumers/OrderCreatedConsumer.cs"
click node_hub "https://github.com/gunadecoder/ordermanagement/blob/main/backend/src/Services/Notification/OrderManagement.Notification/Hubs/NotificationHub.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_routes,node_protected,node_login,node_authstate,node_authservice,node_apiclient,node_ordersui,node_ordersclient,node_signalr,node_user toneBlue
class node_authcontroller,node_token,node_identitydb toneAmber
class node_orderscontroller,node_orderservice,node_orderrepo,node_ordersdb,node_gateway toneMint
class node_eventconsumer,node_hub toneRose
class node_event toneIndigo
```

## Components

### Web client

- [App routes](https://github.com/gunadecoder/ordermanagement/blob/main/frontend/order-management-web/src/routes/AppRoutes.jsx): `frontend/order-management-web/src/routes/AppRoutes.jsx`
- [Protected route](https://github.com/gunadecoder/ordermanagement/blob/main/frontend/order-management-web/src/components/common/ProtectedRoute.jsx): `frontend/order-management-web/src/components/common/ProtectedRoute.jsx`
- [Login and registration](https://github.com/gunadecoder/ordermanagement/blob/main/frontend/order-management-web/src/pages/Login/Login.jsx): `frontend/order-management-web/src/pages/Login/Login.jsx`
- [Auth state](https://github.com/gunadecoder/ordermanagement/blob/main/frontend/order-management-web/src/features/auth/authSlice.js): `frontend/order-management-web/src/features/auth/authSlice.js`
- [Auth API service](https://github.com/gunadecoder/ordermanagement/blob/main/frontend/order-management-web/src/features/auth/authService.js): `frontend/order-management-web/src/features/auth/authService.js`
- [API client](https://github.com/gunadecoder/ordermanagement/blob/main/frontend/order-management-web/src/services/api.js): `frontend/order-management-web/src/services/api.js`
- [Orders screen](https://github.com/gunadecoder/ordermanagement/blob/main/frontend/order-management-web/src/pages/Orders/orders.jsx): `frontend/order-management-web/src/pages/Orders/orders.jsx`
- [Orders API service](https://github.com/gunadecoder/ordermanagement/blob/main/frontend/order-management-web/src/pages/Orders/orderService.js): `frontend/order-management-web/src/pages/Orders/orderService.js`
- [SignalR client](https://github.com/gunadecoder/ordermanagement/blob/main/frontend/order-management-web/src/services/signalR.js): `frontend/order-management-web/src/services/signalR.js`

### Identity

- [Auth endpoints](https://github.com/gunadecoder/ordermanagement/blob/main/backend/src/Services/Identity/OrderManagement.Identity/Controllers/AuthController.cs): `backend/src/Services/Identity/OrderManagement.Identity/Controllers/AuthController.cs`
- [JWT token service](https://github.com/gunadecoder/ordermanagement/blob/main/backend/src/Services/Identity/OrderManagement.Identity/Services/TokenService.cs): `backend/src/Services/Identity/OrderManagement.Identity/Services/TokenService.cs`
- [Identity database](https://github.com/gunadecoder/ordermanagement/blob/main/backend/src/Services/Identity/OrderManagement.Identity/Data/ApplicationDbContext.cs): `backend/src/Services/Identity/OrderManagement.Identity/Data/ApplicationDbContext.cs`

### Order management

- [Order endpoints](https://github.com/gunadecoder/ordermanagement/blob/main/backend/src/Services/Orders/OrderManagement.Orders/Controllers/OrdersController.cs): `backend/src/Services/Orders/OrderManagement.Orders/Controllers/OrdersController.cs`
- [Order service](https://github.com/gunadecoder/ordermanagement/blob/main/backend/src/Services/Orders/OrderManagement.Orders/Services/OrderService.cs): `backend/src/Services/Orders/OrderManagement.Orders/Services/OrderService.cs`
- [Order repository](https://github.com/gunadecoder/ordermanagement/blob/main/backend/src/Services/Orders/OrderManagement.Orders/Repositories/OrderRepository.cs): `backend/src/Services/Orders/OrderManagement.Orders/Repositories/OrderRepository.cs`
- [Orders database](https://github.com/gunadecoder/ordermanagement/blob/main/backend/src/Services/Orders/OrderManagement.Orders/Data/OrdersDbContext.cs): `backend/src/Services/Orders/OrderManagement.Orders/Data/OrdersDbContext.cs`

### Notifications

- [Order-created consumer](https://github.com/gunadecoder/ordermanagement/blob/main/backend/src/Services/Notification/OrderManagement.Notification/Consumers/OrderCreatedConsumer.cs): `backend/src/Services/Notification/OrderManagement.Notification/Consumers/OrderCreatedConsumer.cs`
- [Notification hub](https://github.com/gunadecoder/ordermanagement/blob/main/backend/src/Services/Notification/OrderManagement.Notification/Hubs/NotificationHub.cs): `backend/src/Services/Notification/OrderManagement.Notification/Hubs/NotificationHub.cs`

### Shared contracts

- [Order-created event](https://github.com/gunadecoder/ordermanagement/blob/main/backend/src/Shared/OrderManagement.Contracts/Events/OrderCreatedEvent.cs): `backend/src/Shared/OrderManagement.Contracts/Events/OrderCreatedEvent.cs`

### Other components

- **User**
- [API gateway](https://github.com/gunadecoder/ordermanagement/blob/main/backend/src/Gateway/OrderManagement.Gateway/Program.cs): `backend/src/Gateway/OrderManagement.Gateway/Program.cs`

## Connections

- User → App routes: uses (evidence: `frontend/order-management-web/src/routes/AppRoutes.jsx`)
- App routes → Login and registration: routes to (evidence: `frontend/order-management-web/src/routes/AppRoutes.jsx`)
- App routes → Protected route: protects (evidence: `frontend/order-management-web/src/routes/AppRoutes.jsx`)
- App routes → Orders screen: routes to (evidence: `frontend/order-management-web/src/routes/AppRoutes.jsx`)
- Login and registration → Auth state: dispatches (evidence: `frontend/order-management-web/src/pages/Login/Login.jsx`)
- Auth state → Auth API service: calls (evidence: `frontend/order-management-web/src/features/auth/authSlice.js`)
- Auth API service → API client: sends requests (evidence: `frontend/order-management-web/src/features/auth/authService.js`)
- Auth API service → Auth endpoints: calls auth routes (evidence: `frontend/order-management-web/src/features/auth/authService.js`)
- Orders screen → Orders API service: uses
- Orders API service → API client: sends requests (evidence: `frontend/order-management-web/src/pages/Orders/orderService.js`)
- API client → API gateway: routes through
- API gateway → Auth endpoints: forwards requests
- API gateway → Order endpoints: forwards requests
- Auth endpoints → JWT token service: creates tokens (evidence: `backend/src/Services/Identity/OrderManagement.Identity/Controllers/AuthController.cs`)
- Auth endpoints → Identity database: uses identity store
- Order endpoints → Order service: calls (evidence: `backend/src/Services/Orders/OrderManagement.Orders/Controllers/OrdersController.cs`)
- Order service → Order repository: calls (evidence: `backend/src/Services/Orders/OrderManagement.Orders/Services/OrderService.cs`)
- Order repository → Orders database: reads and writes (evidence: `backend/src/Services/Orders/OrderManagement.Orders/Repositories/OrderRepository.cs`)
- Orders database → Order service: stores order models (evidence: `backend/src/Services/Orders/OrderManagement.Orders/Data/OrdersDbContext.cs`)
- Order service → Order-created event: publishes
- Order-created consumer → Order-created event: consumes (evidence: `backend/src/Services/Notification/OrderManagement.Notification/Consumers/OrderCreatedConsumer.cs`)
- Order-created consumer → Notification hub: notifies (evidence: `backend/src/Services/Notification/OrderManagement.Notification/Consumers/OrderCreatedConsumer.cs`)
- SignalR client → Notification hub: connects to
