# resquezz/community-forum-api architecture

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

- Interactive diagram: https://gitdiagram.com/resquezz/community-forum-api
- Repository: https://github.com/resquezz/community-forum-api

## Overview

This is an ASP.NET Core community-forum API with JWT login and role-based authorization, backed by EF Core/SQL Server and documented SignalR support. A user sends API requests to resource controllers, which delegate to application services; user registration/login yields account data or a token, while forum operations manage topics, posts, comments, votes, categories, and tags. The graph preserves these domain branches, authorization, persistence, and realtime events. Most service implementations were not sampled, so their connections are shown only where the index or excerpts support them; other links are omitted.

Main entry points: [`CommunityForum.Application/Services`](https://github.com/resquezz/community-forum-api/tree/main/CommunityForum.Application/Services) (Forum services), [`CommunityForum.Application/Services/CategoryService.cs`](https://github.com/resquezz/community-forum-api/blob/main/CommunityForum.Application/Services/CategoryService.cs) (Category service), [`CommunityForum.Application/Services/UserService.cs`](https://github.com/resquezz/community-forum-api/blob/main/CommunityForum.Application/Services/UserService.cs) (User service), [`CommunityForum.Infrastructure/Data/AppDbContext.cs`](https://github.com/resquezz/community-forum-api/blob/main/CommunityForum.Infrastructure/Data/AppDbContext.cs) (EF data context)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API access"]
  node_controllers["Resource controllers<br/>[Controllers]"]
  node_user_controller["User endpoints<br/>[UsersController.cs]"]
  node_topic_controller["Topic endpoints"]
  node_post_controller["Post endpoints<br/>[PostsController.cs]"]
  node_comment_controller["Comment endpoints"]
end

subgraph group_application["Application logic"]
  node_services["Forum services<br/>[Services]"]
  node_user_service["User service<br/>[UserService.cs]"]
  node_category_service["Category service<br/>[CategoryService.cs]"]
  node_authorization["Authorization"]
end

subgraph group_domain["Forum domain"]
  node_forum_entities["Forum entities<br/>[Entities]"]
end

subgraph group_infrastructure["Persistence and realtime"]
  node_repositories["Repository implementations<br/>[Repositories]"]
  node_database_context["EF data context<br/>[AppDbContext.cs]"]
  node_sql_database[("SQL Server")]
  node_signalr_hub["SignalR hub<br/>[ForumHub.cs]"]
end

node_user(("Forum user"))

node_user -->|"sends requests"| node_controllers
node_controllers -.->|"routes users"| node_user_controller
node_user_controller -->|"delegates to"| node_user_service
node_topic_controller -->|"delegates to"| node_services
node_post_controller -->|"delegates to"| node_services
node_comment_controller -->|"delegates to"| node_services
node_services -.->|"manages"| node_forum_entities
node_user_service -->|"checks permissions"| node_authorization
node_user_service -->|"uses user repository"| node_repositories
node_category_service -->|"checks taxonomy access"| node_authorization
node_category_service -->|"uses category repository"| node_repositories
node_category_service -->|"broadcasts events"| node_signalr_hub
node_repositories -->|"reads and writes"| node_database_context
node_database_context -->|"maps entities"| node_forum_entities
node_database_context -.->|"persists data"| node_sql_database

click node_controllers "https://github.com/resquezz/community-forum-api/tree/main/CommunityForum.API/Controllers"
click node_user_controller "https://github.com/resquezz/community-forum-api/blob/main/CommunityForum.API/Controllers/UsersController.cs"
click node_topic_controller "https://github.com/resquezz/community-forum-api/blob/main/CommunityForum.API/Controllers/TopicsController.cs"
click node_post_controller "https://github.com/resquezz/community-forum-api/blob/main/CommunityForum.API/Controllers/PostsController.cs"
click node_comment_controller "https://github.com/resquezz/community-forum-api/blob/main/CommunityForum.API/Controllers/CommentsController.cs"
click node_services "https://github.com/resquezz/community-forum-api/tree/main/CommunityForum.Application/Services"
click node_user_service "https://github.com/resquezz/community-forum-api/blob/main/CommunityForum.Application/Services/UserService.cs"
click node_category_service "https://github.com/resquezz/community-forum-api/blob/main/CommunityForum.Application/Services/CategoryService.cs"
click node_authorization "https://github.com/resquezz/community-forum-api/blob/main/CommunityForum.Application/Authorization/ForumAuthorizationService.cs"
click node_forum_entities "https://github.com/resquezz/community-forum-api/tree/main/CommunityForum.Domain/Entities"
click node_repositories "https://github.com/resquezz/community-forum-api/tree/main/CommunityForum.Infrastructure/Repositories"
click node_database_context "https://github.com/resquezz/community-forum-api/blob/main/CommunityForum.Infrastructure/Data/AppDbContext.cs"
click node_signalr_hub "https://github.com/resquezz/community-forum-api/blob/main/CommunityForum.Infrastructure/SignalR/ForumHub.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_controllers,node_user_controller,node_topic_controller,node_post_controller,node_comment_controller,node_user toneBlue
class node_services,node_user_service,node_category_service,node_authorization toneAmber
class node_forum_entities toneMint
class node_repositories,node_database_context,node_sql_database,node_signalr_hub toneRose
```

## Components

### API access

- [Resource controllers](https://github.com/resquezz/community-forum-api/tree/main/CommunityForum.API/Controllers): `CommunityForum.API/Controllers`
- [User endpoints](https://github.com/resquezz/community-forum-api/blob/main/CommunityForum.API/Controllers/UsersController.cs): `CommunityForum.API/Controllers/UsersController.cs`
- [Topic endpoints](https://github.com/resquezz/community-forum-api/blob/main/CommunityForum.API/Controllers/TopicsController.cs): `CommunityForum.API/Controllers/TopicsController.cs`
- [Post endpoints](https://github.com/resquezz/community-forum-api/blob/main/CommunityForum.API/Controllers/PostsController.cs): `CommunityForum.API/Controllers/PostsController.cs`
- [Comment endpoints](https://github.com/resquezz/community-forum-api/blob/main/CommunityForum.API/Controllers/CommentsController.cs): `CommunityForum.API/Controllers/CommentsController.cs`

### Application logic

- [Forum services](https://github.com/resquezz/community-forum-api/tree/main/CommunityForum.Application/Services): `CommunityForum.Application/Services`
- [User service](https://github.com/resquezz/community-forum-api/blob/main/CommunityForum.Application/Services/UserService.cs): `CommunityForum.Application/Services/UserService.cs`
- [Category service](https://github.com/resquezz/community-forum-api/blob/main/CommunityForum.Application/Services/CategoryService.cs): `CommunityForum.Application/Services/CategoryService.cs`
- [Authorization](https://github.com/resquezz/community-forum-api/blob/main/CommunityForum.Application/Authorization/ForumAuthorizationService.cs): `CommunityForum.Application/Authorization/ForumAuthorizationService.cs`

### Forum domain

- [Forum entities](https://github.com/resquezz/community-forum-api/tree/main/CommunityForum.Domain/Entities): `CommunityForum.Domain/Entities`

### Persistence and realtime

- [Repository implementations](https://github.com/resquezz/community-forum-api/tree/main/CommunityForum.Infrastructure/Repositories): `CommunityForum.Infrastructure/Repositories`
- [EF data context](https://github.com/resquezz/community-forum-api/blob/main/CommunityForum.Infrastructure/Data/AppDbContext.cs): `CommunityForum.Infrastructure/Data/AppDbContext.cs`
- **SQL Server**
- [SignalR hub](https://github.com/resquezz/community-forum-api/blob/main/CommunityForum.Infrastructure/SignalR/ForumHub.cs): `CommunityForum.Infrastructure/SignalR/ForumHub.cs`

### Other components

- **Forum user**

## Connections

- Forum user → Resource controllers: sends requests
- Resource controllers → User endpoints: routes users
- User endpoints → User service: delegates to (evidence: `CommunityForum.API/Controllers/UsersController.cs`)
- Topic endpoints → Forum services: delegates to (evidence: `CommunityForum.API/Controllers/TopicsController.cs`)
- Post endpoints → Forum services: delegates to (evidence: `CommunityForum.API/Controllers/PostsController.cs`)
- Comment endpoints → Forum services: delegates to (evidence: `CommunityForum.API/Controllers/CommentsController.cs`)
- Forum services → Forum entities: manages (evidence: `CommunityForum.Application/Services/CategoryService.cs`)
- User service → Authorization: checks permissions (evidence: `CommunityForum.Application/Services/UserService.cs`)
- User service → Repository implementations: uses user repository (evidence: `CommunityForum.Application/Services/UserService.cs`)
- Category service → Authorization: checks taxonomy access (evidence: `CommunityForum.Application/Services/CategoryService.cs`)
- Category service → Repository implementations: uses category repository (evidence: `CommunityForum.Application/Services/CategoryService.cs`)
- Category service → SignalR hub: broadcasts events (evidence: `CommunityForum.Application/Services/CategoryService.cs`)
- Repository implementations → EF data context: reads and writes (evidence: `CommunityForum.Infrastructure/Repositories/UserRepository.cs`)
- EF data context → Forum entities: maps entities (evidence: `CommunityForum.Infrastructure/Data/AppDbContext.cs`)
- EF data context → SQL Server: persists data
