# drsatvir/webapp architecture

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

- Interactive diagram: https://gitdiagram.com/drsatvir/webapp
- Repository: https://github.com/drsatvir/webapp

## Overview

##### Project type & purpose (from file tree + README)
This is a **teaching/demo web application** for a Web Application Development (WAD) course. The repository is **very small and mostly static**:
- **Static UI pages**: `index.html`, `landingPage.html`, `layout.html`, `newPage.html`
- **Styling**: `btsp.css`, `myStyle.css`
- **One dynamic/server-side page**: `dbasePage.php` (likely demonstrates PHP + database concepts, given the filename)

There’s no explicit build system, package manager, or frameworks indicated. So the “architecture” is a **classic server-hosted website** with optional database access through PHP.

##### Static Files group
- `index.html`, `landingPage.html`, `layout.html`, `newPage.html`
- `btsp.css`, `myStyle.css`
##### Dynamic Endpoint
- `dbasePage.php`

**Static page flow**
- Browser → Web Server: `GET /index.html`
- Web Server → Browser: HTML response
- Browser → Web Server: `GET /myStyle.css`, `GET /btsp.css`
- Web Server → Browser: CSS responses

**Dynamic PHP flow**
- Browser → Web Server: `GET /dbasePage.php`
- Web Server → PHP Runtime: execute `dbasePage.php`
- (Optional) PHP Runtime → Database: SQL queries
- Database → PHP Runtime: result sets
- PHP Runtime → Web Server: generated HTML
- Web Server → Browser: HTML response

##### Architectural pattern to highlight
This is effectively a **server-rendered web app** with:
- **Static content delivery** (HTML/CSS)
- **Server-side rendering via PHP** for dynamic content
- **(Optional) 3-tier structure**: Presentation (Browser) → Application (PHP) → Data (DB)

##### Relevant technologies to label
Based on files:
- HTML, CSS
- PHP (for `dbasePage.php`)
- Apache/Nginx
- MySQL/MariaDB (only if `dbasePage.php` uses DB)

##### Start with runtime nodes (not code files)
- User, Browser, Web Server, PHP runtime, Database (optional)
##### Annotate responsibilities
- Static: “Serve files as-is”
- PHP: “Execute script, render HTML”
- DB: “Persist/query records” (only if applicable)

##### What “as many components as possible” means here (without inventing structure)
Since the repo is small, “more components” should come from:
- Splitting **static vs dynamic**
- Splitting **server vs runtime**
- Splitting **asset types** (HTML vs CSS)
- Splitting **request types** (GET static, GET dynamic)
Not from imaginary microservices or extra layers that aren’t present.

## Diagram (Mermaid)

```mermaid
flowchart TD
  %% External actors
  U["User"]:::client
  B["Web Browser (Client)"]:::client

  %% Hosting environment
  subgraph "Hosting Environment (Server)"
    WS["HTTP Server (Apache/Nginx)"]:::server

    subgraph "Static Content (served as-is)"
      subgraph "HTML Pages"
        I["index.html"]:::artifact
        LP["landingPage.html"]:::artifact
        LYT["layout.html"]:::artifact
        NP["newPage.html"]:::artifact
      end

      subgraph "CSS Stylesheets"
        BT["btsp.css"]:::artifact
        MS["myStyle.css"]:::artifact
      end
    end

    subgraph "Dynamic Content (server-side rendering)"
      PHP["PHP Runtime (mod_php / php-fpm)"]:::server
      DBP["dbasePage.php"]:::artifact
    end
  end

  %% Optional/assumed data layer (kept as optional in labeling)
  DB[("Database (optional: MySQL/MariaDB)")]:::db

  %% Documentation
  R["README.md"]:::doc

  %% Client interactions
  U -->|"uses"| B

  %% Static page flow
  B -->|"HTTP_GET_/index.html"| WS
  WS -->|"HTTP_200_HTML"| B

  B -->|"HTTP_GET_/landingPage.html"| WS
  WS -->|"HTTP_200_HTML"| B

  B -->|"HTTP_GET_/layout.html"| WS
  WS -->|"HTTP_200_HTML"| B

  B -->|"HTTP_GET_/newPage.html"| WS
  WS -->|"HTTP_200_HTML"| B

  B -->|"HTTP_GET_/btsp.css"| WS
  WS -->|"HTTP_200_CSS"| B

  B -->|"HTTP_GET_/myStyle.css"| WS
  WS -->|"HTTP_200_CSS"| B

  %% Dynamic PHP flow
  B -->|"HTTP_GET_/dbasePage.php"| WS
  WS -->|"invoke_PHP"| PHP
  PHP -->|"exec_dbasePage.php"| DBP
  DBP -->|"render_HTML"| PHP
  PHP -->|"generated_HTML"| WS
  WS -->|"HTTP_200_HTML"| B

  %% Optional DB access path
  PHP -->|"SQL_query_optional"| DB
  DB -->|"result_sets"| PHP

  %% Notes / relationships to artifacts
  WS -->|"serves_static"| I
  WS -->|"serves_static"| LP
  WS -->|"serves_static"| LYT
  WS -->|"serves_static"| NP
  WS -->|"serves_static"| BT
  WS -->|"serves_static"| MS
  WS -->|"routes_dynamic"| DBP

  %% Click events (from component_mapping)
  click I "https://github.com/drsatvir/webapp/blob/master/index.html"
  click LP "https://github.com/drsatvir/webapp/blob/master/landingPage.html"
  click LYT "https://github.com/drsatvir/webapp/blob/master/layout.html"
  click NP "https://github.com/drsatvir/webapp/blob/master/newPage.html"
  click BT "https://github.com/drsatvir/webapp/blob/master/btsp.css"
  click MS "https://github.com/drsatvir/webapp/blob/master/myStyle.css"
  click DBP "https://github.com/drsatvir/webapp/blob/master/dbasePage.php"
  click R "https://github.com/drsatvir/webapp/blob/master/README.md"

  %% Styles
  classDef client fill:#d6ecff,stroke:#1d5fa7,stroke-width:1.5px,color:#0b2d4a
  classDef server fill:#daf5d7,stroke:#1f7a2e,stroke-width:1.5px,color:#123b18
  classDef artifact fill:#ffe7c7,stroke:#b86a00,stroke-width:1.5px,color:#4a2a00
  classDef db fill:#f7d6ff,stroke:#7c2e8a,stroke-width:1.5px,color:#3d1346
  classDef doc fill:#eeeeee,stroke:#666666,stroke-width:1.5px,color:#222222
```
