# fastboard-org/dashboards architecture

> Architecture diagram of the GitHub repository fastboard-org/dashboards, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/fastboard-org/dashboards
- Repository: https://github.com/fastboard-org/dashboards

## Overview

##### Project Type and Purpose
- This is a backend microservice written in Python for managing Fastboard dashboards.
- It’s a standalone service, built using poetry for dependency management and supports deployment via Docker. The microservice exposes a set of APIs (via routers) to interact with dashboards and related models.

##### Analyzing the File Structure
- The top-level file and configuration files (.env-example, Dockerfile, pyproject.toml) point to environment configuration, dependency management, CI/CD workflows (in .github), and deployment setups.
- The src directory is subdivided into several folders that hint at a layered architecture:
- configs: Contains configuration and settings, including database configurations.
- models: Defines the domain models (e.g., dashboard, connection, folder, query).
- routers: Contains API endpoint handlers that expose the microservice’s API. This is the presentation layer.
- services: Implements the business logic related to dashboards and connections.
- repositories: Acts as the data access layer, managing interactions with data sources or a database.
- lib: Contains utility libraries (like encryption functions) that offer common functionalities.
- The main entry point is src/main.py which bootstraps the application.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External Client
    extClient["External Client"]:::client

    %% API Layer
    subgraph "API Layer"
        routers["API Endpoints (Routers)"]:::api
    end

    %% Business Logic Layer
    subgraph "Business Logic"
        services["Business Logic (Services)"]:::service
        lib["Utility Functions (Encryption)"]:::utility
    end

    %% Data Layer
    subgraph "Data Layer"
        repositories["Data Access Layer (Repositories)"]:::db
        models["Data Models"]:::data
        schemas["Schema Validations"]:::data
        configs["Configurations & Settings"]:::config
    end

    %% Deployment & CI Integration
    subgraph "Deployment & CI Integration"
        deploy1["Dockerfile"]:::deploy
        deploy2["GitHub Workflows"]:::deploy
    end

    %% Connections between layers
    extClient -->|"sends_request"| routers
    routers -->|"calls"| services
    routers -->|"validates_with"| schemas
    services -->|"executes_logic"| repositories
    services -->|"uses"| lib
    repositories -->|"accesses"| models
    configs -->|"configures"| repositories
    schemas -->|"defines_structure"| models

    %% Styling
    classDef client fill:#f9e79f,stroke:#7d6608,stroke-width:2px
    classDef api fill:#aed6f1,stroke:#21618c,stroke-width:2px
    classDef service fill:#a9dfbf,stroke:#1e8449,stroke-width:2px
    classDef utility fill:#f5cba7,stroke:#bb8f00,stroke-width:2px
    classDef db fill:#f5b7b1,stroke:#943126,stroke-width:2px
    classDef data fill:#d2b4de,stroke:#6c3483,stroke-width:2px
    classDef config fill:#fad7a0,stroke:#b9770e,stroke-width:2px
    classDef deploy fill:#d6eaf8,stroke:#2874a6,stroke-width:2px

    %% Click Events
    click routers "https://github.com/fastboard-org/dashboards/tree/main/src/routers/"
    click services "https://github.com/fastboard-org/dashboards/tree/main/src/services/"
    click repositories "https://github.com/fastboard-org/dashboards/tree/main/src/repositories/"
    click models "https://github.com/fastboard-org/dashboards/tree/main/src/models/"
    click schemas "https://github.com/fastboard-org/dashboards/tree/main/src/schemas/"
    click configs "https://github.com/fastboard-org/dashboards/tree/main/src/configs/"
    click lib "https://github.com/fastboard-org/dashboards/blob/main/src/lib/encryption.py"
    click deploy1 "https://github.com/fastboard-org/dashboards/tree/main/Dockerfile"
    click deploy2 "https://github.com/fastboard-org/dashboards/tree/main/.github/workflows/"
```
