# asmaaelsayed55/vioguard.api_graduation.project_ architecture

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

- Interactive diagram: https://gitdiagram.com/asmaaelsayed55/vioguard.api_graduation.project_
- Repository: https://github.com/asmaaelsayed55/vioguard.api_graduation.project_

## Overview

VioGuard is a backend moderation API for text and video, with user accounts, upload history, and aggregate reporting. The principal workflow accepts content through API endpoints, classifies or analyzes it, records content and history, and exposes results to users. The sampled code shows URL scraping, content persistence, user services, and history queries; README capabilities and indexed-but-unsampled modules preserve detection and reporting branches. Detection-model internals and some runtime wiring were not sampled, so those links are marked unverified or omitted.

Main entry points: [`Core/Services/Implementations/ContentService.cs`](https://github.com/asmaaelsayed55/vioguard.api_graduation.project_/blob/master/Core/Services/Implementations/ContentService.cs) (Content processing), [`Core/Services/Implementations/UserService.cs`](https://github.com/asmaaelsayed55/vioguard.api_graduation.project_/blob/master/Core/Services/Implementations/UserService.cs) (User service), [`Infrastructure/Presentation/Controllers/AuthController.cs`](https://github.com/asmaaelsayed55/vioguard.api_graduation.project_/blob/master/Infrastructure/Presentation/Controllers/AuthController.cs) (Authentication API), [`Infrastructure/Presentation/Controllers/ContentController.cs`](https://github.com/asmaaelsayed55/vioguard.api_graduation.project_/blob/master/Infrastructure/Presentation/Controllers/ContentController.cs) (Content API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API endpoints"]
  node_auth_api["Authentication API<br/>[AuthController.cs]"]
  node_content_api["Content API"]
  node_detect_api["Detection API"]
  node_user_api["User API<br/>[UserController.cs]"]
  node_history_api["History API"]
  node_report_api["Report API"]
end

subgraph group_moderation["Content moderation"]
  node_scraper["URL scraping"]
  node_content_service["Content processing<br/>[ContentService.cs]"]
  node_detection_models["Text/video detection"]
  node_content_entities["Content records<br/>[Content.cs]"]
  node_text_entity["Text content<br/>[TextContent.cs]"]
  node_video_entity["Video content<br/>[VideoContent.cs]"]
end

subgraph group_identity["User management"]
  node_user_service["User service<br/>[UserService.cs]"]
  node_user_entity["User account<br/>[User.cs]"]
  node_token_service["JWT tokens<br/>[JwtTokenService.cs]"]
end

subgraph group_records["Persistence and audit"]
  node_history_record["History records<br/>[HistoryRecord.cs]"]
  node_unit_of_work["Unit of work<br/>[UnitOfWork.cs]"]
  node_generic_repository["Generic repository"]
  node_db_context[("Database context")]
  node_database[("Application database")]
end

subgraph group_insights["History and reporting"]
  node_history_service["History service<br/>[HistoryService.cs]"]
  node_report_service["Report service<br/>[ReportService.cs]"]
end

node_client(("API client"))
node_remote_content(("Remote content hosts"))

node_client -->|"authenticates"| node_auth_api
node_client -->|"submits URLs"| node_content_api
node_client -->|"requests analysis"| node_detect_api
node_client -->|"manages profile"| node_user_api
node_client -->|"requests history"| node_history_api
node_client -->|"requests reports"| node_report_api
node_auth_api -->|"authenticates users"| node_user_service
node_auth_api -->|"creates tokens"| node_token_service
node_user_api -->|"updates users"| node_user_service
node_content_api -->|"scrapes URLs"| node_scraper
node_scraper -->|"fetches media"| node_remote_content
node_detect_api -.->|"analyzes media"| node_detection_models
node_detection_models -.->|"persists results"| node_content_service
node_content_api -.->|"processes content"| node_content_service
node_content_service -->|"creates records"| node_content_entities
node_content_service -->|"logs uploads"| node_history_record
node_content_entities -->|"specializes as"| node_text_entity
node_content_entities -.->|"specializes as"| node_video_entity
node_history_api -->|"queries history"| node_history_service
node_report_api -->|"requests metrics"| node_report_service
node_history_service -->|"reads records"| node_history_record
node_history_service -->|"queries database"| node_db_context
node_user_service -->|"manages accounts"| node_user_entity
node_user_service -->|"uses repositories"| node_unit_of_work
node_unit_of_work -->|"provides repositories"| node_generic_repository
node_generic_repository -->|"accesses sets"| node_db_context
node_db_context -->|"reads and writes"| node_database

click node_auth_api "https://github.com/asmaaelsayed55/vioguard.api_graduation.project_/blob/master/Infrastructure/Presentation/Controllers/AuthController.cs"
click node_content_api "https://github.com/asmaaelsayed55/vioguard.api_graduation.project_/blob/master/Infrastructure/Presentation/Controllers/ContentController.cs"
click node_detect_api "https://github.com/asmaaelsayed55/vioguard.api_graduation.project_/blob/master/Infrastructure/Presentation/Controllers/DetectionController.cs"
click node_user_api "https://github.com/asmaaelsayed55/vioguard.api_graduation.project_/blob/master/Infrastructure/Presentation/Controllers/UserController.cs"
click node_history_api "https://github.com/asmaaelsayed55/vioguard.api_graduation.project_/blob/master/Infrastructure/Presentation/Controllers/HistoryController.cs"
click node_report_api "https://github.com/asmaaelsayed55/vioguard.api_graduation.project_/blob/master/Infrastructure/Presentation/Controllers/ReportController.cs"
click node_scraper "https://github.com/asmaaelsayed55/vioguard.api_graduation.project_/blob/master/Core/Services/Implementations/ContentScrapingService.cs"
click node_content_service "https://github.com/asmaaelsayed55/vioguard.api_graduation.project_/blob/master/Core/Services/Implementations/ContentService.cs"
click node_detection_models "https://github.com/asmaaelsayed55/vioguard.api_graduation.project_/blob/master/Infrastructure/Presentation/Controllers/DetectionController.cs"
click node_content_entities "https://github.com/asmaaelsayed55/vioguard.api_graduation.project_/blob/master/Core/Domain/Entities/ContentsMudule/Content.cs"
click node_text_entity "https://github.com/asmaaelsayed55/vioguard.api_graduation.project_/blob/master/Core/Domain/Entities/ContentsMudule/TextContent.cs"
click node_video_entity "https://github.com/asmaaelsayed55/vioguard.api_graduation.project_/blob/master/Core/Domain/Entities/ContentsMudule/VideoContent.cs"
click node_user_service "https://github.com/asmaaelsayed55/vioguard.api_graduation.project_/blob/master/Core/Services/Implementations/UserService.cs"
click node_user_entity "https://github.com/asmaaelsayed55/vioguard.api_graduation.project_/blob/master/Core/Domain/Entities/UserModule/User.cs"
click node_token_service "https://github.com/asmaaelsayed55/vioguard.api_graduation.project_/blob/master/Core/Services/Implementations/JwtTokenService.cs"
click node_history_service "https://github.com/asmaaelsayed55/vioguard.api_graduation.project_/blob/master/Core/Services/Implementations/HistoryService.cs"
click node_report_service "https://github.com/asmaaelsayed55/vioguard.api_graduation.project_/blob/master/Core/Services/Implementations/ReportService.cs"
click node_history_record "https://github.com/asmaaelsayed55/vioguard.api_graduation.project_/blob/master/Core/Domain/Entities/SystemModule/HistoryRecord.cs"
click node_unit_of_work "https://github.com/asmaaelsayed55/vioguard.api_graduation.project_/blob/master/Infrastructure/Presistence/Repositories/UnitOfWork.cs"
click node_generic_repository "https://github.com/asmaaelsayed55/vioguard.api_graduation.project_/blob/master/Infrastructure/Presistence/Repositories/GenericRepository.cs"
click node_db_context "https://github.com/asmaaelsayed55/vioguard.api_graduation.project_/blob/master/Infrastructure/Presistence/Data/VioGuardDbContext.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_api,node_content_api,node_detect_api,node_user_api,node_history_api,node_report_api,node_client toneBlue
class node_scraper,node_content_service,node_detection_models,node_content_entities,node_text_entity,node_video_entity toneAmber
class node_user_service,node_user_entity,node_token_service toneMint
class node_history_record,node_unit_of_work,node_generic_repository,node_db_context,node_database toneRose
class node_history_service,node_report_service,node_remote_content toneIndigo
```

## Components

### API endpoints

- [Authentication API](https://github.com/asmaaelsayed55/vioguard.api_graduation.project_/blob/master/Infrastructure/Presentation/Controllers/AuthController.cs): `Infrastructure/Presentation/Controllers/AuthController.cs`
- [Content API](https://github.com/asmaaelsayed55/vioguard.api_graduation.project_/blob/master/Infrastructure/Presentation/Controllers/ContentController.cs): `Infrastructure/Presentation/Controllers/ContentController.cs`
- [Detection API](https://github.com/asmaaelsayed55/vioguard.api_graduation.project_/blob/master/Infrastructure/Presentation/Controllers/DetectionController.cs): `Infrastructure/Presentation/Controllers/DetectionController.cs`
- [User API](https://github.com/asmaaelsayed55/vioguard.api_graduation.project_/blob/master/Infrastructure/Presentation/Controllers/UserController.cs): `Infrastructure/Presentation/Controllers/UserController.cs`
- [History API](https://github.com/asmaaelsayed55/vioguard.api_graduation.project_/blob/master/Infrastructure/Presentation/Controllers/HistoryController.cs): `Infrastructure/Presentation/Controllers/HistoryController.cs`
- [Report API](https://github.com/asmaaelsayed55/vioguard.api_graduation.project_/blob/master/Infrastructure/Presentation/Controllers/ReportController.cs): `Infrastructure/Presentation/Controllers/ReportController.cs`

### Content moderation

- [URL scraping](https://github.com/asmaaelsayed55/vioguard.api_graduation.project_/blob/master/Core/Services/Implementations/ContentScrapingService.cs): `Core/Services/Implementations/ContentScrapingService.cs`
- [Content processing](https://github.com/asmaaelsayed55/vioguard.api_graduation.project_/blob/master/Core/Services/Implementations/ContentService.cs): `Core/Services/Implementations/ContentService.cs`
- [Text/video detection](https://github.com/asmaaelsayed55/vioguard.api_graduation.project_/blob/master/Infrastructure/Presentation/Controllers/DetectionController.cs): `Infrastructure/Presentation/Controllers/DetectionController.cs`
- [Content records](https://github.com/asmaaelsayed55/vioguard.api_graduation.project_/blob/master/Core/Domain/Entities/ContentsMudule/Content.cs): `Core/Domain/Entities/ContentsMudule/Content.cs`
- [Text content](https://github.com/asmaaelsayed55/vioguard.api_graduation.project_/blob/master/Core/Domain/Entities/ContentsMudule/TextContent.cs): `Core/Domain/Entities/ContentsMudule/TextContent.cs`
- [Video content](https://github.com/asmaaelsayed55/vioguard.api_graduation.project_/blob/master/Core/Domain/Entities/ContentsMudule/VideoContent.cs): `Core/Domain/Entities/ContentsMudule/VideoContent.cs`

### User management

- [User service](https://github.com/asmaaelsayed55/vioguard.api_graduation.project_/blob/master/Core/Services/Implementations/UserService.cs): `Core/Services/Implementations/UserService.cs`
- [User account](https://github.com/asmaaelsayed55/vioguard.api_graduation.project_/blob/master/Core/Domain/Entities/UserModule/User.cs): `Core/Domain/Entities/UserModule/User.cs`
- [JWT tokens](https://github.com/asmaaelsayed55/vioguard.api_graduation.project_/blob/master/Core/Services/Implementations/JwtTokenService.cs): `Core/Services/Implementations/JwtTokenService.cs`

### Persistence and audit

- [History records](https://github.com/asmaaelsayed55/vioguard.api_graduation.project_/blob/master/Core/Domain/Entities/SystemModule/HistoryRecord.cs): `Core/Domain/Entities/SystemModule/HistoryRecord.cs`
- [Unit of work](https://github.com/asmaaelsayed55/vioguard.api_graduation.project_/blob/master/Infrastructure/Presistence/Repositories/UnitOfWork.cs): `Infrastructure/Presistence/Repositories/UnitOfWork.cs`
- [Generic repository](https://github.com/asmaaelsayed55/vioguard.api_graduation.project_/blob/master/Infrastructure/Presistence/Repositories/GenericRepository.cs): `Infrastructure/Presistence/Repositories/GenericRepository.cs`
- [Database context](https://github.com/asmaaelsayed55/vioguard.api_graduation.project_/blob/master/Infrastructure/Presistence/Data/VioGuardDbContext.cs): `Infrastructure/Presistence/Data/VioGuardDbContext.cs`
- **Application database**

### History and reporting

- [History service](https://github.com/asmaaelsayed55/vioguard.api_graduation.project_/blob/master/Core/Services/Implementations/HistoryService.cs): `Core/Services/Implementations/HistoryService.cs`
- [Report service](https://github.com/asmaaelsayed55/vioguard.api_graduation.project_/blob/master/Core/Services/Implementations/ReportService.cs): `Core/Services/Implementations/ReportService.cs`

### Other components

- **API client**
- **Remote content hosts**

## Connections

- API client → Authentication API: authenticates (evidence: `Infrastructure/Presentation/Controllers/AuthController.cs`)
- API client → Content API: submits URLs (evidence: `Infrastructure/Presentation/Controllers/ContentController.cs`)
- API client → Detection API: requests analysis (evidence: `Infrastructure/Presentation/Controllers/DetectionController.cs`)
- API client → User API: manages profile (evidence: `Infrastructure/Presentation/Controllers/UserController.cs`)
- API client → History API: requests history (evidence: `Infrastructure/Presentation/Controllers/HistoryController.cs`)
- API client → Report API: requests reports (evidence: `Infrastructure/Presentation/Controllers/ReportController.cs`)
- Authentication API → User service: authenticates users (evidence: `Infrastructure/Presentation/Controllers/AuthController.cs`)
- Authentication API → JWT tokens: creates tokens (evidence: `Infrastructure/Presentation/Controllers/AuthController.cs`)
- User API → User service: updates users (evidence: `Infrastructure/Presentation/Controllers/UserController.cs`)
- Content API → URL scraping: scrapes URLs (evidence: `Infrastructure/Presentation/Controllers/ContentController.cs`)
- URL scraping → Remote content hosts: fetches media (evidence: `Core/Services/Implementations/ContentScrapingService.cs`)
- Detection API → Text/video detection: analyzes media (evidence: `Infrastructure/Presentation/Controllers/DetectionController.cs`)
- Text/video detection → Content processing: persists results
- Content API → Content processing: processes content
- Content processing → Content records: creates records (evidence: `Core/Services/Implementations/ContentService.cs`)
- Content processing → History records: logs uploads (evidence: `Core/Services/Implementations/ContentService.cs`)
- Content records → Text content: specializes as (evidence: `Core/Domain/Entities/ContentsMudule/TextContent.cs`)
- Content records → Video content: specializes as (evidence: `Core/Domain/Entities/ContentsMudule/VideoContent.cs`)
- History API → History service: queries history (evidence: `Infrastructure/Presentation/Controllers/HistoryController.cs`)
- Report API → Report service: requests metrics (evidence: `Infrastructure/Presentation/Controllers/ReportController.cs`)
- History service → History records: reads records (evidence: `Core/Services/Implementations/HistoryService.cs`)
- History service → Database context: queries database (evidence: `Core/Services/Implementations/HistoryService.cs`)
- User service → User account: manages accounts (evidence: `Core/Services/Implementations/UserService.cs`)
- User service → Unit of work: uses repositories (evidence: `Core/Services/Implementations/UserService.cs`)
- Unit of work → Generic repository: provides repositories (evidence: `VioGuard.API/Program.cs`)
- Generic repository → Database context: accesses sets (evidence: `Infrastructure/Presistence/Repositories/GenericRepository.cs`)
- Database context → Application database: reads and writes (evidence: `Infrastructure/Presistence/Data/VioGuardDbContext.cs`)
