# gomescandice/yoga-website architecture

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

- Interactive diagram: https://gitdiagram.com/gomescandice/yoga-website
- Repository: https://github.com/gomescandice/yoga-website

## Overview

##### Main components (nodes) of the system
- Frontend User Interface:
- HTML files (embedded in PHP files such as index.php, contact.php, register.php, schedule.php)
- CSS (yoga.css) for styling
- Client-side JavaScript for input validation
- Backend Server Logic:
- PHP scripts (core files located in PHP Files directory and its connection sub-directory)
- A separate connection layer (PHP Files/connection contains connection.php and index.php for DB connection)
- Database:
- MySQL database accessed via phpMyAdmin
- Tables defined in the various SQL files (cSchedule.sql, class.sql, client.sql, contact.sql, days.sql, schedule.sql)
- External Components:
- XAMPP environment for running Apache and MySQL servers

##### Relationships and data flows between these components
- User Actions ➜ Web Browser:
- Users interact with the frontend (submit forms, request pages).
- Browser ➜ PHP Files:
- Frontend sends requests (form submissions, page loads) to the PHP server.
- PHP Server ➜ Database Layer:
- PHP scripts perform data validation, business logic, and make queries to the MySQL database.
- Database ➜ PHP Server:
- Query results (e.g., client records or class schedules) are returned from the database.
- PHP Server ➜ Browser:
- Processed data is rendered into HTML and sent back to the user’s browser.

##### Architectural patterns and design principles to capture
- Separation of Concerns: Clearly distinguish between presentation (HTML/CSS/JS) and data processing (PHP backend) as well as data storage (MySQL).
- Client-Server Model: Show that the client (browser) communicates with the server, which in turn interacts with the database.
- Data validation is conducted on the client side (JavaScript) and server side (PHP).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External User
    U["User"]:::external

    %% Frontend Layer (HTML/CSS/JS)
    subgraph "Frontend (HTML/CSS/JS)"
        FE1["index.php"]:::frontend
        FE2["contact.php"]:::frontend
        FE3["register.php"]:::frontend
        FE4["schedule.php"]:::frontend
        FE5["yoga.css"]:::frontend
    end

    %% Backend Layer (PHP Application Logic)
    subgraph "Backend (PHP Application Logic)"
        BE1["classes.php"]:::backend
        BE2["contact.php (backend)"]:::backend
        BE3["register.php (backend)"]:::backend
        BE4["schedule.php (backend)"]:::backend
        BE5["connection.php"]:::backend
        BE6["connection index.php"]:::backend
    end

    %% Database Layer
    subgraph "Database"
        DB["MySQL Database"]:::database
        subgraph "SQL Schema"
            SQL1["cSchedule.sql"]:::database
            SQL2["class.sql"]:::database
            SQL3["client.sql"]:::database
            SQL4["contact.sql"]:::database
            SQL5["days.sql"]:::database
            SQL6["schedule.sql"]:::database
            SQL7["time.sql"]:::database
        end
    end

    %% Data Flow Arrows
    U -->|"UserInput"| FE1
    FE1 -->|"PageRequest/Submission"| BE3
    FE2 -->|"PageRequest/Submission"| BE2
    FE3 -->|"PageRequest/Submission"| BE3
    FE4 -->|"PageRequest/Submission"| BE4
    BE5 -- "DBConnection" --> DB
    BE6 -- "DBConnection" --> DB
    DB -- "QueryResults" --> BE5
    DB -- "QueryResults" --> BE6
    BE3 -->|"RenderResponse"| FE3
    BE2 -->|"RenderResponse"| FE2
    BE4 -->|"RenderResponse"| FE4

    %% Styles
    classDef external fill:#f9e79f,stroke:#333,stroke-width:2px;
    classDef frontend fill:#aed6f1,stroke:#333,stroke-width:2px;
    classDef backend fill:#a9dfbf,stroke:#333,stroke-width:2px;
    classDef database fill:#f5b7b1,stroke:#333,stroke-width:2px;

    %% Click Events for Frontend Components
    click FE1 "https://github.com/gomescandice/yoga-website/blob/master/PHP Files/index.php"
    click FE2 "https://github.com/gomescandice/yoga-website/blob/master/PHP Files/contact.php"
    click FE3 "https://github.com/gomescandice/yoga-website/blob/master/PHP Files/register.php"
    click FE4 "https://github.com/gomescandice/yoga-website/blob/master/PHP Files/schedule.php"
    click FE5 "https://github.com/gomescandice/yoga-website/blob/master/PHP Files/yoga.css"

    %% Click Events for Backend Components
    click BE1 "https://github.com/gomescandice/yoga-website/blob/master/PHP Files/classes.php"
    click BE2 "https://github.com/gomescandice/yoga-website/blob/master/PHP Files/contact.php"
    click BE3 "https://github.com/gomescandice/yoga-website/blob/master/PHP Files/register.php"
    click BE4 "https://github.com/gomescandice/yoga-website/blob/master/PHP Files/schedule.php"
    click BE5 "https://github.com/gomescandice/yoga-website/blob/master/PHP Files/connection/connection.php"
    click BE6 "https://github.com/gomescandice/yoga-website/blob/master/PHP Files/connection/index.php"

    %% Click Events for Database SQL Files
    click SQL1 "https://github.com/gomescandice/yoga-website/blob/master/SQL Files/cSchedule.sql"
    click SQL2 "https://github.com/gomescandice/yoga-website/blob/master/SQL Files/class.sql"
    click SQL3 "https://github.com/gomescandice/yoga-website/blob/master/SQL Files/client.sql"
    click SQL4 "https://github.com/gomescandice/yoga-website/blob/master/SQL Files/contact.sql"
    click SQL5 "https://github.com/gomescandice/yoga-website/blob/master/SQL Files/days.sql"
    click SQL6 "https://github.com/gomescandice/yoga-website/blob/master/SQL Files/schedule.sql"
    click SQL7 "https://github.com/gomescandice/yoga-website/blob/master/SQL Files/time.sql"
```
