# giorgibaramidze/fastapi-social-network architecture

> Architecture diagram of the GitHub repository giorgibaramidze/fastapi-social-network, 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/giorgibaramidze/fastapi-social-network
- Repository: https://github.com/giorgibaramidze/fastapi-social-network

## Overview

This is a FastAPI blog application whose inspected runtime currently exposes an account-registration and email-verification flow: HTTP requests reach auth routes, which delegate to an auth service and persist user, profile, and verification-token state before sending verification email. The model and repository modules also define session and user/profile state. README content is empty, and user routes/services plus several integrations were not sampled, so those areas are shown only where the source index supports them; no broader blog-content workflow is inferred.

Main entry points: [`app/modules/auth/services.py`](https://github.com/giorgibaramidze/fastapi-social-network/blob/main/app/modules/auth/services.py) (Auth Service), [`app/modules/auth/routes.py`](https://github.com/giorgibaramidze/fastapi-social-network/blob/main/app/modules/auth/routes.py) (Auth Routes), [`app/modules/users/models.py`](https://github.com/giorgibaramidze/fastapi-social-network/blob/main/app/modules/users/models.py) (User Model), [`app/modules/auth/models.py`](https://github.com/giorgibaramidze/fastapi-social-network/blob/main/app/modules/auth/models.py) (Auth Records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and Auth"]
  node_app["FastAPI App<br/>[main.py]"]
  node_auth_routes["Auth Routes<br/>[routes.py]"]
  node_auth_schemas["Auth Schemas<br/>[schemas.py]"]
  node_auth_dependencies["Auth Dependencies<br/>[dependencies.py]"]
  node_auth_service["Auth Service<br/>[services.py]"]
end

subgraph group_identity["Identity Domain"]
  node_auth_enums["Domain Enums<br/>[enums.py]"]
  node_user_model["User Model<br/>[models.py]"]
  node_user_repository["User Repository<br/>[repositories.py]"]
  node_user_routes["User Routes<br/>[routes.py]"]
  node_user_services["User Services<br/>[services.py]"]
  node_profile_model["Profile Model<br/>[models.py]"]
  node_profile_repository["Profile Repository<br/>[repositories.py]"]
  node_auth_models["Auth Records<br/>[models.py]"]
  node_auth_repository["Auth Repositories<br/>[repositories.py]"]
end

subgraph group_platform["Application Platform"]
  node_email_sender["Verification Email<br/>[email.py]"]
  node_security["Security Utilities<br/>[security.py]"]
  node_configuration["Settings<br/>[config.py]"]
  node_error_types["App Exceptions<br/>[base.py]"]
  node_error_handlers["Exception Handlers<br/>[handlers.py]"]
  node_db_session["DB Session<br/>[session.py]"]
  node_db_base["ORM Base<br/>[base.py]"]
  node_db_mixins["Model Mixins<br/>[mixins.py]"]
end

node_client(("API Client"))
node_database[("Relational Database")]

node_client -->|"sends requests"| node_app
node_app -->|"registers routes"| node_auth_routes
node_app -->|"registers handlers"| node_error_handlers
node_auth_routes -->|"uses schemas"| node_auth_schemas
node_auth_routes -->|"resolves service"| node_auth_dependencies
node_auth_routes -->|"injects session"| node_db_session
node_auth_routes -->|"calls service"| node_auth_service
node_auth_routes -->|"schedules email"| node_email_sender
node_auth_service -->|"checks and creates"| node_user_repository
node_auth_service -->|"creates profile"| node_profile_repository
node_auth_service -->|"manages token"| node_auth_repository
node_auth_service -->|"hashes tokens"| node_security
node_auth_service -->|"selects token type"| node_auth_enums
node_auth_service -->|"accepts request"| node_auth_schemas
node_auth_service -->|"raises domain errors"| node_error_types
node_auth_repository -->|"queries and writes"| node_auth_models
node_auth_repository -->|"reads and writes"| node_database
node_profile_repository -->|"creates record"| node_profile_model
node_user_repository -->|"uses model"| node_user_model
node_profile_model -->|"relates to user"| node_user_model
node_user_model -->|"relates sessions"| node_auth_models
node_user_model -->|"uses role enum"| node_auth_enums
node_auth_models -->|"uses token enums"| node_auth_enums
node_auth_models -->|"references user"| node_user_model
node_profile_model -->|"extends base"| node_db_base
node_user_model -->|"extends base"| node_db_base
node_auth_models -->|"extends base"| node_db_base
node_db_base -->|"inherits mixin"| node_db_mixins
node_db_session -->|"loads settings"| node_configuration
node_email_sender -->|"loads settings"| node_configuration
node_security -->|"loads settings"| node_configuration
node_error_handlers -->|"handles exceptions"| node_error_types

click node_app "https://github.com/giorgibaramidze/fastapi-social-network/blob/main/app/main.py"
click node_auth_routes "https://github.com/giorgibaramidze/fastapi-social-network/blob/main/app/modules/auth/routes.py"
click node_auth_schemas "https://github.com/giorgibaramidze/fastapi-social-network/blob/main/app/modules/auth/schemas.py"
click node_auth_dependencies "https://github.com/giorgibaramidze/fastapi-social-network/blob/main/app/modules/auth/dependencies.py"
click node_auth_service "https://github.com/giorgibaramidze/fastapi-social-network/blob/main/app/modules/auth/services.py"
click node_email_sender "https://github.com/giorgibaramidze/fastapi-social-network/blob/main/app/core/email.py"
click node_security "https://github.com/giorgibaramidze/fastapi-social-network/blob/main/app/core/security.py"
click node_configuration "https://github.com/giorgibaramidze/fastapi-social-network/blob/main/app/core/config.py"
click node_error_types "https://github.com/giorgibaramidze/fastapi-social-network/blob/main/app/core/exceptions/base.py"
click node_error_handlers "https://github.com/giorgibaramidze/fastapi-social-network/blob/main/app/core/exceptions/handlers.py"
click node_db_session "https://github.com/giorgibaramidze/fastapi-social-network/blob/main/app/db/session.py"
click node_db_base "https://github.com/giorgibaramidze/fastapi-social-network/blob/main/app/db/base.py"
click node_db_mixins "https://github.com/giorgibaramidze/fastapi-social-network/blob/main/app/db/mixins.py"
click node_auth_enums "https://github.com/giorgibaramidze/fastapi-social-network/blob/main/app/db/enums.py"
click node_user_model "https://github.com/giorgibaramidze/fastapi-social-network/blob/main/app/modules/users/models.py"
click node_user_repository "https://github.com/giorgibaramidze/fastapi-social-network/blob/main/app/modules/users/repositories.py"
click node_user_routes "https://github.com/giorgibaramidze/fastapi-social-network/blob/main/app/modules/users/routes.py"
click node_user_services "https://github.com/giorgibaramidze/fastapi-social-network/blob/main/app/modules/users/services.py"
click node_profile_model "https://github.com/giorgibaramidze/fastapi-social-network/blob/main/app/modules/profiles/models.py"
click node_profile_repository "https://github.com/giorgibaramidze/fastapi-social-network/blob/main/app/modules/profiles/repositories.py"
click node_auth_models "https://github.com/giorgibaramidze/fastapi-social-network/blob/main/app/modules/auth/models.py"
click node_auth_repository "https://github.com/giorgibaramidze/fastapi-social-network/blob/main/app/modules/auth/repositories.py"

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_app,node_auth_routes,node_auth_schemas,node_auth_dependencies,node_auth_service,node_client toneBlue
class node_auth_enums,node_user_model,node_user_repository,node_user_routes,node_user_services,node_profile_model,node_profile_repository,node_auth_models,node_auth_repository,node_database toneAmber
class node_email_sender,node_security,node_configuration,node_error_types,node_error_handlers,node_db_session,node_db_base,node_db_mixins toneMint
```

## Components

### API and Auth

- [FastAPI App](https://github.com/giorgibaramidze/fastapi-social-network/blob/main/app/main.py): `app/main.py`
- [Auth Routes](https://github.com/giorgibaramidze/fastapi-social-network/blob/main/app/modules/auth/routes.py): `app/modules/auth/routes.py`
- [Auth Schemas](https://github.com/giorgibaramidze/fastapi-social-network/blob/main/app/modules/auth/schemas.py): `app/modules/auth/schemas.py`
- [Auth Dependencies](https://github.com/giorgibaramidze/fastapi-social-network/blob/main/app/modules/auth/dependencies.py): `app/modules/auth/dependencies.py`
- [Auth Service](https://github.com/giorgibaramidze/fastapi-social-network/blob/main/app/modules/auth/services.py): `app/modules/auth/services.py`

### Identity Domain

- [Domain Enums](https://github.com/giorgibaramidze/fastapi-social-network/blob/main/app/db/enums.py): `app/db/enums.py`
- [User Model](https://github.com/giorgibaramidze/fastapi-social-network/blob/main/app/modules/users/models.py): `app/modules/users/models.py`
- [User Repository](https://github.com/giorgibaramidze/fastapi-social-network/blob/main/app/modules/users/repositories.py): `app/modules/users/repositories.py`
- [User Routes](https://github.com/giorgibaramidze/fastapi-social-network/blob/main/app/modules/users/routes.py): `app/modules/users/routes.py`
- [User Services](https://github.com/giorgibaramidze/fastapi-social-network/blob/main/app/modules/users/services.py): `app/modules/users/services.py`
- [Profile Model](https://github.com/giorgibaramidze/fastapi-social-network/blob/main/app/modules/profiles/models.py): `app/modules/profiles/models.py`
- [Profile Repository](https://github.com/giorgibaramidze/fastapi-social-network/blob/main/app/modules/profiles/repositories.py): `app/modules/profiles/repositories.py`
- [Auth Records](https://github.com/giorgibaramidze/fastapi-social-network/blob/main/app/modules/auth/models.py): `app/modules/auth/models.py`
- [Auth Repositories](https://github.com/giorgibaramidze/fastapi-social-network/blob/main/app/modules/auth/repositories.py): `app/modules/auth/repositories.py`

### Application Platform

- [Verification Email](https://github.com/giorgibaramidze/fastapi-social-network/blob/main/app/core/email.py): `app/core/email.py`
- [Security Utilities](https://github.com/giorgibaramidze/fastapi-social-network/blob/main/app/core/security.py): `app/core/security.py`
- [Settings](https://github.com/giorgibaramidze/fastapi-social-network/blob/main/app/core/config.py): `app/core/config.py`
- [App Exceptions](https://github.com/giorgibaramidze/fastapi-social-network/blob/main/app/core/exceptions/base.py): `app/core/exceptions/base.py`
- [Exception Handlers](https://github.com/giorgibaramidze/fastapi-social-network/blob/main/app/core/exceptions/handlers.py): `app/core/exceptions/handlers.py`
- [DB Session](https://github.com/giorgibaramidze/fastapi-social-network/blob/main/app/db/session.py): `app/db/session.py`
- [ORM Base](https://github.com/giorgibaramidze/fastapi-social-network/blob/main/app/db/base.py): `app/db/base.py`
- [Model Mixins](https://github.com/giorgibaramidze/fastapi-social-network/blob/main/app/db/mixins.py): `app/db/mixins.py`

### Other components

- **API Client**
- **Relational Database**

## Connections

- API Client → FastAPI App: sends requests
- FastAPI App → Auth Routes: registers routes (evidence: `app/main.py`)
- FastAPI App → Exception Handlers: registers handlers (evidence: `app/main.py`)
- Auth Routes → Auth Schemas: uses schemas (evidence: `app/modules/auth/routes.py`)
- Auth Routes → Auth Dependencies: resolves service (evidence: `app/modules/auth/routes.py`)
- Auth Routes → DB Session: injects session (evidence: `app/modules/auth/routes.py`)
- Auth Routes → Auth Service: calls service (evidence: `app/modules/auth/routes.py`)
- Auth Routes → Verification Email: schedules email (evidence: `app/modules/auth/routes.py`)
- Auth Service → User Repository: checks and creates (evidence: `app/modules/auth/services.py`)
- Auth Service → Profile Repository: creates profile (evidence: `app/modules/auth/services.py`)
- Auth Service → Auth Repositories: manages token (evidence: `app/modules/auth/services.py`)
- Auth Service → Security Utilities: hashes tokens (evidence: `app/modules/auth/services.py`)
- Auth Service → Domain Enums: selects token type (evidence: `app/modules/auth/services.py`)
- Auth Service → Auth Schemas: accepts request (evidence: `app/modules/auth/services.py`)
- Auth Service → App Exceptions: raises domain errors (evidence: `app/modules/auth/services.py`)
- Auth Repositories → Auth Records: queries and writes (evidence: `app/modules/auth/repositories.py`)
- Auth Repositories → Relational Database: reads and writes (evidence: `app/modules/auth/repositories.py`)
- Profile Repository → Profile Model: creates record (evidence: `app/modules/profiles/repositories.py`)
- User Repository → User Model: uses model (evidence: `app/modules/users/repositories.py`)
- Profile Model → User Model: relates to user (evidence: `app/modules/profiles/models.py`)
- User Model → Auth Records: relates sessions (evidence: `app/modules/users/models.py`)
- User Model → Domain Enums: uses role enum (evidence: `app/modules/users/models.py`)
- Auth Records → Domain Enums: uses token enums (evidence: `app/modules/auth/models.py`)
- Auth Records → User Model: references user (evidence: `app/modules/auth/models.py`)
- Profile Model → ORM Base: extends base (evidence: `app/modules/profiles/models.py`)
- User Model → ORM Base: extends base (evidence: `app/modules/users/models.py`)
- Auth Records → ORM Base: extends base (evidence: `app/modules/auth/models.py`)
- ORM Base → Model Mixins: inherits mixin (evidence: `app/db/base.py`)
- DB Session → Settings: loads settings (evidence: `app/db/session.py`)
- Verification Email → Settings: loads settings (evidence: `app/core/email.py`)
- Security Utilities → Settings: loads settings (evidence: `app/core/security.py`)
- Exception Handlers → App Exceptions: handles exceptions (evidence: `app/core/exceptions/handlers.py`)
