# jtg-induction/dot-net-assignment-shivam-rao-uid00817 architecture

> Architecture diagram of the GitHub repository jtg-induction/dot-net-assignment-shivam-rao-uid00817, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jtg-induction/dot-net-assignment-shivam-rao-uid00817
- Repository: https://github.com/jtg-induction/dot-net-assignment-shivam-rao-uid00817

## Overview

This is an ASP.NET Web API backend for restaurant management. The evidenced runtime workflow centers on account registration and login: API clients call authentication endpoints, services validate users and manage refresh tokens, and repositories persist changes through Entity Framework. Bearer-token middleware validates protected requests; user endpoints support account updates and deactivation, including revoking refresh tokens. The README describes restaurant browsing, ordering, owner order management, restaurant onboarding, and analytics, but the tree exposes only their data models—not corresponding runtime modules. Those capabilities and reports therefore cannot be mapped as implemented flows from the available evidence.

Main entry points: [`Dot-Net-Assignment-Shivam-Rao-UID00817/Services/AuthService.cs`](https://github.com/jtg-induction/dot-net-assignment-shivam-rao-uid00817/blob/main/Dot-Net-Assignment-Shivam-Rao-UID00817/Services/AuthService.cs) (Authentication service), [`Dot-Net-Assignment-Shivam-Rao-UID00817/Restaurant_ManagementContext.cs`](https://github.com/jtg-induction/dot-net-assignment-shivam-rao-uid00817/blob/main/Dot-Net-Assignment-Shivam-Rao-UID00817/Restaurant_ManagementContext.cs) (Entity Framework context), [`Dot-Net-Assignment-Shivam-Rao-UID00817/Services/UserService.cs`](https://github.com/jtg-induction/dot-net-assignment-shivam-rao-uid00817/blob/main/Dot-Net-Assignment-Shivam-Rao-UID00817/Services/UserService.cs) (Account service), [`Dot-Net-Assignment-Shivam-Rao-UID00817/Repositories/UserRepository.cs`](https://github.com/jtg-induction/dot-net-assignment-shivam-rao-uid00817/blob/main/Dot-Net-Assignment-Shivam-Rao-UID00817/Repositories/UserRepository.cs) (User repository)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API endpoints"]
  node_auth_controller["Auth endpoints<br/>[AuthController.cs]"]
  node_user_controller["User endpoints<br/>[UserController.cs]"]
end

subgraph group_identity["Identity"]
  node_auth_service["Authentication service<br/>[AuthService.cs]"]
  node_user_service["Account service<br/>[UserService.cs]"]
  node_auth_middleware["Bearer middleware"]
  node_jwt["JWT utilities<br/>[JWTUtil.cs]"]
  node_hashing["Password hashing<br/>[HashingHelper.cs]"]
end

subgraph group_persistence["Persistence"]
  node_user_repo["User repository<br/>[UserRepository.cs]"]
  node_token_repo["Refresh token repository"]
  node_unit_of_work["Unit of work<br/>[UnitOfWork.cs]"]
  node_db_context[("Entity Framework context")]
end

subgraph group_domain["Restaurant domain"]
  node_restaurant_models["Restaurant and order entities<br/>[Restaurants.cs]"]
  node_user_model["User entity<br/>[Users.cs]"]
  node_token_model["Refresh token entity<br/>[Refresh_Tokens.cs]"]
end

node_client(("API client"))
node_sql_server[("SQL Server")]

node_client -->|"calls auth routes"| node_auth_controller
node_client -->|"calls account routes"| node_user_controller
node_auth_controller -->|"delegates auth"| node_auth_service
node_user_controller -->|"delegates account actions"| node_user_service
node_auth_service -->|"checks and reads users"| node_user_repo
node_auth_service -->|"manages refresh tokens"| node_token_repo
node_auth_service -->|"saves changes"| node_unit_of_work
node_auth_service -->|"verifies password"| node_hashing
node_auth_service -->|"creates tokens"| node_jwt
node_user_service -->|"updates users"| node_user_repo
node_user_service -->|"revokes all sessions"| node_auth_service
node_user_service -->|"saves changes"| node_unit_of_work
node_auth_middleware -->|"validates bearer token"| node_jwt
node_user_repo -->|"queries and tracks users"| node_db_context
node_token_repo -->|"queries and tracks tokens"| node_db_context
node_unit_of_work -->|"commits changes"| node_db_context
node_db_context -->|"persists entities"| node_sql_server
node_db_context -->|"maps users"| node_user_model
node_db_context -->|"maps refresh tokens"| node_token_model
node_db_context -->|"maps domain entities"| node_restaurant_models

click node_auth_controller "https://github.com/jtg-induction/dot-net-assignment-shivam-rao-uid00817/blob/main/Dot-Net-Assignment-Shivam-Rao-UID00817/Controllers/AuthController.cs"
click node_user_controller "https://github.com/jtg-induction/dot-net-assignment-shivam-rao-uid00817/blob/main/Dot-Net-Assignment-Shivam-Rao-UID00817/Controllers/UserController.cs"
click node_auth_service "https://github.com/jtg-induction/dot-net-assignment-shivam-rao-uid00817/blob/main/Dot-Net-Assignment-Shivam-Rao-UID00817/Services/AuthService.cs"
click node_user_service "https://github.com/jtg-induction/dot-net-assignment-shivam-rao-uid00817/blob/main/Dot-Net-Assignment-Shivam-Rao-UID00817/Services/UserService.cs"
click node_auth_middleware "https://github.com/jtg-induction/dot-net-assignment-shivam-rao-uid00817/blob/main/Dot-Net-Assignment-Shivam-Rao-UID00817/Middlewares/AuthenticationMiddleware.cs"
click node_jwt "https://github.com/jtg-induction/dot-net-assignment-shivam-rao-uid00817/blob/main/Dot-Net-Assignment-Shivam-Rao-UID00817/Utils/JWTUtil.cs"
click node_hashing "https://github.com/jtg-induction/dot-net-assignment-shivam-rao-uid00817/blob/main/Dot-Net-Assignment-Shivam-Rao-UID00817/Helpers/HashingHelper.cs"
click node_user_repo "https://github.com/jtg-induction/dot-net-assignment-shivam-rao-uid00817/blob/main/Dot-Net-Assignment-Shivam-Rao-UID00817/Repositories/UserRepository.cs"
click node_token_repo "https://github.com/jtg-induction/dot-net-assignment-shivam-rao-uid00817/blob/main/Dot-Net-Assignment-Shivam-Rao-UID00817/Repositories/RefreshTokenRepository.cs"
click node_unit_of_work "https://github.com/jtg-induction/dot-net-assignment-shivam-rao-uid00817/blob/main/Dot-Net-Assignment-Shivam-Rao-UID00817/Repositories/UnitOfWork.cs"
click node_db_context "https://github.com/jtg-induction/dot-net-assignment-shivam-rao-uid00817/blob/main/Dot-Net-Assignment-Shivam-Rao-UID00817/Restaurant_ManagementContext.cs"
click node_restaurant_models "https://github.com/jtg-induction/dot-net-assignment-shivam-rao-uid00817/blob/main/Dot-Net-Assignment-Shivam-Rao-UID00817/Models/Restaurants.cs"
click node_user_model "https://github.com/jtg-induction/dot-net-assignment-shivam-rao-uid00817/blob/main/Dot-Net-Assignment-Shivam-Rao-UID00817/Models/Users.cs"
click node_token_model "https://github.com/jtg-induction/dot-net-assignment-shivam-rao-uid00817/blob/main/Dot-Net-Assignment-Shivam-Rao-UID00817/Models/Refresh_Tokens.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_auth_controller,node_user_controller,node_client toneBlue
class node_auth_service,node_user_service,node_auth_middleware,node_jwt,node_hashing,node_sql_server toneAmber
class node_user_repo,node_token_repo,node_unit_of_work,node_db_context toneMint
class node_restaurant_models,node_user_model,node_token_model toneRose
```

## Components

### API endpoints

- [Auth endpoints](https://github.com/jtg-induction/dot-net-assignment-shivam-rao-uid00817/blob/main/Dot-Net-Assignment-Shivam-Rao-UID00817/Controllers/AuthController.cs): `Dot-Net-Assignment-Shivam-Rao-UID00817/Controllers/AuthController.cs`
- [User endpoints](https://github.com/jtg-induction/dot-net-assignment-shivam-rao-uid00817/blob/main/Dot-Net-Assignment-Shivam-Rao-UID00817/Controllers/UserController.cs): `Dot-Net-Assignment-Shivam-Rao-UID00817/Controllers/UserController.cs`

### Identity

- [Authentication service](https://github.com/jtg-induction/dot-net-assignment-shivam-rao-uid00817/blob/main/Dot-Net-Assignment-Shivam-Rao-UID00817/Services/AuthService.cs): `Dot-Net-Assignment-Shivam-Rao-UID00817/Services/AuthService.cs`
- [Account service](https://github.com/jtg-induction/dot-net-assignment-shivam-rao-uid00817/blob/main/Dot-Net-Assignment-Shivam-Rao-UID00817/Services/UserService.cs): `Dot-Net-Assignment-Shivam-Rao-UID00817/Services/UserService.cs`
- [Bearer middleware](https://github.com/jtg-induction/dot-net-assignment-shivam-rao-uid00817/blob/main/Dot-Net-Assignment-Shivam-Rao-UID00817/Middlewares/AuthenticationMiddleware.cs): `Dot-Net-Assignment-Shivam-Rao-UID00817/Middlewares/AuthenticationMiddleware.cs`
- [JWT utilities](https://github.com/jtg-induction/dot-net-assignment-shivam-rao-uid00817/blob/main/Dot-Net-Assignment-Shivam-Rao-UID00817/Utils/JWTUtil.cs): `Dot-Net-Assignment-Shivam-Rao-UID00817/Utils/JWTUtil.cs`
- [Password hashing](https://github.com/jtg-induction/dot-net-assignment-shivam-rao-uid00817/blob/main/Dot-Net-Assignment-Shivam-Rao-UID00817/Helpers/HashingHelper.cs): `Dot-Net-Assignment-Shivam-Rao-UID00817/Helpers/HashingHelper.cs`

### Persistence

- [User repository](https://github.com/jtg-induction/dot-net-assignment-shivam-rao-uid00817/blob/main/Dot-Net-Assignment-Shivam-Rao-UID00817/Repositories/UserRepository.cs): `Dot-Net-Assignment-Shivam-Rao-UID00817/Repositories/UserRepository.cs`
- [Refresh token repository](https://github.com/jtg-induction/dot-net-assignment-shivam-rao-uid00817/blob/main/Dot-Net-Assignment-Shivam-Rao-UID00817/Repositories/RefreshTokenRepository.cs): `Dot-Net-Assignment-Shivam-Rao-UID00817/Repositories/RefreshTokenRepository.cs`
- [Unit of work](https://github.com/jtg-induction/dot-net-assignment-shivam-rao-uid00817/blob/main/Dot-Net-Assignment-Shivam-Rao-UID00817/Repositories/UnitOfWork.cs): `Dot-Net-Assignment-Shivam-Rao-UID00817/Repositories/UnitOfWork.cs`
- [Entity Framework context](https://github.com/jtg-induction/dot-net-assignment-shivam-rao-uid00817/blob/main/Dot-Net-Assignment-Shivam-Rao-UID00817/Restaurant_ManagementContext.cs): `Dot-Net-Assignment-Shivam-Rao-UID00817/Restaurant_ManagementContext.cs`

### Restaurant domain

- [Restaurant and order entities](https://github.com/jtg-induction/dot-net-assignment-shivam-rao-uid00817/blob/main/Dot-Net-Assignment-Shivam-Rao-UID00817/Models/Restaurants.cs): `Dot-Net-Assignment-Shivam-Rao-UID00817/Models/Restaurants.cs`
- [User entity](https://github.com/jtg-induction/dot-net-assignment-shivam-rao-uid00817/blob/main/Dot-Net-Assignment-Shivam-Rao-UID00817/Models/Users.cs): `Dot-Net-Assignment-Shivam-Rao-UID00817/Models/Users.cs`
- [Refresh token entity](https://github.com/jtg-induction/dot-net-assignment-shivam-rao-uid00817/blob/main/Dot-Net-Assignment-Shivam-Rao-UID00817/Models/Refresh_Tokens.cs): `Dot-Net-Assignment-Shivam-Rao-UID00817/Models/Refresh_Tokens.cs`

### Other components

- **API client**
- **SQL Server**

## Connections

- API client → Auth endpoints: calls auth routes
- API client → User endpoints: calls account routes
- Auth endpoints → Authentication service: delegates auth
- User endpoints → Account service: delegates account actions
- Authentication service → User repository: checks and reads users
- Authentication service → Refresh token repository: manages refresh tokens
- Authentication service → Unit of work: saves changes
- Authentication service → Password hashing: verifies password
- Authentication service → JWT utilities: creates tokens
- Account service → User repository: updates users
- Account service → Authentication service: revokes all sessions
- Account service → Unit of work: saves changes
- Bearer middleware → JWT utilities: validates bearer token
- User repository → Entity Framework context: queries and tracks users
- Refresh token repository → Entity Framework context: queries and tracks tokens
- Unit of work → Entity Framework context: commits changes
- Entity Framework context → SQL Server: persists entities
- Entity Framework context → User entity: maps users
- Entity Framework context → Refresh token entity: maps refresh tokens
- Entity Framework context → Restaurant and order entities: maps domain entities
