# dvdferrando/dividimweb architecture

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

- Interactive diagram: https://gitdiagram.com/dvdferrando/dividimweb
- Repository: https://github.com/dvdferrando/dividimweb

## Overview

##### Project Type and Purpose
- This is a static‐site web project (“dividimweb”) hosted on Firebase Hosting.
- There is no dedicated backend or database service in this repo—only static assets in the `public/` folder and configuration for hosting and CI/CD.

##### File Structure Analysis
- Top‐level config files:
- `.firebaserc` and `firebase.json`: Firebase CLI settings and hosting rules.
- `package.json` / `package-lock.json`: NPM metadata and any build or deployment scripts.
- CI/CD directory:
- `.github/workflows/`: two workflows (`firebase-hosting-pull-request.yml`, `firebase-hosting-merge.yml`) that automate builds and deployments.
- Public assets:
- `public/`: HTML, CSS, JS, images, and other static resources served by Firebase Hosting.
- No `functions/`, `src/`, or backend folder implies pure static hosting.

##### Key Components
a. Developer Environment
– Local code repository (GitHub)
– NPM scripts or build tool (if any)
b. Continuous Integration / Continuous Deployment (CI/CD)
– GitHub Actions workflows (.github/workflows)
– Firebase CLI step that authenticates and deploys
c. Firebase Hosting
– Hosting service that serves files from the `public/` directory
d. End User
– Web browser accessing the published site

##### Component Relationships and Data Flow
- Developer pushes commits to GitHub.
- On pull request or merge, GitHub Actions triggers:
- Checkout code
- Install dependencies (`npm ci`)
- (Optional) Run build step
- Run `firebase deploy` to Firebase Hosting
- Firebase Hosting updates the live site with files from `public/`.
- End user’s browser requests pages/assets from Firebase Hosting, which returns the static files.

##### Architectural Patterns and Principles
- “Infrastructure as Code” for hosting config (firebase.json + .firebaserc).
- GitOps/CI‐driven deployment (GitHub Actions → Firebase).
- Single responsibility: static assets separated from CI/CD and hosting config.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Developer Environment
    subgraph "Developer Environment"
        PG1["package.json"]:::dev
        PG2["package-lock.json"]:::dev
    end

    Dev["Developer"]:::dev

    %% Source Control
    subgraph "Source Control"
        GH["GitHub Repo"]:::source
    end

    %% CI/CD Pipeline
    subgraph "CI/CD Pipeline"
        PR["firebase-hosting-pull-request.yml"]:::ci
        MG["firebase-hosting-merge.yml"]:::ci
    end

    %% Firebase Hosting
    subgraph "Firebase Hosting"
        CFG["firebase.json & .firebaserc"]:::hosting
        FH["Firebase Hosting Service"]:::hosting
        PUBLIC["public/"]:::hosting
    end

    %% End User
    User["End User Browser"]:::user

    %% Connections
    Dev -->|"uses"| PG1
    Dev -->|"uses"| PG2
    Dev -->|"pushes code (git push)"| GH
    GH -->|"workflow runs"| PR
    GH -->|"workflow runs"| MG
    PR -->|"firebase deploy"| FH
    MG -->|"firebase deploy"| FH
    FH -->|"serves files from public/"| User
    User -->|"HTTP GET/HTTP requests"| FH

    %% Click Events
    click GH "https://github.com/dvdferrando/dividimweb/tree/main//"
    click PG1 "https://github.com/dvdferrando/dividimweb/blob/main/package.json"
    click PG2 "https://github.com/dvdferrando/dividimweb/blob/main/package-lock.json"
    click PR "https://github.com/dvdferrando/dividimweb/blob/main/.github/workflows/firebase-hosting-pull-request.yml"
    click MG "https://github.com/dvdferrando/dividimweb/blob/main/.github/workflows/firebase-hosting-merge.yml"
    click CFG "https://github.com/dvdferrando/dividimweb/blob/main/firebase.json"
    click CFG "https://github.com/dvdferrando/dividimweb/blob/main/.firebaserc"
    click PUBLIC "https://github.com/dvdferrando/dividimweb/tree/main/public/"

    %% Styles
    classDef dev fill:#f8d7da,stroke:#333,stroke-width:1px;
    classDef source fill:#cce5ff,stroke:#333,stroke-width:1px;
    classDef ci fill:#d4edda,stroke:#333,stroke-width:1px;
    classDef hosting fill:#ffe5b4,stroke:#333,stroke-width:1px;
    classDef user fill:#e2e3e5,stroke:#333,stroke-width:1px;
```
