# letopiaplatform/letopiaplatform architecture

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

- Interactive diagram: https://gitdiagram.com/letopiaplatform/letopiaplatform
- Repository: https://github.com/letopiaplatform/letopiaplatform

## Overview

Letopia is a .NET backend for a learning and collaboration platform. Users access its API to manage accounts, communities, posts and projects; they can also use search and an AI roadmap assistant. API controllers invoke domain services, while infrastructure supplies persistence, identity and external-service implementations. The README describes the clean-architecture layers, and the source index confirms several controller and agent dependencies. Many feature implementations were not excerpted, so those capabilities are represented at subsystem level without asserting unverified call paths.

Main entry points: [`src/LetopiaPlatform.Infrastructure/Data/ApplicationDbContext.cs`](https://github.com/letopiaplatform/letopiaplatform/blob/main/src/LetopiaPlatform.Infrastructure/Data/ApplicationDbContext.cs) (Application database), [`src/LetopiaPlatform.Agent/Services/RoadmapAgentService.cs`](https://github.com/letopiaplatform/letopiaplatform/blob/main/src/LetopiaPlatform.Agent/Services/RoadmapAgentService.cs) (Roadmap agent), [`src/LetopiaPlatform.API/Program.cs`](https://github.com/letopiaplatform/letopiaplatform/blob/main/src/LetopiaPlatform.API/Program.cs) (HTTP API), [`src/LetopiaPlatform.Infrastructure/Identity/AuthService.cs`](https://github.com/letopiaplatform/letopiaplatform/blob/main/src/LetopiaPlatform.Infrastructure/Identity/AuthService.cs) (Authentication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API layer"]
  node_api["HTTP API<br/>[Program.cs]"]
  node_routes["API routes<br/>[Router.cs]"]
  node_base["Controller responses<br/>[BaseController.cs]"]
end

subgraph group_features["Platform features"]
  node_auth["Authentication<br/>[AuthService.cs]"]
  node_communities["Communities"]
  node_communityservice["Community service contract"]
  node_posts["Posts and comments<br/>[PostsController.cs]"]
  node_projects["Projects and milestones"]
  node_search["Platform search<br/>[SearchService.cs]"]
end

subgraph group_assistant["Roadmap assistant"]
  node_roadmapapi["Roadmap endpoints"]
  node_agentapi["Agent endpoints<br/>[AgentController.cs]"]
  node_roadmapagent["Roadmap agent"]
  node_websearch["Web search"]
end

subgraph group_infra["Infrastructure"]
  node_database[("Application database")]
  node_email["Email delivery"]
  node_files["File storage"]
end

node_user(("Platform user"))

node_user -->|"sends requests"| node_api
node_api -->|"maps controllers"| node_routes
node_communities -->|"calls"| node_communityservice
node_api -.->|"hosts controllers"| node_base
node_agentapi -.->|"invokes"| node_roadmapagent
node_roadmapapi -.->|"uses"| node_roadmapagent
node_roadmapagent -->|"invokes tool"| node_websearch
node_roadmapagent -.->|"persists conversations"| node_database
node_auth -->|"uses context"| node_database
node_auth -->|"queues messages"| node_email
node_posts -.->|"manages content"| node_database
node_projects -.->|"manages projects"| node_database
node_search -.->|"searches platform data"| node_database

click node_api "https://github.com/letopiaplatform/letopiaplatform/blob/main/src/LetopiaPlatform.API/Program.cs"
click node_routes "https://github.com/letopiaplatform/letopiaplatform/blob/main/src/LetopiaPlatform.API/AppMetaData/Router.cs"
click node_base "https://github.com/letopiaplatform/letopiaplatform/blob/main/src/LetopiaPlatform.API/Controllers/BaseController.cs"
click node_auth "https://github.com/letopiaplatform/letopiaplatform/blob/main/src/LetopiaPlatform.Infrastructure/Identity/AuthService.cs"
click node_communities "https://github.com/letopiaplatform/letopiaplatform/blob/main/src/LetopiaPlatform.API/Controllers/CommunitiesController.cs"
click node_communityservice "https://github.com/letopiaplatform/letopiaplatform/blob/main/src/LetopiaPlatform.Core/Interfaces/ICommunityService.cs"
click node_posts "https://github.com/letopiaplatform/letopiaplatform/blob/main/src/LetopiaPlatform.API/Controllers/PostsController.cs"
click node_projects "https://github.com/letopiaplatform/letopiaplatform/blob/main/src/LetopiaPlatform.API/Controllers/ProjectController.cs"
click node_search "https://github.com/letopiaplatform/letopiaplatform/blob/main/src/LetopiaPlatform.Infrastructure/Services/SearchService.cs"
click node_roadmapapi "https://github.com/letopiaplatform/letopiaplatform/blob/main/src/LetopiaPlatform.API/Controllers/RoadmapsController.cs"
click node_agentapi "https://github.com/letopiaplatform/letopiaplatform/blob/main/src/LetopiaPlatform.API/Controllers/AgentController.cs"
click node_roadmapagent "https://github.com/letopiaplatform/letopiaplatform/blob/main/src/LetopiaPlatform.Agent/Services/RoadmapAgentService.cs"
click node_websearch "https://github.com/letopiaplatform/letopiaplatform/blob/main/src/LetopiaPlatform.Agent/Services/TavilySearchService.cs"
click node_database "https://github.com/letopiaplatform/letopiaplatform/blob/main/src/LetopiaPlatform.Infrastructure/Data/ApplicationDbContext.cs"
click node_email "https://github.com/letopiaplatform/letopiaplatform/blob/main/src/LetopiaPlatform.Infrastructure/Services/Email/SmtpEmailService.cs"
click node_files "https://github.com/letopiaplatform/letopiaplatform/blob/main/src/LetopiaPlatform.Infrastructure/Services/LocalFileStorageService.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_api,node_routes,node_base,node_user toneBlue
class node_auth,node_communities,node_communityservice,node_posts,node_projects,node_search toneAmber
class node_roadmapapi,node_agentapi,node_roadmapagent,node_websearch toneMint
class node_database,node_email,node_files toneRose
```

## Components

### API layer

- [HTTP API](https://github.com/letopiaplatform/letopiaplatform/blob/main/src/LetopiaPlatform.API/Program.cs): `src/LetopiaPlatform.API/Program.cs`
- [API routes](https://github.com/letopiaplatform/letopiaplatform/blob/main/src/LetopiaPlatform.API/AppMetaData/Router.cs): `src/LetopiaPlatform.API/AppMetaData/Router.cs`
- [Controller responses](https://github.com/letopiaplatform/letopiaplatform/blob/main/src/LetopiaPlatform.API/Controllers/BaseController.cs): `src/LetopiaPlatform.API/Controllers/BaseController.cs`

### Platform features

- [Authentication](https://github.com/letopiaplatform/letopiaplatform/blob/main/src/LetopiaPlatform.Infrastructure/Identity/AuthService.cs): `src/LetopiaPlatform.Infrastructure/Identity/AuthService.cs`
- [Communities](https://github.com/letopiaplatform/letopiaplatform/blob/main/src/LetopiaPlatform.API/Controllers/CommunitiesController.cs): `src/LetopiaPlatform.API/Controllers/CommunitiesController.cs`
- [Community service contract](https://github.com/letopiaplatform/letopiaplatform/blob/main/src/LetopiaPlatform.Core/Interfaces/ICommunityService.cs): `src/LetopiaPlatform.Core/Interfaces/ICommunityService.cs`
- [Posts and comments](https://github.com/letopiaplatform/letopiaplatform/blob/main/src/LetopiaPlatform.API/Controllers/PostsController.cs): `src/LetopiaPlatform.API/Controllers/PostsController.cs`
- [Projects and milestones](https://github.com/letopiaplatform/letopiaplatform/blob/main/src/LetopiaPlatform.API/Controllers/ProjectController.cs): `src/LetopiaPlatform.API/Controllers/ProjectController.cs`
- [Platform search](https://github.com/letopiaplatform/letopiaplatform/blob/main/src/LetopiaPlatform.Infrastructure/Services/SearchService.cs): `src/LetopiaPlatform.Infrastructure/Services/SearchService.cs`

### Roadmap assistant

- [Roadmap endpoints](https://github.com/letopiaplatform/letopiaplatform/blob/main/src/LetopiaPlatform.API/Controllers/RoadmapsController.cs): `src/LetopiaPlatform.API/Controllers/RoadmapsController.cs`
- [Agent endpoints](https://github.com/letopiaplatform/letopiaplatform/blob/main/src/LetopiaPlatform.API/Controllers/AgentController.cs): `src/LetopiaPlatform.API/Controllers/AgentController.cs`
- [Roadmap agent](https://github.com/letopiaplatform/letopiaplatform/blob/main/src/LetopiaPlatform.Agent/Services/RoadmapAgentService.cs): `src/LetopiaPlatform.Agent/Services/RoadmapAgentService.cs`
- [Web search](https://github.com/letopiaplatform/letopiaplatform/blob/main/src/LetopiaPlatform.Agent/Services/TavilySearchService.cs): `src/LetopiaPlatform.Agent/Services/TavilySearchService.cs`

### Infrastructure

- [Application database](https://github.com/letopiaplatform/letopiaplatform/blob/main/src/LetopiaPlatform.Infrastructure/Data/ApplicationDbContext.cs): `src/LetopiaPlatform.Infrastructure/Data/ApplicationDbContext.cs`
- [Email delivery](https://github.com/letopiaplatform/letopiaplatform/blob/main/src/LetopiaPlatform.Infrastructure/Services/Email/SmtpEmailService.cs): `src/LetopiaPlatform.Infrastructure/Services/Email/SmtpEmailService.cs`
- [File storage](https://github.com/letopiaplatform/letopiaplatform/blob/main/src/LetopiaPlatform.Infrastructure/Services/LocalFileStorageService.cs): `src/LetopiaPlatform.Infrastructure/Services/LocalFileStorageService.cs`

### Other components

- **Platform user**

## Connections

- Platform user → HTTP API: sends requests
- HTTP API → API routes: maps controllers (evidence: `src/LetopiaPlatform.API/Program.cs`)
- Communities → Community service contract: calls (evidence: `src/LetopiaPlatform.API/Controllers/CommunitiesController.cs`)
- HTTP API → Controller responses: hosts controllers
- Agent endpoints → Roadmap agent: invokes
- Roadmap endpoints → Roadmap agent: uses
- Roadmap agent → Web search: invokes tool (evidence: `src/LetopiaPlatform.Agent/Services/RoadmapAgentService.cs`)
- Roadmap agent → Application database: persists conversations
- Authentication → Application database: uses context (evidence: `src/LetopiaPlatform.Infrastructure/Identity/AuthService.cs`)
- Authentication → Email delivery: queues messages (evidence: `src/LetopiaPlatform.Infrastructure/Identity/AuthService.cs`)
- Posts and comments → Application database: manages content
- Projects and milestones → Application database: manages projects
- Platform search → Application database: searches platform data
