# domainexpansion26/techguild_backend architecture

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

- Interactive diagram: https://gitdiagram.com/domainexpansion26/techguild_backend
- Repository: https://github.com/domainexpansion26/techguild_backend

## Overview

TechGuild Backend is a Go API for a platform with user accounts, profiles, parties, projects, quests, and client task management. The principal workflow is an API request routed to a controller, which invokes domain logic and (for sampled authentication code) persists account or session state. The startup file registers the route families; sampled routes and handlers show profile and party dispatch. Many domain handlers and repositories are unsampled, so their internal links are omitted or marked unverified rather than inferred.

Main entry points: [`backend/cmd/server/main.go`](https://github.com/domainexpansion26/techguild_backend/blob/main/backend/cmd/server/main.go) (HTTP Server), [`backend/src/routes/auth_routes.go`](https://github.com/domainexpansion26/techguild_backend/blob/main/backend/src/routes/auth_routes.go) (Identity Routes), [`backend/src/controllers/oauth_controller.go`](https://github.com/domainexpansion26/techguild_backend/blob/main/backend/src/controllers/oauth_controller.go) (OAuth Handlers), [`backend/src/services/auth_service.go`](https://github.com/domainexpansion26/techguild_backend/blob/main/backend/src/services/auth_service.go) (Auth Service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API Runtime"]
  node_server["HTTP Server<br/>[main.go]"]
  node_identity_routes["Identity Routes<br/>[auth_routes.go]"]
  node_profile_routes["Profile Routes<br/>[profile_routes.go]"]
  node_party_routes["Party Routes<br/>[party_routes.go]"]
  node_work_routes["Work Routes"]
  node_other_routes["Other Domain Routes"]
end

subgraph group_identity["Identity &amp; Profiles"]
  node_auth_controller["Auth Handlers<br/>[auth_controller.go]"]
  node_oauth_controller["OAuth Handlers"]
  node_profile_controller["Profile Handlers"]
  node_auth_service["Auth Service<br/>[auth_service.go]"]
  node_oauth_service["OAuth Service<br/>[oauth_service.go]"]
  node_profile_service["Profile Service<br/>[profile_service.go]"]
end

subgraph group_work["Platform Workflows"]
  node_party_controller["Party Handlers"]
  node_work_controllers["Work Handlers"]
  node_party_service["Party Service<br/>[party_services.go]"]
  node_work_services["Work Services"]
end

subgraph group_data["Persistence"]
  node_user_repository["User Repository<br/>[user_repository.go]"]
  node_domain_repositories["Domain Repositories"]
  node_postgres[("PostgreSQL<br/>[postgres.go]")]
  node_redis[("Redis")]
end

node_client(("API Client"))
node_oauth_providers["OAuth Providers"]

node_client -.->|"sends requests"| node_server
node_server -->|"registers routes"| node_identity_routes
node_server -->|"registers routes"| node_profile_routes
node_server -->|"registers routes"| node_party_routes
node_server -->|"registers routes"| node_work_routes
node_server -->|"registers routes"| node_other_routes
node_identity_routes -.->|"dispatches to"| node_auth_controller
node_identity_routes -.->|"dispatches to"| node_oauth_controller
node_profile_routes -->|"dispatches to"| node_profile_controller
node_party_routes -->|"dispatches to"| node_party_controller
node_work_routes -.->|"dispatches to"| node_work_controllers
node_other_routes -.->|"dispatches to"| node_work_controllers
node_auth_controller -.->|"delegates to"| node_auth_service
node_oauth_controller -.->|"delegates to"| node_oauth_service
node_profile_controller -->|"calls"| node_profile_service
node_party_controller -->|"calls"| node_party_service
node_work_controllers -.->|"delegates to"| node_work_services
node_auth_service -->|"uses"| node_user_repository
node_oauth_service -->|"uses"| node_user_repository
node_auth_service -->|"uses verification cache"| node_redis
node_user_repository -->|"uses database"| node_postgres
node_profile_service -.->|"persists profile data"| node_domain_repositories
node_party_service -.->|"persists party data"| node_domain_repositories
node_work_services -.->|"uses repositories"| node_domain_repositories
node_oauth_controller -->|"fetches provider identity"| node_oauth_providers

click node_server "https://github.com/domainexpansion26/techguild_backend/blob/main/backend/cmd/server/main.go"
click node_identity_routes "https://github.com/domainexpansion26/techguild_backend/blob/main/backend/src/routes/auth_routes.go"
click node_profile_routes "https://github.com/domainexpansion26/techguild_backend/blob/main/backend/src/routes/profile_routes.go"
click node_party_routes "https://github.com/domainexpansion26/techguild_backend/blob/main/backend/src/routes/party_routes.go"
click node_work_routes "https://github.com/domainexpansion26/techguild_backend/blob/main/backend/src/routes/task_management_routes.go"
click node_other_routes "https://github.com/domainexpansion26/techguild_backend/tree/main/backend/src/routes"
click node_auth_controller "https://github.com/domainexpansion26/techguild_backend/blob/main/backend/src/controllers/auth_controller.go"
click node_oauth_controller "https://github.com/domainexpansion26/techguild_backend/blob/main/backend/src/controllers/oauth_controller.go"
click node_profile_controller "https://github.com/domainexpansion26/techguild_backend/blob/main/backend/src/controllers/profile_controller.go"
click node_party_controller "https://github.com/domainexpansion26/techguild_backend/blob/main/backend/src/controllers/party_controller.go"
click node_work_controllers "https://github.com/domainexpansion26/techguild_backend/tree/main/backend/src/controllers"
click node_auth_service "https://github.com/domainexpansion26/techguild_backend/blob/main/backend/src/services/auth_service.go"
click node_oauth_service "https://github.com/domainexpansion26/techguild_backend/blob/main/backend/src/services/oauth_service.go"
click node_profile_service "https://github.com/domainexpansion26/techguild_backend/blob/main/backend/src/services/profile_service.go"
click node_party_service "https://github.com/domainexpansion26/techguild_backend/blob/main/backend/src/services/party_services.go"
click node_work_services "https://github.com/domainexpansion26/techguild_backend/tree/main/backend/src/services"
click node_user_repository "https://github.com/domainexpansion26/techguild_backend/blob/main/backend/src/repository/user_repository.go"
click node_domain_repositories "https://github.com/domainexpansion26/techguild_backend/tree/main/backend/src/repository"
click node_postgres "https://github.com/domainexpansion26/techguild_backend/blob/main/backend/src/database/postgres/postgres.go"

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_server,node_identity_routes,node_profile_routes,node_party_routes,node_work_routes,node_other_routes,node_client toneBlue
class node_auth_controller,node_oauth_controller,node_profile_controller,node_auth_service,node_oauth_service,node_profile_service toneAmber
class node_party_controller,node_work_controllers,node_party_service,node_work_services toneMint
class node_user_repository,node_domain_repositories,node_postgres,node_redis toneRose
class node_oauth_providers toneIndigo
```

## Components

### API Runtime

- [HTTP Server](https://github.com/domainexpansion26/techguild_backend/blob/main/backend/cmd/server/main.go): `backend/cmd/server/main.go`
- [Identity Routes](https://github.com/domainexpansion26/techguild_backend/blob/main/backend/src/routes/auth_routes.go): `backend/src/routes/auth_routes.go`
- [Profile Routes](https://github.com/domainexpansion26/techguild_backend/blob/main/backend/src/routes/profile_routes.go): `backend/src/routes/profile_routes.go`
- [Party Routes](https://github.com/domainexpansion26/techguild_backend/blob/main/backend/src/routes/party_routes.go): `backend/src/routes/party_routes.go`
- [Work Routes](https://github.com/domainexpansion26/techguild_backend/blob/main/backend/src/routes/task_management_routes.go): `backend/src/routes/task_management_routes.go`
- [Other Domain Routes](https://github.com/domainexpansion26/techguild_backend/tree/main/backend/src/routes): `backend/src/routes`

### Identity & Profiles

- [Auth Handlers](https://github.com/domainexpansion26/techguild_backend/blob/main/backend/src/controllers/auth_controller.go): `backend/src/controllers/auth_controller.go`
- [OAuth Handlers](https://github.com/domainexpansion26/techguild_backend/blob/main/backend/src/controllers/oauth_controller.go): `backend/src/controllers/oauth_controller.go`
- [Profile Handlers](https://github.com/domainexpansion26/techguild_backend/blob/main/backend/src/controllers/profile_controller.go): `backend/src/controllers/profile_controller.go`
- [Auth Service](https://github.com/domainexpansion26/techguild_backend/blob/main/backend/src/services/auth_service.go): `backend/src/services/auth_service.go`
- [OAuth Service](https://github.com/domainexpansion26/techguild_backend/blob/main/backend/src/services/oauth_service.go): `backend/src/services/oauth_service.go`
- [Profile Service](https://github.com/domainexpansion26/techguild_backend/blob/main/backend/src/services/profile_service.go): `backend/src/services/profile_service.go`

### Platform Workflows

- [Party Handlers](https://github.com/domainexpansion26/techguild_backend/blob/main/backend/src/controllers/party_controller.go): `backend/src/controllers/party_controller.go`
- [Work Handlers](https://github.com/domainexpansion26/techguild_backend/tree/main/backend/src/controllers): `backend/src/controllers`
- [Party Service](https://github.com/domainexpansion26/techguild_backend/blob/main/backend/src/services/party_services.go): `backend/src/services/party_services.go`
- [Work Services](https://github.com/domainexpansion26/techguild_backend/tree/main/backend/src/services): `backend/src/services`

### Persistence

- [User Repository](https://github.com/domainexpansion26/techguild_backend/blob/main/backend/src/repository/user_repository.go): `backend/src/repository/user_repository.go`
- [Domain Repositories](https://github.com/domainexpansion26/techguild_backend/tree/main/backend/src/repository): `backend/src/repository`
- [PostgreSQL](https://github.com/domainexpansion26/techguild_backend/blob/main/backend/src/database/postgres/postgres.go): `backend/src/database/postgres/postgres.go`
- **Redis**

### Other components

- **API Client**
- **OAuth Providers**

## Connections

- API Client → HTTP Server: sends requests
- HTTP Server → Identity Routes: registers routes (evidence: `backend/cmd/server/main.go`)
- HTTP Server → Profile Routes: registers routes (evidence: `backend/cmd/server/main.go`)
- HTTP Server → Party Routes: registers routes (evidence: `backend/cmd/server/main.go`)
- HTTP Server → Work Routes: registers routes (evidence: `backend/cmd/server/main.go`)
- HTTP Server → Other Domain Routes: registers routes (evidence: `backend/cmd/server/main.go`)
- Identity Routes → Auth Handlers: dispatches to
- Identity Routes → OAuth Handlers: dispatches to
- Profile Routes → Profile Handlers: dispatches to (evidence: `backend/src/routes/profile_routes.go`)
- Party Routes → Party Handlers: dispatches to (evidence: `backend/src/routes/party_routes.go`)
- Work Routes → Work Handlers: dispatches to
- Other Domain Routes → Work Handlers: dispatches to
- Auth Handlers → Auth Service: delegates to
- OAuth Handlers → OAuth Service: delegates to
- Profile Handlers → Profile Service: calls (evidence: `backend/src/controllers/profile_controller.go`)
- Party Handlers → Party Service: calls (evidence: `backend/src/controllers/party_controller.go`)
- Work Handlers → Work Services: delegates to
- Auth Service → User Repository: uses (evidence: `backend/src/services/auth_service.go`)
- OAuth Service → User Repository: uses (evidence: `backend/src/services/oauth_service.go`)
- Auth Service → Redis: uses verification cache (evidence: `backend/src/services/auth_service.go`)
- User Repository → PostgreSQL: uses database (evidence: `backend/src/repository/user_repository.go`)
- Profile Service → Domain Repositories: persists profile data
- Party Service → Domain Repositories: persists party data
- Work Services → Domain Repositories: uses repositories
- OAuth Handlers → OAuth Providers: fetches provider identity (evidence: `backend/src/controllers/oauth_controller.go`)
