# gaum-g/recipe-sharing-website- architecture

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

- Interactive diagram: https://gitdiagram.com/gaum-g/recipe-sharing-website-
- Repository: https://github.com/gaum-g/recipe-sharing-website-

## Overview

##### Project Type and Purpose
- This is a monolithic, full‑stack web application (LAMP style) for sharing recipes.
- Front‑end: static HTML/CSS/JS pages.
- Back‑end: PHP scripts that handle authentication, recipe CRUD, image retrieval, and search.
- Persistence: relational database (MySQL or similar, accessed via db.php/config.php).

##### File Structure
- Top‑level HTML/CSS/JS pages (e.g., homepage.html/.css/.js, addrecipe.html/.css/.js).
- PHP endpoints for dynamic behavior—login.php, signup.php, addrecipe.php, fetch_recipes.php, search.php, display_image.php, etc.
- Shared configuration modules: config.php, db.php.
- No separate “frontend” and “backend” folders: everything co‑exists under the root, implying a single deployable web app.
- No explicit build scripts or container definitions—deploy as a PHP web service (e.g., on Render).

##### README for Technical Stack & Insights
- HTML/CSS/JS front‑end served statically but enhanced by AJAX calls.
- PHP back‑end for server‑side logic.
- Hosted on Render as a “Static Site” (though it uses PHP—likely Render’s Web Service).
- Future enhancements point to additional modules (rating, comments, email verification).

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Presentation Layer
    subgraph "Presentation Layer"
        IDX["index.html"]:::presentation
        ABOUT["aboutus.html"]:::presentation
        HP_HTML["homepage.html"]:::presentation
        HP_CSS["homepage.css"]:::presentation
        HP_JS["homepage.js"]:::presentation
        AR_HTML["addrecipe.html"]:::presentation
        AR_CSS["addrecipe.css"]:::presentation
        AR_JS["addrecipe.js"]:::presentation
        LOGIN_HTML["login.html"]:::presentation
        LOGIN_JS["login.js"]:::presentation
        SIGNUP_HTML["signup.html"]:::presentation
        SIGNUP_JS["signup.js"]:::presentation
    end

    %% Application Layer
    subgraph "Application Layer"
        subgraph "Auth Module"
            LOGIN_PHP["login.php"]:::application
            SIGNUP_PHP["signup.php"]:::application
            LOGOUT_PHP["logout.php"]:::application
        end
        subgraph "Recipe Management Module"
            ADDR_PHP["addrecipe.php"]:::application
            GETR_PHP["get_recipes.php"]:::application
            FETCHR_PHP["fetch_recipes.php"]:::application
            FETCHRND_PHP["fetch_random_recipes.php"]:::application
        end
        subgraph "Search Module"
            SEARCH_PHP["search.php"]:::application
        end
        subgraph "Media Service"
            DISPLAY_PHP["display_image.php"]:::application
        end
        subgraph "Shared Configuration"
            CONFIG_PHP["config.php"]:::application
            DB_PHP["db.php"]:::application
        end
    end

    %% Data Layer
    subgraph "Data Layer"
        DB["MySQL Database"]:::data
        FS["File Store"]:::data
    end

    %% Browser Client
    Browser["Browser (UI)"]:::presentation

    %% Flows
    Browser -->|HTTP GET| IDX
    Browser -->|HTTP GET| ABOUT
    Browser -->|HTTP GET| HP_HTML
    Browser -->|HTTP GET| HP_CSS
    Browser -->|HTTP GET| HP_JS
    Browser -->|HTTP GET| AR_HTML
    Browser -->|HTTP GET| AR_CSS
    Browser -->|HTTP GET| AR_JS
    Browser -->|HTTP GET| LOGIN_HTML
    Browser -->|HTTP GET| LOGIN_JS
    Browser -->|HTTP GET| SIGNUP_HTML
    Browser -->|HTTP GET| SIGNUP_JS

    Browser -->|AJAX HTTP/JSON| LOGIN_PHP
    Browser -->|AJAX HTTP/JSON| SIGNUP_PHP
    Browser -->|AJAX HTTP/JSON| LOGOUT_PHP
    Browser -->|AJAX HTTP/JSON| ADDR_PHP
    Browser -->|AJAX HTTP/JSON| GETR_PHP
    Browser -->|AJAX HTTP/JSON| FETCHR_PHP
    Browser -->|AJAX HTTP/JSON| FETCHRND_PHP
    Browser -->|AJAX HTTP/JSON| SEARCH_PHP
    Browser -->|AJAX HTTP/JSON| DISPLAY_PHP

    %% Application to Data
    LOGIN_PHP -->|SQL Query| DB
    SIGNUP_PHP -->|SQL Query| DB
    LOGOUT_PHP -.->|Session Update| DB
    ADDR_PHP -->|SQL Query| DB
    GETR_PHP -->|SQL Query| DB
    FETCHR_PHP -->|SQL Query| DB
    FETCHRND_PHP -->|SQL Query| DB
    SEARCH_PHP -->|SQL Query| DB
    DISPLAY_PHP -->|File Access| FS

    %% Configuration dependency
    LOGIN_PHP --> CONFIG_PHP
    SIGNUP_PHP --> CONFIG_PHP
    LOGOUT_PHP --> CONFIG_PHP
    ADDR_PHP --> CONFIG_PHP
    GETR_PHP --> CONFIG_PHP
    FETCHR_PHP --> CONFIG_PHP
    FETCHRND_PHP --> CONFIG_PHP
    SEARCH_PHP --> CONFIG_PHP
    DISPLAY_PHP --> CONFIG_PHP
    CONFIG_PHP --> DB_PHP
    DB_PHP --> DB

    %% Click Events
    click IDX "https://github.com/gaum-g/recipe-sharing-website-/blob/main/index.html"
    click ABOUT "https://github.com/gaum-g/recipe-sharing-website-/blob/main/aboutus.html"
    click HP_HTML "https://github.com/gaum-g/recipe-sharing-website-/blob/main/homepage.html"
    click HP_CSS "https://github.com/gaum-g/recipe-sharing-website-/blob/main/homepage.css"
    click HP_JS "https://github.com/gaum-g/recipe-sharing-website-/blob/main/homepage.js"
    click AR_HTML "https://github.com/gaum-g/recipe-sharing-website-/blob/main/addrecipe.html"
    click AR_CSS "https://github.com/gaum-g/recipe-sharing-website-/blob/main/addrecipe.css"
    click AR_JS "https://github.com/gaum-g/recipe-sharing-website-/blob/main/addrecipe.js"
    click LOGIN_HTML "https://github.com/gaum-g/recipe-sharing-website-/blob/main/login.html"
    click LOGIN_JS "https://github.com/gaum-g/recipe-sharing-website-/blob/main/login.js"
    click SIGNUP_HTML "https://github.com/gaum-g/recipe-sharing-website-/blob/main/signup.html"
    click SIGNUP_JS "https://github.com/gaum-g/recipe-sharing-website-/blob/main/signup.js"
    click LOGIN_PHP "https://github.com/gaum-g/recipe-sharing-website-/blob/main/login.php"
    click SIGNUP_PHP "https://github.com/gaum-g/recipe-sharing-website-/blob/main/signup.php"
    click LOGOUT_PHP "https://github.com/gaum-g/recipe-sharing-website-/blob/main/logout.php"
    click ADDR_PHP "https://github.com/gaum-g/recipe-sharing-website-/blob/main/addrecipe.php"
    click GETR_PHP "https://github.com/gaum-g/recipe-sharing-website-/blob/main/get_recipes.php"
    click FETCHR_PHP "https://github.com/gaum-g/recipe-sharing-website-/blob/main/fetch_recipes.php"
    click FETCHRND_PHP "https://github.com/gaum-g/recipe-sharing-website-/blob/main/fetch_random_recipes.php"
    click SEARCH_PHP "https://github.com/gaum-g/recipe-sharing-website-/blob/main/search.php"
    click DISPLAY_PHP "https://github.com/gaum-g/recipe-sharing-website-/blob/main/display_image.php"
    click CONFIG_PHP "https://github.com/gaum-g/recipe-sharing-website-/blob/main/config.php"
    click DB_PHP "https://github.com/gaum-g/recipe-sharing-website-/blob/main/db.php"

    %% Styles
    classDef presentation fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef application fill:#90EE90,stroke:#333,stroke-width:1px
    classDef data fill:#FFA500,stroke:#333,stroke-width:1px
```
