# tuanduy35399/mydognet architecture

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

- Interactive diagram: https://gitdiagram.com/tuanduy35399/mydognet
- Repository: https://github.com/tuanduy35399/mydognet

## Overview

MyDogNet is a web portfolio with public profile and post browsing, plus an authenticated admin area for account and post management. Visitors browse paginated/searchable posts or open a detail page; admins sign in, then manage posts and accounts. Post content can include images uploaded to Cloudinary before submission, as documented in the README. The excerpts show the post API’s database operations and the account repository’s JWT flow; some frontend and upload wiring is represented only by the tree or README, so uncertain links are omitted or marked dashed.

Main entry points: [`front-end/src/App.jsx`](https://github.com/tuanduy35399/mydognet/blob/main/front-end/src/App.jsx) (Page routing), [`front-end/api.js`](https://github.com/tuanduy35399/mydognet/blob/main/front-end/api.js) (API client), [`front-end/page/Admin/SignIn.jsx`](https://github.com/tuanduy35399/mydognet/blob/main/front-end/page/Admin/SignIn.jsx) (Admin sign-in), [`BackEnd/Data/ApplicationDbContext.cs`](https://github.com/tuanduy35399/mydognet/blob/main/BackEnd/Data/ApplicationDbContext.cs) (Application database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public portfolio"]
  node_router["Page routing<br/>[App.jsx]"]
  node_public_pages["Portfolio pages<br/>[Home.jsx]"]
  node_post_browsing["Post browsing<br/>[ListPost.jsx]"]
  node_post_detail["Post detail<br/>[PostDetail.jsx]"]
  node_profile_context["Profile context<br/>[UserContext.jsx]"]
end

subgraph group_admin["Admin experience"]
  node_admin_pages["Admin routes<br/>[Admin.jsx]"]
  node_sign_in["Admin sign-in<br/>[SignIn.jsx]"]
  node_post_manager["Post management<br/>[PostManager.jsx]"]
  node_post_editor["Post authoring<br/>[CreatePost.jsx]"]
  node_account_manager["Account management<br/>[AccountManager.jsx]"]
  node_http_client["API client<br/>[api.js]"]
end

subgraph group_api["Backend API"]
  node_account_api["Account API"]
  node_post_api["Post API<br/>[PostController.cs]"]
  node_profile_api["Profile API"]
  node_upload_api["Image upload API"]
  node_account_repository["Account repository"]
end

subgraph group_data["Persistence and media"]
  node_database[("Application database")]
  node_cloudinary[("Cloudinary media")]
  node_cloudinary_service["Cloudinary service"]
end

node_visitor(("Visitor"))
node_admin_actor(("Administrator"))

node_visitor -->|"opens pages"| node_router
node_admin_actor -->|"opens admin"| node_router
node_router -->|"routes to"| node_public_pages
node_router -->|"routes to"| node_post_detail
node_router -->|"protects route"| node_admin_pages
node_router -->|"routes to"| node_sign_in
node_router -->|"routes to"| node_post_manager
node_router -->|"routes to"| node_post_editor
node_router -->|"routes to"| node_account_manager
node_public_pages -->|"renders"| node_post_browsing
node_post_browsing -.->|"requests posts"| node_http_client
node_post_detail -.->|"requests detail"| node_http_client
node_profile_context -->|"fetches profile"| node_profile_api
node_profile_api -->|"reads profile"| node_database
node_admin_actor -->|"signs in"| node_sign_in
node_sign_in -.->|"submits credentials"| node_http_client
node_post_manager -->|"fetches and deletes"| node_http_client
node_post_editor -.->|"submits post"| node_http_client
node_account_manager -.->|"manages accounts"| node_http_client
node_http_client -.->|"HTTP requests"| node_post_api
node_http_client -.->|"HTTP requests"| node_account_api
node_http_client -.->|"uploads images"| node_upload_api
node_account_api -->|"delegates account work"| node_account_repository
node_account_repository -->|"reads and writes accounts"| node_database
node_post_api -->|"reads and writes posts"| node_database
node_upload_api -->|"delegates upload"| node_cloudinary_service
node_cloudinary_service -->|"stores images"| node_cloudinary

click node_router "https://github.com/tuanduy35399/mydognet/blob/main/front-end/src/App.jsx"
click node_public_pages "https://github.com/tuanduy35399/mydognet/blob/main/front-end/page/Home/Home.jsx"
click node_post_browsing "https://github.com/tuanduy35399/mydognet/blob/main/front-end/components/ListPost/ListPost.jsx"
click node_post_detail "https://github.com/tuanduy35399/mydognet/blob/main/front-end/page/PostDetail/PostDetail.jsx"
click node_profile_context "https://github.com/tuanduy35399/mydognet/blob/main/front-end/context/UserContext.jsx"
click node_admin_pages "https://github.com/tuanduy35399/mydognet/blob/main/front-end/page/Admin/main/Admin.jsx"
click node_sign_in "https://github.com/tuanduy35399/mydognet/blob/main/front-end/page/Admin/SignIn.jsx"
click node_post_manager "https://github.com/tuanduy35399/mydognet/blob/main/front-end/page/Admin/manage/Post/PostManager.jsx"
click node_post_editor "https://github.com/tuanduy35399/mydognet/blob/main/front-end/page/Admin/manage/Post/CreatePost.jsx"
click node_account_manager "https://github.com/tuanduy35399/mydognet/blob/main/front-end/page/Admin/manage/Account/AccountManager.jsx"
click node_http_client "https://github.com/tuanduy35399/mydognet/blob/main/front-end/api.js"
click node_account_api "https://github.com/tuanduy35399/mydognet/blob/main/BackEnd/Controllers/AccountController.cs"
click node_post_api "https://github.com/tuanduy35399/mydognet/blob/main/BackEnd/Controllers/PostController.cs"
click node_profile_api "https://github.com/tuanduy35399/mydognet/blob/main/BackEnd/Controllers/AboutMeController.cs"
click node_upload_api "https://github.com/tuanduy35399/mydognet/blob/main/BackEnd/Controllers/UploadController.cs"
click node_account_repository "https://github.com/tuanduy35399/mydognet/blob/main/BackEnd/Repositories/AccountRepository.cs"
click node_database "https://github.com/tuanduy35399/mydognet/blob/main/BackEnd/Data/ApplicationDbContext.cs"
click node_cloudinary_service "https://github.com/tuanduy35399/mydognet/blob/main/BackEnd/Services/CloudinaryService.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_router,node_public_pages,node_post_browsing,node_post_detail,node_profile_context toneBlue
class node_admin_pages,node_sign_in,node_post_manager,node_post_editor,node_account_manager,node_http_client toneAmber
class node_account_api,node_post_api,node_profile_api,node_upload_api,node_account_repository toneMint
class node_database,node_cloudinary,node_cloudinary_service toneRose
class node_visitor,node_admin_actor toneIndigo
```

## Components

### Public portfolio

- [Page routing](https://github.com/tuanduy35399/mydognet/blob/main/front-end/src/App.jsx): `front-end/src/App.jsx`
- [Portfolio pages](https://github.com/tuanduy35399/mydognet/blob/main/front-end/page/Home/Home.jsx): `front-end/page/Home/Home.jsx`
- [Post browsing](https://github.com/tuanduy35399/mydognet/blob/main/front-end/components/ListPost/ListPost.jsx): `front-end/components/ListPost/ListPost.jsx`
- [Post detail](https://github.com/tuanduy35399/mydognet/blob/main/front-end/page/PostDetail/PostDetail.jsx): `front-end/page/PostDetail/PostDetail.jsx`
- [Profile context](https://github.com/tuanduy35399/mydognet/blob/main/front-end/context/UserContext.jsx): `front-end/context/UserContext.jsx`

### Admin experience

- [Admin routes](https://github.com/tuanduy35399/mydognet/blob/main/front-end/page/Admin/main/Admin.jsx): `front-end/page/Admin/main/Admin.jsx`
- [Admin sign-in](https://github.com/tuanduy35399/mydognet/blob/main/front-end/page/Admin/SignIn.jsx): `front-end/page/Admin/SignIn.jsx`
- [Post management](https://github.com/tuanduy35399/mydognet/blob/main/front-end/page/Admin/manage/Post/PostManager.jsx): `front-end/page/Admin/manage/Post/PostManager.jsx`
- [Post authoring](https://github.com/tuanduy35399/mydognet/blob/main/front-end/page/Admin/manage/Post/CreatePost.jsx): `front-end/page/Admin/manage/Post/CreatePost.jsx`
- [Account management](https://github.com/tuanduy35399/mydognet/blob/main/front-end/page/Admin/manage/Account/AccountManager.jsx): `front-end/page/Admin/manage/Account/AccountManager.jsx`
- [API client](https://github.com/tuanduy35399/mydognet/blob/main/front-end/api.js): `front-end/api.js`

### Backend API

- [Account API](https://github.com/tuanduy35399/mydognet/blob/main/BackEnd/Controllers/AccountController.cs): `BackEnd/Controllers/AccountController.cs`
- [Post API](https://github.com/tuanduy35399/mydognet/blob/main/BackEnd/Controllers/PostController.cs): `BackEnd/Controllers/PostController.cs`
- [Profile API](https://github.com/tuanduy35399/mydognet/blob/main/BackEnd/Controllers/AboutMeController.cs): `BackEnd/Controllers/AboutMeController.cs`
- [Image upload API](https://github.com/tuanduy35399/mydognet/blob/main/BackEnd/Controllers/UploadController.cs): `BackEnd/Controllers/UploadController.cs`
- [Account repository](https://github.com/tuanduy35399/mydognet/blob/main/BackEnd/Repositories/AccountRepository.cs): `BackEnd/Repositories/AccountRepository.cs`

### Persistence and media

- [Application database](https://github.com/tuanduy35399/mydognet/blob/main/BackEnd/Data/ApplicationDbContext.cs): `BackEnd/Data/ApplicationDbContext.cs`
- **Cloudinary media**
- [Cloudinary service](https://github.com/tuanduy35399/mydognet/blob/main/BackEnd/Services/CloudinaryService.cs): `BackEnd/Services/CloudinaryService.cs`

### Other components

- **Visitor**
- **Administrator**

## Connections

- Visitor → Page routing: opens pages (evidence: `front-end/src/App.jsx`)
- Administrator → Page routing: opens admin (evidence: `front-end/src/App.jsx`)
- Page routing → Portfolio pages: routes to (evidence: `front-end/src/App.jsx`)
- Page routing → Post detail: routes to (evidence: `front-end/src/App.jsx`)
- Page routing → Admin routes: protects route (evidence: `front-end/src/App.jsx`)
- Page routing → Admin sign-in: routes to (evidence: `front-end/src/App.jsx`)
- Page routing → Post management: routes to (evidence: `front-end/src/App.jsx`)
- Page routing → Post authoring: routes to (evidence: `front-end/src/App.jsx`)
- Page routing → Account management: routes to (evidence: `front-end/src/App.jsx`)
- Portfolio pages → Post browsing: renders (evidence: `front-end/page/Home/Home.jsx`)
- Post browsing → API client: requests posts (evidence: `front-end/components/ListPost/ListPost.jsx`)
- Post detail → API client: requests detail (evidence: `front-end/page/PostDetail/PostDetail.jsx`)
- Profile context → Profile API: fetches profile (evidence: `front-end/context/UserContext.jsx`)
- Profile API → Application database: reads profile (evidence: `BackEnd/Controllers/AboutMeController.cs`)
- Administrator → Admin sign-in: signs in
- Admin sign-in → API client: submits credentials (evidence: `front-end/page/Admin/SignIn.jsx`)
- Post management → API client: fetches and deletes (evidence: `front-end/page/Admin/manage/Post/PostManager.jsx`)
- Post authoring → API client: submits post (evidence: `README.md`)
- Account management → API client: manages accounts (evidence: `front-end/page/Admin/manage/Account/AccountManager.jsx`)
- API client → Post API: HTTP requests
- API client → Account API: HTTP requests
- API client → Image upload API: uploads images (evidence: `README.md`)
- Account API → Account repository: delegates account work (evidence: `BackEnd/Controllers/AccountController.cs`)
- Account repository → Application database: reads and writes accounts (evidence: `BackEnd/Repositories/AccountRepository.cs`)
- Post API → Application database: reads and writes posts (evidence: `BackEnd/Controllers/PostController.cs`)
- Image upload API → Cloudinary service: delegates upload (evidence: `BackEnd/Controllers/UploadController.cs`)
- Cloudinary service → Cloudinary media: stores images (evidence: `BackEnd/Services/CloudinaryService.cs`)
