# gauti-tag/tombola-airtable architecture

> Architecture diagram of the GitHub repository gauti-tag/tombola-airtable, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-09-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gauti-tag/tombola-airtable
- Repository: https://github.com/gauti-tag/tombola-airtable

## Overview

##### Project type and purpose
- From the file tree and README (“Tombola-airtable”), this appears to be a small full-stack web application for managing a tombola (raffle) that integrates with Airtable as its data store.
- Key indicators:
- Frontend assets: index.html, idTombolaFiche.html, style.css, app.js
- Server-side logic: presentation.php, server/script.php
- PHP dependency management: composer.json, vendor/

##### File structure
- Top‐level:
- index.html – main UI entry point
- idTombolaFiche.html – printable ticket or info page template
- presentation.php – likely renders a dynamic view or report
- app.js & style.css – front-end behavior and styling
- server/ – back-end endpoints (script.php)
- vendor/ & composer.json – PHP libraries (e.g., Airtable PHP SDK)
- Patterns:
- Single-page or multi-page static frontend that calls backend endpoints
- Backend micro-service (server/script.php) using PHP and Composer libraries
- External dependency on Airtable’s HTTP API (no local database)

##### README for additional insights
- README is minimal but the project name implies core functionality: connect a raffle UI to Airtable

a. Main components
- Client (Browser) – renders HTML/CSS/JS
- Frontend assets (index.html, idTombolaFiche.html, app.js, style.css)
- Backend PHP Service
– presentation.php (view renderer)
– server/script.php (API endpoint)
– vendor/ (Airtable SDK, other libraries)
- External Service – Airtable REST API
b. Relationships and interactions
1. User → Browser loads index.html/idTombolaFiche.html
2. Browser executes app.js, reads/writes via AJAX to server/script.php
3. server/script.php uses Airtable PHP SDK (in vendor/) → makes HTTP calls to Airtable API
4. Airtable returns data → server/script.php returns JSON to browser
5. presentation.php may be invoked directly for server-side rendering of reports or ticket layouts
c. Architectural patterns/design principles
- Separation of concerns: Static assets vs. server logic
- Thin backend acting as an API proxy to Airtable (no complex business logic or local DB)
- Composer for dependency management ensures modular libraries
d. Relevant technologies/frameworks
- PHP 7+ with Composer
- Airtable PHP SDK (or Guzzle for HTTP requests)
- Vanilla JavaScript (app.js) or lightweight framework
- HTML/CSS for presentation

## Diagram (Mermaid)

```mermaid
flowchart TD
    Browser["User Browser"]:::frontend

    subgraph "Frontend (Static Assets)"
        direction TB
        Index["index.html"]:::frontend
        Ticket["idTombolaFiche.html"]:::frontend
        JS["app.js"]:::frontend
        CSS["style.css"]:::frontend
        Images["images/"]:::frontend
    end

    subgraph "Backend (PHP Service)"
        direction TB
        Presentation["presentation.php"]:::backend
        API["server/script.php"]:::backend
        Composer["composer.json"]:::backend
        Vendor["vendor/"]:::backend
    end

    Airtable[(Airtable REST API)]:::external

    Browser -->|Loads| Index
    Browser -->|Loads| Ticket
    Browser -->|Loads| CSS
    Browser -->|Loads| JS
    Browser -->|Loads| Images

    JS -->|AJAX GET/POST| API
    API -->|Uses SDK| Vendor
    Vendor -->|Requires| Composer
    API -->|REST API Call| Airtable
    Airtable -->|Response| API
    API -->|Returns JSON| Browser

    Browser -->|Server-Side Render| Presentation
    Presentation -->|Returns HTML| Browser

    click Index "https://github.com/gauti-tag/tombola-airtable/blob/main/index.html"
    click Ticket "https://github.com/gauti-tag/tombola-airtable/blob/main/idTombolaFiche.html"
    click JS "https://github.com/gauti-tag/tombola-airtable/blob/main/app.js"
    click CSS "https://github.com/gauti-tag/tombola-airtable/blob/main/style.css"
    click Images "https://github.com/gauti-tag/tombola-airtable/tree/main/images/"
    click Presentation "https://github.com/gauti-tag/tombola-airtable/blob/main/presentation.php"
    click API "https://github.com/gauti-tag/tombola-airtable/blob/main/server/script.php"
    click Composer "https://github.com/gauti-tag/tombola-airtable/blob/main/composer.json"
    click Vendor "https://github.com/gauti-tag/tombola-airtable/tree/main/vendor/"

    classDef frontend fill:#cce5ff,stroke:#005cbf,color:#000;
    classDef backend fill:#d4edda,stroke:#155724,color:#000;
    classDef external fill:#fff3cd,stroke:#856404,color:#000;
```
