# raveen522/smart-architect---the-web-project architecture

> Architecture diagram of the GitHub repository raveen522/smart-architect---the-web-project, 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/raveen522/smart-architect---the-web-project
- Repository: https://github.com/raveen522/smart-architect---the-web-project

## Overview

##### Project Type & Purpose
- This is a full-stack website for an architecture portfolio. The project’s goal is to showcase the company’s projects, services, and team information while providing user interaction through contact forms, applications, and an admin (“super-user”) dashboard.
- Key indicators: Multiple static pages (index, about, projects, services, contact), PHP scripts for backend interactions (login, messaging, application loading/updating), and assets for images, fonts, and videos. The README specifies the use of HTML, CSS, JavaScript (front-end), PHP (back-end) with MySQL as the database engine.

##### Major Components
a. Client/Browser Layer:
- Browsers render the HTML pages (index.html, about.html, etc.) with styling (CSS) and dynamic behavior (JavaScript).
- The client sends requests to the server (e.g., form submissions on contact or job application pages).

b. Front-end Assets:
- HTML files (several pages including dashboard and public-facing ones).
- CSS files and JavaScript files (animations.js, main.js, dashboard.js) that handle the interactive UI.
- An assets folder containing fonts, images, and videos used to visually enhance the website.

c. Server/Backend Layer:
- PHP scripts (found in the “php” directory) handle core functionalities:
- User authentication (login.php, logout.php)
- Loading and updating messages and application statuses (loadMessage.php, updateMessageStatus.php, etc.)
- User settings management (changeUserSettings.php, loadUserSettings.php)
- Database connection management (connection.php)
- The “super-user” directory houses the admin-specific pages, including a dedicated dashboard.

d. Data Storage:
- A MySQL database (per README description) which stores application data such as user information, messages, project details, etc.

##### Relationships & Interactions
- Directional data flow from the Browser to the PHP Backend when a form is submitted (e.g., contact form, job application).

##### Architectural Patterns & Design Principles
- The project follows a separation-of-concerns principle: static content (HTML/CSS/JS) is handled separately from business logic (PHP scripts) and data persistence (MySQL).
- Even though no frameworks are used, the file structure implies a loose MVC style where different PHP files handle specific business logic tasks.
- The “super-user” directory clearly separates administrative functions from the public site.

##### Final Steps
- Related files where applicable (static pages together, PHP modules together) to visually reflect the file tree structure.
- Review the README and file tree one last time to check that all key functionalities and assets have been represented.

## Diagram (Mermaid)

```mermaid
flowchart TD
    browser["Client / Browser"]:::client

    subgraph "Presentation Layer - HTML Pages"
        index["index.html"]:::frontend
        about["about.html"]:::frontend
        projects["projects.html"]:::frontend
        services["services.html"]:::frontend
        contact["contact.html"]:::frontend
        jobapp["job_application.html"]:::frontend
    end

    subgraph "Front-end Assets"
        cssFiles["CSS Files (css/)"]:::frontend
        subgraph "JavaScript Files"
            animJS["animations.js"]:::frontend
            mainJS["main.js"]:::frontend
            dashJS["dashboard.js"]:::frontend
        end
        staticAssets["Static Assets (assets/)"]:::frontend
    end

    subgraph "Server/Backend Layer (PHP)"
        loginPHP["login.php"]:::backend
        logoutPHP["logout.php"]:::backend
        loadMsgPHP["loadMessage.php"]:::backend
        userSettingsPHP["changeUserSettings.php"]:::backend
        connectionPHP["connection.php"]:::backend
        otherPHP["Other PHP Scripts (php/)"]:::backend
    end

    subgraph "Super-user / Admin Dashboard"
        adminDB["dashboard.html / index.html"]:::admin
    end

    database["MySQL Database"]:::database

    %% Client loads front-end resources
    browser -->|"loads"| index
    browser -->|"loads"| about
    browser -->|"loads"| projects
    browser -->|"loads"| services
    browser -->|"loads"| contact
    browser -->|"loads"| jobapp
    browser -->|"loads"| cssFiles
    browser -->|"loads"| animJS
    browser -->|"loads"| mainJS
    browser -->|"loads"| dashJS
    browser -->|"loads"| staticAssets

    %% Form submissions and AJAX requests from HTML pages to PHP backend
    contact -->|"submits"| otherPHP
    jobapp -->|"submits"| otherPHP
    browser -->|"AJAX_request"| loadMsgPHP

    %% Admin login flow from client to backend and admin dashboard
    browser -->|"admin_login"| loginPHP
    loginPHP -->|"grants_access"| adminDB

    %% PHP backend interacts with the database
    loginPHP -->|"DB_rw"| database
    logoutPHP -->|"DB_rw"| database
    loadMsgPHP -->|"DB_rw"| database
    userSettingsPHP -->|"DB_rw"| database
    connectionPHP -->|"DB_connect"| database
    otherPHP -->|"DB_rw"| database

    %% PHP backend sends responses back to the client
    otherPHP -->|"response"| browser
    loginPHP -->|"response"| browser

    %% Styles
    classDef client fill:#ADD8E6,stroke:#333,stroke-width:2px;
    classDef frontend fill:#87CEFA,stroke:#333,stroke-width:2px;
    classDef backend fill:#98FB98,stroke:#333,stroke-width:2px;
    classDef admin fill:#FFD700,stroke:#333,stroke-width:2px;
    classDef database fill:#FF6347,stroke:#333,stroke-width:2px;

    %% Click Events for Front-end Components
    click index "https://github.com/raveen522/smart-architect---the-web-project/blob/main/index.html"
    click about "https://github.com/raveen522/smart-architect---the-web-project/blob/main/about.html"
    click projects "https://github.com/raveen522/smart-architect---the-web-project/blob/main/projects.html"
    click services "https://github.com/raveen522/smart-architect---the-web-project/blob/main/services.html"
    click contact "https://github.com/raveen522/smart-architect---the-web-project/blob/main/contact.html"
    click jobapp "https://github.com/raveen522/smart-architect---the-web-project/blob/main/job_application.html"
    click cssFiles "https://github.com/raveen522/smart-architect---the-web-project/tree/main/css/"
    click animJS "https://github.com/raveen522/smart-architect---the-web-project/blob/main/js/animations.js"
    click mainJS "https://github.com/raveen522/smart-architect---the-web-project/blob/main/js/main.js"
    click dashJS "https://github.com/raveen522/smart-architect---the-web-project/blob/main/js/dashboard.js"
    click staticAssets "https://github.com/raveen522/smart-architect---the-web-project/tree/main/assets/"

    %% Click Events for PHP Backend Components
    click loginPHP "https://github.com/raveen522/smart-architect---the-web-project/blob/main/php/login.php"
    click logoutPHP "https://github.com/raveen522/smart-architect---the-web-project/blob/main/php/logout.php"
    click loadMsgPHP "https://github.com/raveen522/smart-architect---the-web-project/blob/main/php/loadMessage.php"
    click userSettingsPHP "https://github.com/raveen522/smart-architect---the-web-project/blob/main/php/changeUserSettings.php"
    click connectionPHP "https://github.com/raveen522/smart-architect---the-web-project/blob/main/php/connection.php"
    click otherPHP "https://github.com/raveen522/smart-architect---the-web-project/tree/main/php/"

    %% Click Event for Admin Dashboard
    click adminDB "https://github.com/raveen522/smart-architect---the-web-project/tree/main/super-user/"
```
