# 0llrayll0-beep/festouu_api architecture

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

- Interactive diagram: https://gitdiagram.com/0llrayll0-beep/festouu_api
- Repository: https://github.com/0llrayll0-beep/festouu_api

## Overview

Festeu is a FastAPI backend for event-service listings and user interactions. Clients send requests through the API entry point to account, listing, search, profile/information, and chat capabilities; those handlers read or write PostgreSQL, with JWT services protecting user operations. Google sign-in verifies an external identity before creating or linking an account and returning an application token. The sampled code shows these domain stages and integrations; routing registration for several modules is not visible, so those dispatch links are marked unverified.

Main entry points: [`main.py`](https://github.com/0llrayll0-beep/festouu_api/blob/main/main.py) (FastAPI application), [`database.py`](https://github.com/0llrayll0-beep/festouu_api/blob/main/database.py) (Database pool), [`services/jwt_service.py`](https://github.com/0llrayll0-beep/festouu_api/blob/main/services/jwt_service.py) (JWT access control), [`routes/auth.py`](https://github.com/0llrayll0-beep/festouu_api/blob/main/routes/auth.py) (Google login route)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API runtime"]
  node_app["FastAPI application<br/>[main.py]"]
  node_status["Status endpoints<br/>[status_api.py]"]
end

subgraph group_accounts["Accounts and access"]
  node_users["Account management<br/>[users.py]"]
  node_google_login["Google login route<br/>[auth.py]"]
  node_google_verify["Google token verification<br/>[google_auth.py]"]
  node_auth_ops["Account auth operations<br/>[auth_service.py]"]
  node_jwt["JWT access control<br/>[jwt_service.py]"]
end

subgraph group_marketplace["Listings and discovery"]
  node_posts["Event listings<br/>[posts.py]"]
  node_search["Listing search<br/>[search.py]"]
  node_info["Profiles and information<br/>[info.py]"]
end

subgraph group_engagement["User engagement"]
  node_chats["Chat and messaging<br/>[chats.py]"]
end

subgraph group_infra["Persistence and integrations"]
  node_postgres[("PostgreSQL")]
  node_db_pool["Database pool<br/>[database.py]"]
  node_config["Runtime configuration<br/>[config.py]"]
end

node_client(("API client"))
node_google["Google identity service"]
node_viacep["ViaCEP service"]

node_client -->|"sends requests"| node_app
node_app -.->|"dispatches to"| node_status
node_app -.->|"dispatches to"| node_users
node_app -.->|"dispatches to"| node_google_login
node_app -.->|"dispatches to"| node_posts
node_app -.->|"dispatches to"| node_search
node_app -.->|"dispatches to"| node_info
node_app -.->|"dispatches to"| node_chats
node_app -->|"opens and closes"| node_db_pool
node_google_login -->|"verifies token"| node_google_verify
node_google_verify -->|"validates with"| node_google
node_google_login -->|"looks up and updates"| node_auth_ops
node_google_login -->|"creates token"| node_jwt
node_users -->|"checks access"| node_jwt
node_posts -->|"checks access"| node_jwt
node_chats -->|"checks access"| node_jwt
node_auth_ops -->|"queries users"| node_db_pool
node_jwt -->|"resolves admin context"| node_db_pool
node_posts -->|"reads and writes"| node_db_pool
node_search -->|"queries listings"| node_db_pool
node_info -->|"reads profile data"| node_db_pool
node_chats -->|"reads and writes"| node_db_pool
node_users -->|"reads and writes"| node_db_pool
node_status -->|"checks database"| node_db_pool
node_db_pool -->|"connects to"| node_postgres
node_google_verify -->|"reads client ID"| node_config
node_jwt -->|"reads signing keys"| node_config
node_app -->|"sets admin secret"| node_config
node_info -->|"looks up postal code"| node_viacep

click node_app "https://github.com/0llrayll0-beep/festouu_api/blob/main/main.py"
click node_status "https://github.com/0llrayll0-beep/festouu_api/blob/main/routes/status_api.py"
click node_users "https://github.com/0llrayll0-beep/festouu_api/blob/main/routes/users.py"
click node_google_login "https://github.com/0llrayll0-beep/festouu_api/blob/main/routes/auth.py"
click node_google_verify "https://github.com/0llrayll0-beep/festouu_api/blob/main/services/google_auth.py"
click node_auth_ops "https://github.com/0llrayll0-beep/festouu_api/blob/main/services/auth_service.py"
click node_jwt "https://github.com/0llrayll0-beep/festouu_api/blob/main/services/jwt_service.py"
click node_posts "https://github.com/0llrayll0-beep/festouu_api/blob/main/routes/posts.py"
click node_search "https://github.com/0llrayll0-beep/festouu_api/blob/main/routes/search.py"
click node_info "https://github.com/0llrayll0-beep/festouu_api/blob/main/routes/info.py"
click node_chats "https://github.com/0llrayll0-beep/festouu_api/blob/main/routes/chats.py"
click node_db_pool "https://github.com/0llrayll0-beep/festouu_api/blob/main/database.py"
click node_config "https://github.com/0llrayll0-beep/festouu_api/blob/main/config.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_status,node_client toneBlue
class node_users,node_google_login,node_google_verify,node_auth_ops,node_jwt toneAmber
class node_posts,node_search,node_info toneMint
class node_chats toneRose
class node_postgres,node_db_pool,node_config,node_google,node_viacep toneIndigo
```

## Components

### API runtime

- [FastAPI application](https://github.com/0llrayll0-beep/festouu_api/blob/main/main.py): `main.py`
- [Status endpoints](https://github.com/0llrayll0-beep/festouu_api/blob/main/routes/status_api.py): `routes/status_api.py`

### Accounts and access

- [Account management](https://github.com/0llrayll0-beep/festouu_api/blob/main/routes/users.py): `routes/users.py`
- [Google login route](https://github.com/0llrayll0-beep/festouu_api/blob/main/routes/auth.py): `routes/auth.py`
- [Google token verification](https://github.com/0llrayll0-beep/festouu_api/blob/main/services/google_auth.py): `services/google_auth.py`
- [Account auth operations](https://github.com/0llrayll0-beep/festouu_api/blob/main/services/auth_service.py): `services/auth_service.py`
- [JWT access control](https://github.com/0llrayll0-beep/festouu_api/blob/main/services/jwt_service.py): `services/jwt_service.py`

### Listings and discovery

- [Event listings](https://github.com/0llrayll0-beep/festouu_api/blob/main/routes/posts.py): `routes/posts.py`
- [Listing search](https://github.com/0llrayll0-beep/festouu_api/blob/main/routes/search.py): `routes/search.py`
- [Profiles and information](https://github.com/0llrayll0-beep/festouu_api/blob/main/routes/info.py): `routes/info.py`

### User engagement

- [Chat and messaging](https://github.com/0llrayll0-beep/festouu_api/blob/main/routes/chats.py): `routes/chats.py`

### Persistence and integrations

- **PostgreSQL**
- [Database pool](https://github.com/0llrayll0-beep/festouu_api/blob/main/database.py): `database.py`
- [Runtime configuration](https://github.com/0llrayll0-beep/festouu_api/blob/main/config.py): `config.py`

### Other components

- **API client**
- **Google identity service**
- **ViaCEP service**

## Connections

- API client → FastAPI application: sends requests (evidence: `main.py`)
- FastAPI application → Status endpoints: dispatches to (evidence: `main.py`)
- FastAPI application → Account management: dispatches to (evidence: `main.py`)
- FastAPI application → Google login route: dispatches to (evidence: `main.py`)
- FastAPI application → Event listings: dispatches to (evidence: `main.py`)
- FastAPI application → Listing search: dispatches to (evidence: `main.py`)
- FastAPI application → Profiles and information: dispatches to (evidence: `main.py`)
- FastAPI application → Chat and messaging: dispatches to (evidence: `main.py`)
- FastAPI application → Database pool: opens and closes (evidence: `main.py`)
- Google login route → Google token verification: verifies token (evidence: `routes/auth.py`)
- Google token verification → Google identity service: validates with (evidence: `services/google_auth.py`)
- Google login route → Account auth operations: looks up and updates (evidence: `routes/auth.py`)
- Google login route → JWT access control: creates token (evidence: `routes/auth.py`)
- Account management → JWT access control: checks access (evidence: `routes/users.py`)
- Event listings → JWT access control: checks access (evidence: `routes/posts.py`)
- Chat and messaging → JWT access control: checks access (evidence: `routes/chats.py`)
- Account auth operations → Database pool: queries users (evidence: `services/auth_service.py`)
- JWT access control → Database pool: resolves admin context (evidence: `services/jwt_service.py`)
- Event listings → Database pool: reads and writes (evidence: `routes/posts.py`)
- Listing search → Database pool: queries listings (evidence: `routes/search.py`)
- Profiles and information → Database pool: reads profile data (evidence: `routes/info.py`)
- Chat and messaging → Database pool: reads and writes (evidence: `routes/chats.py`)
- Account management → Database pool: reads and writes (evidence: `routes/users.py`)
- Status endpoints → Database pool: checks database (evidence: `routes/status_api.py`)
- Database pool → PostgreSQL: connects to (evidence: `database.py`)
- Google token verification → Runtime configuration: reads client ID (evidence: `services/google_auth.py`)
- JWT access control → Runtime configuration: reads signing keys (evidence: `services/jwt_service.py`)
- FastAPI application → Runtime configuration: sets admin secret (evidence: `main.py`)
- Profiles and information → ViaCEP service: looks up postal code (evidence: `routes/info.py`)
