# bl4kcy/muslim-room architecture

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

- Interactive diagram: https://gitdiagram.com/bl4kcy/muslim-room
- Repository: https://github.com/bl4kcy/muslim-room

## Overview

This is a FastAPI user-account service with password registration/login, Google OAuth login, and token-protected user identity support. The principal flow is HTTP routing into auth or user handlers, then service logic that creates or looks up users and issues or validates tokens using a database session. The graph preserves the API, auth, user, security, configuration, and persistence layers. The README is empty; relationships are based on the supplied source excerpts and SOURCE INDEX, so unsampled user-route behavior is kept at subsystem level.

Main entry points: [`app/modules/users/service.py`](https://github.com/bl4kcy/muslim-room/blob/main/app/modules/users/service.py) (User Service), [`app/modules/auth/service.py`](https://github.com/bl4kcy/muslim-room/blob/main/app/modules/auth/service.py) (Auth Service), [`app/modules/auth/router.py`](https://github.com/bl4kcy/muslim-room/blob/main/app/modules/auth/router.py) (Auth Endpoints), [`app/core/oauth.py`](https://github.com/bl4kcy/muslim-room/blob/main/app/core/oauth.py) (OAuth Configuration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["HTTP API"]
  node_application["FastAPI Application<br/>[app.py]"]
  node_api_root["API Router<br/>[router.py]"]
  node_v1_router["Version 1 Routes<br/>[router.py]"]
  node_auth_routes["Auth Endpoints<br/>[router.py]"]
  node_user_routes["User Endpoints<br/>[router.py]"]
end

subgraph group_auth["Authentication"]
  node_auth_service["Auth Service<br/>[service.py]"]
  node_auth_schema["Token Schemas<br/>[schema.py]"]
  node_oauth_config["OAuth Configuration<br/>[oauth.py]"]
end

subgraph group_users["User Accounts"]
  node_user_service["User Service<br/>[service.py]"]
  node_user_schema["User Schemas<br/>[schema.py]"]
  node_user_model["User Model<br/>[model.py]"]
  node_user_types["User Types<br/>[types.py]"]
end

subgraph group_infra["Security and Persistence"]
  node_security["Token and Password Security<br/>[security.py]"]
  node_settings["Application Settings<br/>[config.py]"]
  node_session_dependency["Session Dependency<br/>[dependences.py]"]
  node_database[("Database Session<br/>[database.py]")]
end

node_client(("HTTP Client"))
node_google["Google OAuth"]

node_client -.->|"sends requests"| node_application
node_application -->|"mounts routes"| node_api_root
node_application -->|"initializes tables"| node_database
node_api_root -->|"includes routes"| node_v1_router
node_v1_router -->|"includes routes"| node_auth_routes
node_v1_router -->|"includes routes"| node_user_routes
node_auth_routes -->|"delegates login"| node_auth_service
node_auth_routes -->|"delegates registration"| node_user_service
node_auth_routes -->|"starts redirect"| node_oauth_config
node_auth_service -->|"authorizes callback"| node_oauth_config
node_oauth_config -->|"registers provider"| node_google
node_auth_service -->|"looks up or creates users"| node_user_service
node_auth_service -->|"verifies and issues tokens"| node_security
node_auth_service -->|"returns token"| node_auth_schema
node_user_routes -->|"delegates operations"| node_user_service
node_user_service -->|"hashes and validates"| node_security
node_user_service -->|"queries and creates"| node_user_model
node_user_service -->|"accepts and returns"| node_user_schema
node_user_model -->|"uses account types"| node_user_types
node_user_schema -->|"uses field types"| node_user_types
node_auth_service -->|"requests session"| node_session_dependency
node_user_service -->|"requests session"| node_session_dependency
node_session_dependency -->|"yields sessions"| node_database
node_security -->|"reads token settings"| node_settings
node_user_service -->|"reads token settings"| node_settings
node_oauth_config -->|"reads provider credentials"| node_settings
node_database -->|"reads database URL"| node_settings

click node_application "https://github.com/bl4kcy/muslim-room/blob/main/app/app.py"
click node_api_root "https://github.com/bl4kcy/muslim-room/blob/main/app/api/router.py"
click node_v1_router "https://github.com/bl4kcy/muslim-room/blob/main/app/api/v1/router.py"
click node_auth_routes "https://github.com/bl4kcy/muslim-room/blob/main/app/modules/auth/router.py"
click node_user_routes "https://github.com/bl4kcy/muslim-room/blob/main/app/modules/users/router.py"
click node_auth_service "https://github.com/bl4kcy/muslim-room/blob/main/app/modules/auth/service.py"
click node_auth_schema "https://github.com/bl4kcy/muslim-room/blob/main/app/modules/auth/schema.py"
click node_oauth_config "https://github.com/bl4kcy/muslim-room/blob/main/app/core/oauth.py"
click node_user_service "https://github.com/bl4kcy/muslim-room/blob/main/app/modules/users/service.py"
click node_user_schema "https://github.com/bl4kcy/muslim-room/blob/main/app/modules/users/schema.py"
click node_user_model "https://github.com/bl4kcy/muslim-room/blob/main/app/modules/users/model.py"
click node_user_types "https://github.com/bl4kcy/muslim-room/blob/main/app/modules/users/types.py"
click node_security "https://github.com/bl4kcy/muslim-room/blob/main/app/core/security.py"
click node_settings "https://github.com/bl4kcy/muslim-room/blob/main/app/core/config.py"
click node_session_dependency "https://github.com/bl4kcy/muslim-room/blob/main/app/dependences.py"
click node_database "https://github.com/bl4kcy/muslim-room/blob/main/app/db/database.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_application,node_api_root,node_v1_router,node_auth_routes,node_user_routes,node_client toneBlue
class node_auth_service,node_auth_schema,node_oauth_config toneAmber
class node_user_service,node_user_schema,node_user_model,node_user_types toneMint
class node_security,node_settings,node_session_dependency,node_database toneRose
class node_google toneIndigo
```

## Components

### HTTP API

- [FastAPI Application](https://github.com/bl4kcy/muslim-room/blob/main/app/app.py): `app/app.py`
- [API Router](https://github.com/bl4kcy/muslim-room/blob/main/app/api/router.py): `app/api/router.py`
- [Version 1 Routes](https://github.com/bl4kcy/muslim-room/blob/main/app/api/v1/router.py): `app/api/v1/router.py`
- [Auth Endpoints](https://github.com/bl4kcy/muslim-room/blob/main/app/modules/auth/router.py): `app/modules/auth/router.py`
- [User Endpoints](https://github.com/bl4kcy/muslim-room/blob/main/app/modules/users/router.py): `app/modules/users/router.py`

### Authentication

- [Auth Service](https://github.com/bl4kcy/muslim-room/blob/main/app/modules/auth/service.py): `app/modules/auth/service.py`
- [Token Schemas](https://github.com/bl4kcy/muslim-room/blob/main/app/modules/auth/schema.py): `app/modules/auth/schema.py`
- [OAuth Configuration](https://github.com/bl4kcy/muslim-room/blob/main/app/core/oauth.py): `app/core/oauth.py`

### User Accounts

- [User Service](https://github.com/bl4kcy/muslim-room/blob/main/app/modules/users/service.py): `app/modules/users/service.py`
- [User Schemas](https://github.com/bl4kcy/muslim-room/blob/main/app/modules/users/schema.py): `app/modules/users/schema.py`
- [User Model](https://github.com/bl4kcy/muslim-room/blob/main/app/modules/users/model.py): `app/modules/users/model.py`
- [User Types](https://github.com/bl4kcy/muslim-room/blob/main/app/modules/users/types.py): `app/modules/users/types.py`

### Security and Persistence

- [Token and Password Security](https://github.com/bl4kcy/muslim-room/blob/main/app/core/security.py): `app/core/security.py`
- [Application Settings](https://github.com/bl4kcy/muslim-room/blob/main/app/core/config.py): `app/core/config.py`
- [Session Dependency](https://github.com/bl4kcy/muslim-room/blob/main/app/dependences.py): `app/dependences.py`
- [Database Session](https://github.com/bl4kcy/muslim-room/blob/main/app/db/database.py): `app/db/database.py`

### Other components

- **HTTP Client**
- **Google OAuth**

## Connections

- HTTP Client → FastAPI Application: sends requests
- FastAPI Application → API Router: mounts routes (evidence: `app/app.py`)
- FastAPI Application → Database Session: initializes tables (evidence: `app/app.py`)
- API Router → Version 1 Routes: includes routes (evidence: `app/api/router.py`)
- Version 1 Routes → Auth Endpoints: includes routes (evidence: `app/api/v1/router.py`)
- Version 1 Routes → User Endpoints: includes routes (evidence: `app/api/v1/router.py`)
- Auth Endpoints → Auth Service: delegates login (evidence: `app/modules/auth/router.py`)
- Auth Endpoints → User Service: delegates registration (evidence: `app/modules/auth/router.py`)
- Auth Endpoints → OAuth Configuration: starts redirect (evidence: `app/modules/auth/router.py`)
- Auth Service → OAuth Configuration: authorizes callback (evidence: `app/modules/auth/service.py`)
- OAuth Configuration → Google OAuth: registers provider (evidence: `app/core/oauth.py`)
- Auth Service → User Service: looks up or creates users (evidence: `app/modules/auth/service.py`)
- Auth Service → Token and Password Security: verifies and issues tokens (evidence: `app/modules/auth/service.py`)
- Auth Service → Token Schemas: returns token (evidence: `app/modules/auth/service.py`)
- User Endpoints → User Service: delegates operations (evidence: `app/modules/users/router.py`)
- User Service → Token and Password Security: hashes and validates (evidence: `app/modules/users/service.py`)
- User Service → User Model: queries and creates (evidence: `app/modules/users/service.py`)
- User Service → User Schemas: accepts and returns (evidence: `app/modules/users/service.py`)
- User Model → User Types: uses account types (evidence: `app/modules/users/model.py`)
- User Schemas → User Types: uses field types (evidence: `app/modules/users/schema.py`)
- Auth Service → Session Dependency: requests session (evidence: `app/modules/auth/service.py`)
- User Service → Session Dependency: requests session (evidence: `app/modules/users/service.py`)
- Session Dependency → Database Session: yields sessions (evidence: `app/dependences.py`)
- Token and Password Security → Application Settings: reads token settings (evidence: `app/core/security.py`)
- User Service → Application Settings: reads token settings (evidence: `app/modules/users/service.py`)
- OAuth Configuration → Application Settings: reads provider credentials (evidence: `app/core/oauth.py`)
- Database Session → Application Settings: reads database URL (evidence: `app/db/database.py`)
