# alireza021/yoga architecture

> Architecture diagram of the GitHub repository alireza021/yoga, 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/alireza021/yoga
- Repository: https://github.com/alireza021/yoga

## Overview

##### Main Components
- Client Interface: Represent the end user interacting with the system through a web browser. This includes:
- The Public Site: Shown by pages like yoga/index.php and confirmBooking.php where users view classes and submit booking forms.
- The Admin Interface: Accessible via yoga/admin/login.php and other admin pages (e.g., index.php, users.php, change_password.php) where administrators or editors manage class schedules, bookings, and users.
- Application Core: This includes the central PHP scripts like yoga/core/init.php and configuration file (yoga/config.php) that bootstrap the application and handle business logic.
- Database: Although not explicitly detailed in file names, run via databaseInstaller.php, it is where class records, user details, booking information, and other data are stored.
- Static Resources: Include the CSS, JavaScript, and images (inside directories yoga/css, yoga/js, yoga/images, etc.) which handle the frontend presentation and client-side interactions.
- External Dependencies: Any external libraries like Bootstrap, etalage, and megamenu integrated into the UI, possibly impacting UI behavior and overall user experience.

##### Data Flow & Relationships
- From the Client's Browser:
- Users land on the Public Site (yoga/index.php) to view available classes.
- They can fill out and submit a booking form (likely hitting confirmBooking.php), which then sends booking data to the Application Core.
- Application Processing:
- The core scripts (including those initialized via yoga/core/init.php and configured in yoga/config.php) process HTTP requests, perform operations (e.g., validating availability, handling booking logic), and communicate with the Database.
- Admin Workflow:
- Admin users login via yoga/admin/login.php, which, upon validation, grant access to the backend dashboard.
- The admin pages then allow operations such as adding, editing, deleting classes, and managing enrolled students.
- These operations update or query the Database.
- Data Persistence:
- The database (set up by databaseInstaller.php) receives and returns data between the application core and persistent storage.

- Model-View separation:
- Views: The CSS, JavaScript, and HTML parts forming the user interface.
- Controllers/Business Logic: The PHP scripts (using core/init.php and other PHP scripts) that process user input.
- Model: The Database handling storage and retrieval operations.

- “Public Interface” (for booking and class viewing) to an “Application Core” component that handles logic, then link this to the “Database.”
- Similarly, represent the “Admin Flow” where the Admin logs in, which uses the Application Core for authentication and then interacts with the Database for management operations.

## Diagram (Mermaid)

```mermaid
graph TD
    Client("Client (Browser)"):::clientStyle
    Public("Public Interface (index.php, confirmBooking.php)"):::publicStyle
    Admin("Admin Interface (login.php, admin pages)"):::adminStyle
    Core("Application Core & Business Logic (init.php, config.php)"):::coreStyle
    DB("Database (databaseInstaller.php)"):::dbStyle
    Static("Static Resources (CSS, JS, Images)"):::staticStyle
    Ext("External Dependencies (Bootstrap, etalage, megamenu)"):::extStyle

    Client -->|"loadStaticAssets"| Static
    Static -->|"includes"| Ext
    Client -->|"accessPublic"| Public
    Client -->|"accessAdmin"| Admin
    Public -->|"submitBooking"| Core
    Admin -->|"adminOperations"| Core
    Core -->|"persistData"| DB
    DB -->|"dataRetrieval"| Core

    click Public "https://github.com/alireza021/yoga/blob/master/yoga/index.php"
    click Public "https://github.com/alireza021/yoga/blob/master/yoga/confirmBooking.php"
    click Admin "https://github.com/alireza021/yoga/blob/master/yoga/admin/login.php"
    click Admin "https://github.com/alireza021/yoga/tree/master/yoga/admin/"
    click Core "https://github.com/alireza021/yoga/blob/master/yoga/core/init.php"
    click Core "https://github.com/alireza021/yoga/blob/master/yoga/config.php"
    click DB "https://github.com/alireza021/yoga/blob/master/databaseInstaller.php"
    click Static "https://github.com/alireza021/yoga/tree/master/yoga/css/"
    click Static "https://github.com/alireza021/yoga/tree/master/yoga/js/"
    click Static "https://github.com/alireza021/yoga/tree/master/yoga/images/"

    classDef clientStyle fill:#f9f,stroke:#333,stroke-width:2px
    classDef publicStyle fill:#ccf,stroke:#333,stroke-width:2px
    classDef adminStyle fill:#cfc,stroke:#333,stroke-width:2px
    classDef coreStyle fill:#fc9,stroke:#333,stroke-width:2px
    classDef dbStyle fill:#f99,stroke:#333,stroke-width:2px
    classDef staticStyle fill:#cff,stroke:#333,stroke-width:2px
    classDef extStyle fill:#ffc,stroke:#333,stroke-width:2px
```
