# thegreatgabuza/checkin architecture

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

- Interactive diagram: https://gitdiagram.com/thegreatgabuza/checkin
- Repository: https://github.com/thegreatgabuza/checkin

## Overview

##### Main Components
- Web Server (Flask Application):
- This component initializes the Flask application, orchestrates routing, and handles incoming HTTP requests.
- Route Handlers (Blueprints):
- Separate modules (e.g., in the “routes” folder such as auth_routes.py and landing_ai_routes.py).
- Admin Interface:
- “admin” package with its dedicated routes and templates. This backend interface may provide administrative functions (user management, settings, etc.).
- Templates and Static Files (Frontend Components):
- Separation of front-end presentation and back-end logic.
- External Integrations:
- Firebase Integration: Show a direct link from the Flask application (or a separate module if applicable) to Firebase for user data and authentication.
- LandingAI Integration: Represent the connection for facial recognition functionalities.
- Environment and Configuration:

##### Relationships & Interactions
- Request Flow:
- How the user interface (templates, static assets) interacts with backend endpoints.
- External Service Connectivity:
- Administrative Operations:
- How requests mapped to “admin” routes lead to dedicated admin views and functions.

##### Architectural Patterns & Design Principles
- Separation of Concerns:
- Divide the system into clearly defined components (routes, authentication logic, admin interface, static content, configuration).
- Modular Design:
- That the application is organized around modular blueprints for handling different authentication methods.
- Integration Points:
- External dependencies (Firebase, LandingAI) as distinct integration modules which can be updated or extended independently.

##### Relevant Technologies and Frameworks
- Flask (for the web server and routing)
- Firebase (for data storage and authentication management)
- LandingAI (for facial recognition services)
- HTML, CSS, and JavaScript (for client-side UI)
- Python (as the core language) and possibly supporting frameworks or libraries as defined in requirements.txt

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External / Client
    CB["Client Browser"]:::external

    %% Frontend Components
    subgraph "Frontend"
        T["Templates (templates/)"]:::frontend
        S["Static Files (static/)"]:::frontend
    end

    %% Backend Components
    subgraph "Backend"
        FA["Flask App (app.py)"]:::backend
        AR["Auth Routes (routes/auth_routes.py)"]:::blueprint
        LAR["LandingAI Routes (routes/landing_ai_routes.py)"]:::blueprint
        ADR["Admin Routes (routes/admin_routes.py)"]:::blueprint
        CONF["Environment & Configuration (.env.example)"]:::config
    end

    %% Admin Interface
    subgraph "Admin Interface"
        AP["Admin Panel (admin/)"]:::admin
    end

    %% External Integrations
    subgraph "External Integrations"
        FIR["Firebase Integration"]:::integration
        LAI["LandingAI Integration"]:::integration
    end

    %% Connections from Client Browser to Frontend
    CB -->|"loadsUI"| T
    CB -->|"loadsAssets"| S

    %% Frontend to Backend
    T -->|"callsAPI"| FA

    %% Backend Route Handlers
    FA -->|"routesReq"| AR
    FA -->|"routesReq"| LAR
    FA -->|"routesReq"| ADR

    %% Admin Route to Admin Interface
    ADR -->|"adminOps"| AP

    %% Backend Dependencies
    FA -->|"usesConfig"| CONF
    FA -->|"storesData"| FIR

    %% External API Calls
    LAR -->|"callsFacialRecog"| LAI

    %% Click Events
    click FA "https://github.com/thegreatgabuza/checkin/blob/master/app.py"
    click AR "https://github.com/thegreatgabuza/checkin/blob/master/routes/auth_routes.py"
    click LAR "https://github.com/thegreatgabuza/checkin/blob/master/routes/landing_ai_routes.py"
    click ADR "https://github.com/thegreatgabuza/checkin/blob/master/routes/admin_routes.py"
    click AP "https://github.com/thegreatgabuza/checkin/tree/master/admin/"
    click T "https://github.com/thegreatgabuza/checkin/tree/master/templates/"
    click S "https://github.com/thegreatgabuza/checkin/tree/master/static/"
    click CONF "https://github.com/thegreatgabuza/checkin/blob/master/.env.example"

    %% Styles
    classDef backend fill:#AED6F1,stroke:#2E86C1,stroke-width:2px;
    classDef blueprint fill:#ABEBC6,stroke:#28B463,stroke-width:2px;
    classDef config fill:#F9E79F,stroke:#B7950B,stroke-width:2px;
    classDef admin fill:#F5B7B1,stroke:#C0392B,stroke-width:2px;
    classDef frontend fill:#FAD7A0,stroke:#D35400,stroke-width:2px;
    classDef integration fill:#D2B4DE,stroke:#8E44AD,stroke-width:2px;
    classDef external fill:#E8DAEF,stroke:#8E44AD,stroke-width:2px;
```
