# hung2004-web/sep490_g66 architecture

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

- Interactive diagram: https://gitdiagram.com/hung2004-web/sep490_g66
- Repository: https://github.com/hung2004-web/sep490_g66

## Overview

The repository is titled SEP490_G66; the sampled implementation is an OZE clinic frontend shell and a backend centered on account authentication and profile retrieval. The principal backend workflow is registration/login, token issuance and refresh, email confirmation, and logout; authenticated profile lookup is a separate path. The README provides no capability details, and the frontend API wiring and several implementations were not sampled, so uncertain connections are omitted.

Main entry points: [`oze-clinic-be/OZE.Application/Services/AuthService.cs`](https://github.com/hung2004-web/sep490_g66/blob/main/oze-clinic-be/OZE.Application/Services/AuthService.cs) (Auth workflows), [`oze-clinic-be/OZE.ProjectBase/Controllers/AuthController.cs`](https://github.com/hung2004-web/sep490_g66/blob/main/oze-clinic-be/OZE.ProjectBase/Controllers/AuthController.cs) (Auth endpoints), [`oze-clinic-be/OZE.Persistence/Repositories/UserRefreshTokenRepository.cs`](https://github.com/hung2004-web/sep490_g66/blob/main/oze-clinic-be/OZE.Persistence/Repositories/UserRefreshTokenRepository.cs) (Refresh token repository), [`oze-clinic-be/OZE.ProjectBase/Program.cs`](https://github.com/hung2004-web/sep490_g66/blob/main/oze-clinic-be/OZE.ProjectBase/Program.cs) (API host)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend"]
  node_routes["App routes<br/>[AppRoutes.jsx]"]
  node_home["Home page<br/>[HomePage.jsx]"]
end

subgraph group_api["API and application"]
  node_program["API host<br/>[Program.cs]"]
  node_authcontroller["Auth endpoints<br/>[AuthController.cs]"]
  node_mecontroller["Profile endpoint<br/>[MeController.cs]"]
  node_authservice["Auth workflows<br/>[AuthService.cs]"]
  node_userservice["User profiles<br/>[UserService.cs]"]
  node_jwt["JWT generator"]
  node_email["Email sender<br/>[EmailSender.cs]"]
end

subgraph group_identity["Identity and persistence"]
  node_identity["ASP.NET Identity"]
  node_registration["Persistence setup"]
  node_repository["Refresh token repository"]
  node_context["Identity context"]
  node_database[("Application database")]
end

node_user(("User"))

node_user -->|"opens"| node_routes
node_routes -->|"renders"| node_home
node_user -->|"requests auth"| node_authcontroller
node_program -->|"maps controllers"| node_authcontroller
node_program -->|"maps controllers"| node_mecontroller
node_authcontroller -->|"calls"| node_authservice
node_mecontroller -->|"calls"| node_userservice
node_authservice -->|"manages accounts"| node_identity
node_authservice -->|"generates tokens"| node_jwt
node_authservice -->|"stores tokens"| node_repository
node_authservice -->|"sends confirmation"| node_email
node_userservice -->|"reads accounts"| node_identity
node_registration -->|"configures stores"| node_identity
node_registration -->|"registers"| node_repository
node_repository -->|"queries and saves"| node_context
node_context -->|"reads and writes"| node_database

click node_routes "https://github.com/hung2004-web/sep490_g66/blob/main/oze-clinic-fe/src/routes/AppRoutes.jsx"
click node_home "https://github.com/hung2004-web/sep490_g66/blob/main/oze-clinic-fe/src/pages/common/HomePage.jsx"
click node_program "https://github.com/hung2004-web/sep490_g66/blob/main/oze-clinic-be/OZE.ProjectBase/Program.cs"
click node_authcontroller "https://github.com/hung2004-web/sep490_g66/blob/main/oze-clinic-be/OZE.ProjectBase/Controllers/AuthController.cs"
click node_mecontroller "https://github.com/hung2004-web/sep490_g66/blob/main/oze-clinic-be/OZE.ProjectBase/Controllers/MeController.cs"
click node_authservice "https://github.com/hung2004-web/sep490_g66/blob/main/oze-clinic-be/OZE.Application/Services/AuthService.cs"
click node_userservice "https://github.com/hung2004-web/sep490_g66/blob/main/oze-clinic-be/OZE.Application/Services/UserService.cs"
click node_jwt "https://github.com/hung2004-web/sep490_g66/blob/main/oze-clinic-be/OZE.Application/Services/JwtTokenGenerator.cs"
click node_email "https://github.com/hung2004-web/sep490_g66/blob/main/oze-clinic-be/OZE.Application/Services/EmailSender.cs"
click node_registration "https://github.com/hung2004-web/sep490_g66/blob/main/oze-clinic-be/OZE.Persistence/PersistenceServiceRegistration.cs"
click node_repository "https://github.com/hung2004-web/sep490_g66/blob/main/oze-clinic-be/OZE.Persistence/Repositories/UserRefreshTokenRepository.cs"
click node_context "https://github.com/hung2004-web/sep490_g66/blob/main/oze-clinic-be/OZE.Persistence/DbContexts/AppIdentityDbContext.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_home,node_user toneBlue
class node_program,node_authcontroller,node_mecontroller,node_authservice,node_userservice,node_jwt,node_email toneAmber
class node_identity,node_registration,node_repository,node_context,node_database toneMint
```

## Components

### Frontend

- [App routes](https://github.com/hung2004-web/sep490_g66/blob/main/oze-clinic-fe/src/routes/AppRoutes.jsx): `oze-clinic-fe/src/routes/AppRoutes.jsx`
- [Home page](https://github.com/hung2004-web/sep490_g66/blob/main/oze-clinic-fe/src/pages/common/HomePage.jsx): `oze-clinic-fe/src/pages/common/HomePage.jsx`

### API and application

- [API host](https://github.com/hung2004-web/sep490_g66/blob/main/oze-clinic-be/OZE.ProjectBase/Program.cs): `oze-clinic-be/OZE.ProjectBase/Program.cs`
- [Auth endpoints](https://github.com/hung2004-web/sep490_g66/blob/main/oze-clinic-be/OZE.ProjectBase/Controllers/AuthController.cs): `oze-clinic-be/OZE.ProjectBase/Controllers/AuthController.cs`
- [Profile endpoint](https://github.com/hung2004-web/sep490_g66/blob/main/oze-clinic-be/OZE.ProjectBase/Controllers/MeController.cs): `oze-clinic-be/OZE.ProjectBase/Controllers/MeController.cs`
- [Auth workflows](https://github.com/hung2004-web/sep490_g66/blob/main/oze-clinic-be/OZE.Application/Services/AuthService.cs): `oze-clinic-be/OZE.Application/Services/AuthService.cs`
- [User profiles](https://github.com/hung2004-web/sep490_g66/blob/main/oze-clinic-be/OZE.Application/Services/UserService.cs): `oze-clinic-be/OZE.Application/Services/UserService.cs`
- [JWT generator](https://github.com/hung2004-web/sep490_g66/blob/main/oze-clinic-be/OZE.Application/Services/JwtTokenGenerator.cs): `oze-clinic-be/OZE.Application/Services/JwtTokenGenerator.cs`
- [Email sender](https://github.com/hung2004-web/sep490_g66/blob/main/oze-clinic-be/OZE.Application/Services/EmailSender.cs): `oze-clinic-be/OZE.Application/Services/EmailSender.cs`

### Identity and persistence

- **ASP.NET Identity**
- [Persistence setup](https://github.com/hung2004-web/sep490_g66/blob/main/oze-clinic-be/OZE.Persistence/PersistenceServiceRegistration.cs): `oze-clinic-be/OZE.Persistence/PersistenceServiceRegistration.cs`
- [Refresh token repository](https://github.com/hung2004-web/sep490_g66/blob/main/oze-clinic-be/OZE.Persistence/Repositories/UserRefreshTokenRepository.cs): `oze-clinic-be/OZE.Persistence/Repositories/UserRefreshTokenRepository.cs`
- [Identity context](https://github.com/hung2004-web/sep490_g66/blob/main/oze-clinic-be/OZE.Persistence/DbContexts/AppIdentityDbContext.cs): `oze-clinic-be/OZE.Persistence/DbContexts/AppIdentityDbContext.cs`
- **Application database**

### Other components

- **User**

## Connections

- User → App routes: opens
- App routes → Home page: renders
- User → Auth endpoints: requests auth
- API host → Auth endpoints: maps controllers
- API host → Profile endpoint: maps controllers
- Auth endpoints → Auth workflows: calls
- Profile endpoint → User profiles: calls
- Auth workflows → ASP.NET Identity: manages accounts
- Auth workflows → JWT generator: generates tokens
- Auth workflows → Refresh token repository: stores tokens
- Auth workflows → Email sender: sends confirmation
- User profiles → ASP.NET Identity: reads accounts
- Persistence setup → ASP.NET Identity: configures stores
- Persistence setup → Refresh token repository: registers
- Refresh token repository → Identity context: queries and saves
- Identity context → Application database: reads and writes
