# thameiu/rgbast architecture

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

- Interactive diagram: https://gitdiagram.com/thameiu/rgbast
- Repository: https://github.com/thameiu/rgbast

## Overview

RGBAST is a color-palette management API. The main user workflow is to authenticate, create and organize palettes, and search palettes or users; palette models also represent snapshots, branches, and color changes. The tree documents additional color, bookmark, folder, and colleague capabilities. The sampled files establish auth and search call paths, but most domain implementations were not sampled, so their internal wiring is left unspecified.

Main entry points: [`app/main.py`](https://github.com/thameiu/rgbast/blob/main/app/main.py) (FastAPI app), [`app/services/auth.py`](https://github.com/thameiu/rgbast/blob/main/app/services/auth.py) (Auth service), [`app/controllers/search.py`](https://github.com/thameiu/rgbast/blob/main/app/controllers/search.py) (Search controller), [`app/services/palette.py`](https://github.com/thameiu/rgbast/blob/main/app/services/palette.py) (Palette service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["API entry"]
  node_main["FastAPI app<br/>[main.py]"]
  node_auth_api["Auth routes<br/>[auth.py]"]
  node_search_api["Search routes<br/>[search.py]"]
  node_palette_api["Palette routes<br/>[palettes.py]"]
  node_folder_api["Folder routes<br/>[folders.py]"]
  node_color_api["Color routes<br/>[color.py]"]
  node_bookmark_api["Color bookmarks<br/>[color_bookmarks.py]"]
  node_colleague_api["Colleague routes<br/>[colleagues.py]"]
end

subgraph group_identity["Identity"]
  node_auth_controller["Auth controller<br/>[auth.py]"]
  node_auth_service["Auth service<br/>[auth.py]"]
  node_mail_service["Mail service<br/>[mail.py]"]
end

subgraph group_palette["Palette domain"]
  node_palette_service["Palette service<br/>[palette.py]"]
  node_palette_models["Palette records<br/>[palette.py]"]
end

subgraph group_data["Data and search"]
  node_search_controller["Search controller<br/>[search.py]"]
  node_user_service["User service<br/>[user.py]"]
  node_other_models["Domain records"]
  node_database[("Database session<br/>[database.py]")]
end

node_user(("User"))

node_user -->|"requests API"| node_main
node_main -->|"registers routes"| node_auth_api
node_main -->|"registers routes"| node_search_api
node_main -->|"registers routes"| node_palette_api
node_main -->|"registers routes"| node_folder_api
node_main -->|"registers routes"| node_color_api
node_main -->|"registers routes"| node_bookmark_api
node_main -->|"registers routes"| node_colleague_api
node_auth_api -->|"dispatches"| node_auth_controller
node_auth_controller -->|"calls"| node_auth_service
node_auth_service -->|"looks up users"| node_user_service
node_auth_service -->|"sends email"| node_mail_service
node_search_api -->|"dispatches"| node_search_controller
node_search_controller -->|"searches users"| node_user_service
node_search_controller -->|"searches palettes"| node_palette_service
node_main -->|"builds sitemap data"| node_palette_service
node_palette_service -->|"uses records"| node_palette_models
node_auth_service -->|"uses session"| node_database
node_search_controller -->|"receives session"| node_database

click node_main "https://github.com/thameiu/rgbast/blob/main/app/main.py"
click node_auth_api "https://github.com/thameiu/rgbast/blob/main/app/api/auth.py"
click node_search_api "https://github.com/thameiu/rgbast/blob/main/app/api/search.py"
click node_palette_api "https://github.com/thameiu/rgbast/blob/main/app/api/palettes.py"
click node_folder_api "https://github.com/thameiu/rgbast/blob/main/app/api/folders.py"
click node_color_api "https://github.com/thameiu/rgbast/blob/main/app/api/color.py"
click node_bookmark_api "https://github.com/thameiu/rgbast/blob/main/app/api/color_bookmarks.py"
click node_colleague_api "https://github.com/thameiu/rgbast/blob/main/app/api/colleagues.py"
click node_auth_controller "https://github.com/thameiu/rgbast/blob/main/app/controllers/auth.py"
click node_auth_service "https://github.com/thameiu/rgbast/blob/main/app/services/auth.py"
click node_mail_service "https://github.com/thameiu/rgbast/blob/main/app/services/mail.py"
click node_search_controller "https://github.com/thameiu/rgbast/blob/main/app/controllers/search.py"
click node_user_service "https://github.com/thameiu/rgbast/blob/main/app/services/user.py"
click node_palette_service "https://github.com/thameiu/rgbast/blob/main/app/services/palette.py"
click node_palette_models "https://github.com/thameiu/rgbast/blob/main/app/models/palette.py"
click node_other_models "https://github.com/thameiu/rgbast/tree/main/app/models"
click node_database "https://github.com/thameiu/rgbast/blob/main/app/core/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_main,node_auth_api,node_search_api,node_palette_api,node_folder_api,node_color_api,node_bookmark_api,node_colleague_api,node_user toneBlue
class node_auth_controller,node_auth_service,node_mail_service toneAmber
class node_palette_service,node_palette_models toneMint
class node_search_controller,node_user_service,node_other_models,node_database toneRose
```

## Components

### API entry

- [FastAPI app](https://github.com/thameiu/rgbast/blob/main/app/main.py): `app/main.py`
- [Auth routes](https://github.com/thameiu/rgbast/blob/main/app/api/auth.py): `app/api/auth.py`
- [Search routes](https://github.com/thameiu/rgbast/blob/main/app/api/search.py): `app/api/search.py`
- [Palette routes](https://github.com/thameiu/rgbast/blob/main/app/api/palettes.py): `app/api/palettes.py`
- [Folder routes](https://github.com/thameiu/rgbast/blob/main/app/api/folders.py): `app/api/folders.py`
- [Color routes](https://github.com/thameiu/rgbast/blob/main/app/api/color.py): `app/api/color.py`
- [Color bookmarks](https://github.com/thameiu/rgbast/blob/main/app/api/color_bookmarks.py): `app/api/color_bookmarks.py`
- [Colleague routes](https://github.com/thameiu/rgbast/blob/main/app/api/colleagues.py): `app/api/colleagues.py`

### Identity

- [Auth controller](https://github.com/thameiu/rgbast/blob/main/app/controllers/auth.py): `app/controllers/auth.py`
- [Auth service](https://github.com/thameiu/rgbast/blob/main/app/services/auth.py): `app/services/auth.py`
- [Mail service](https://github.com/thameiu/rgbast/blob/main/app/services/mail.py): `app/services/mail.py`

### Palette domain

- [Palette service](https://github.com/thameiu/rgbast/blob/main/app/services/palette.py): `app/services/palette.py`
- [Palette records](https://github.com/thameiu/rgbast/blob/main/app/models/palette.py): `app/models/palette.py`

### Data and search

- [Search controller](https://github.com/thameiu/rgbast/blob/main/app/controllers/search.py): `app/controllers/search.py`
- [User service](https://github.com/thameiu/rgbast/blob/main/app/services/user.py): `app/services/user.py`
- [Domain records](https://github.com/thameiu/rgbast/tree/main/app/models): `app/models`
- [Database session](https://github.com/thameiu/rgbast/blob/main/app/core/database.py): `app/core/database.py`

### Other components

- **User**

## Connections

- User → FastAPI app: requests API
- FastAPI app → Auth routes: registers routes
- FastAPI app → Search routes: registers routes
- FastAPI app → Palette routes: registers routes
- FastAPI app → Folder routes: registers routes
- FastAPI app → Color routes: registers routes
- FastAPI app → Color bookmarks: registers routes
- FastAPI app → Colleague routes: registers routes
- Auth routes → Auth controller: dispatches
- Auth controller → Auth service: calls
- Auth service → User service: looks up users
- Auth service → Mail service: sends email
- Search routes → Search controller: dispatches
- Search controller → User service: searches users
- Search controller → Palette service: searches palettes
- FastAPI app → Palette service: builds sitemap data
- Palette service → Palette records: uses records
- Auth service → Database session: uses session
- Search controller → Database session: receives session
