# rodrigobrun/csstudio architecture

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

- Interactive diagram: https://gitdiagram.com/rodrigobrun/csstudio
- Repository: https://github.com/rodrigobrun/csstudio

## Overview

##### Project type and purpose
- CS Studio is a static, single‑page front‑end website (HTML5, CSS3, vanilla JS) published via GitHub Pages.
- Its purpose is to present a professional aesthetic studio’s services and, in future iterations, to allow online reservations with Firebase and email notifications via EmailJS.

##### File structure
- Top‑level files:
- index.html – entry point
- styles.css – responsive styling
- scripts.js – DOM interactions, animations, reservation logic in development
- No backend or server‑side code yet; everything runs in the browser (client‑side).

##### README for additional insights
- Upcoming features hint at external services:
- Firebase (to persist reservations)
- EmailJS (to send confirmation emails)
- Admin panel (future internal dashboard)

a. Client browser (desktop/mobile) running:
– index.html, styles.css, scripts.js
b. Static hosting layer
– GitHub Pages (or any CDN/static‑file host)
c. External services:
– Firebase Realtime Database or Firestore
– EmailJS API (SMTP/email provider)
d. Future “Admin Panel” (could be an additional SPA or protected route)

##### Relationships and interactions
- User ↔ Frontend SPA
- User loads index.html from static host
- CSS and JS assets downloaded to browser
- JS handles UI events: form entries (reservation requests), smooth scrolling, toggles
- Frontend ↔ Firebase
- scripts.js calls Firebase SDK to create/read reservation records
- Frontend ↔ EmailJS
- scripts.js sends HTTP requests to EmailJS REST endpoint to trigger emails
- (Future) Admin Panel ↔ Firebase
- Admin user authenticates (via Firebase Auth or similar) and performs CRUD on reservations
- All data flows are initiated client‑side—no custom backend server.

##### Architectural patterns and design principles
- Single‑page application (SPA) pattern: HTML + CSS + JS in one page with dynamic DOM updates
- Client‑side MVC-like division:
- View: HTML + CSS
- Controller: scripts.js event handlers
- Model: Firebase data objects
- Separation of concerns:
- Static hosting for assets
- Third‑party services for persistence and email

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Entities
    U["User"]:::external
    Browser["Browser SPA"]:::frontend
    StaticHost["GitHub Pages CDN"]:::infrastructure
    Firebase["Firebase Firestore"]:::baas
    EmailJS["EmailJS Service"]:::baas
    Admin["Admin Panel SPA"]:::frontend

    %% Connections
    U -->|"Interacts via UI"| Browser
    StaticHost -->|"HTTP(S) GET"| Browser
    Browser -->|"Firebase JS SDK"| Firebase
    Firebase -->|"Realtime Updates"| Browser
    Browser -->|"EmailJS REST API"| EmailJS
    Admin -->|"Firebase JS SDK"| Firebase

    %% Click events
    click Browser "https://github.com/rodrigobrun/csstudio/blob/main/index.html"
    click Browser "https://github.com/rodrigobrun/csstudio/blob/main/styles.css"
    click Browser "https://github.com/rodrigobrun/csstudio/blob/main/scripts.js"
    click Browser "https://github.com/rodrigobrun/csstudio/tree/main/imagenes/"
    click StaticHost "https://github.com/rodrigobrun/csstudio/blob/main/."

    %% Styles
    classDef frontend fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef infrastructure fill:#D3D3D3,stroke:#000,stroke-width:1px
    classDef baas fill:#FFA500,stroke:#000,stroke-width:1px
    classDef external fill:#FFFFFF,stroke:#000,stroke-width:1px

    %% Dashed for future
    style Admin stroke-dasharray: 5 5,stroke:#000
```
