# syntaxmo/itcs333-project-g6 architecture

> Architecture diagram of the GitHub repository syntaxmo/itcs333-project-g6, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/syntaxmo/itcs333-project-g6
- Repository: https://github.com/syntaxmo/itcs333-project-g6

## Overview

##### Project type and purpose
- This repository is a monolithic multi‐module web application (“ITCS333‐Project‐G6”) that bundles six independent full‐stack sub-apps (Campus News, Events Calendar, Course Reviews, Course Notes, Club Activities, Student Marketplace).
- Each sub-app consists of:
- Static frontend files (HTML, CSS, JS)
- A PHP “API” layer (api.php, DatabaseHelper.php, config.php)
- An initialization script (init_db.php) for MySQL
- A filesystem area for uploads/images
- All sub-apps share the same CSS framework (Bootstrap) and are likely served from a single web server (Apache or Nginx+PHP-FPM) on the same domain.

##### File structure
- Top-level modules:
- Campus News/
- Events-Calendar/
- Phase1-ClubActivity/
- Phase1_Course-Notes/
- course-review2/
- student-Marketplace/
- Each module has:
- A client folder (HTML, CSS, JS)
- A server/API folder (PHP files, config.js)
- init_db.php to bootstrap its own schema
- An uploads or Pics/Images folder for attachments
- There’s a root index.html (likely landing page) and shared style.css.

##### Key insights from README
- Six student-owned modules, each with a dedicated author.
- Uses Bootstrap for responsive styling across all modules.

a. Main components (per module, repeated six times):
- Web Browser (Client-side)
- Static File Server (HTML/CSS/JS, served by Web Server)
- PHP Application Layer (api.php, DatabaseHelper.php)
- MySQL Database (initialized by init_db.php)
- File Storage (uploads/images directory)
b. Relationships & interactions:
1. User →
HTTP GET/POST → Web Server
2. Web Server serves HTML/CSS/JS to Browser
3. Browser JS calls AJAX → PHP API endpoints
4. PHP API → MySQL (CRUD) → returns JSON
5. For uploads, PHP → File Storage → returns URL
c. Architectural patterns & principles:
- Simple two-tier MVC-like pattern per module:
- View: static HTML + JS
- Controller: api.php endpoints
- Model: MySQL + DatabaseHelper.php
- Separation of concerns:
- Presentation, business logic, persistence are in separate layers
- Potential micro-service boundary: each module can be containerized independently
d. Key technologies:
- Frontend: HTML5, CSS3, JavaScript, Bootstrap
- Backend: PHP 7+, Apache/Nginx+PHP-FPM
- Database: MySQL
- Storage: Local filesystem for images

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client and Infrastructure
    Browser["Web Browser"]:::client
    WebServer["Web Server<br/>(Apache/Nginx+PHP-FPM)"]:::server
    MySQLDB["MySQL Database"]:::database
    FileStorage["File Storage<br/>(Local filesystem)"]:::storage
    Bootstrap["Bootstrap Framework"]:::framework

    Browser -->|"HTTP GET/POST"| WebServer
    WebServer -->|"serves HTML/CSS/JS"| Browser
    Browser -->|"AJAX (JSON)"| WebServer
    WebServer -->|"SQL"| MySQLDB
    WebServer -->|"file I/O"| FileStorage

    %% Campus News Module
    subgraph "Campus News Module"
        direction TB
        CN_FE["Static Files<br/>(HTML/CSS/JS)"]:::frontend
        CN_API["PHP API Layer"]:::backend
        CN_DBInit["init_db.php"]:::script
        CN_Store["Uploads/Images"]:::storage
        CN_FE -->|loads| CN_API
        CN_API -->|CRUD| MySQLDB
        CN_API -->|store/retrieve| CN_Store
    end
    click CN_FE "https://github.com/syntaxmo/itcs333-project-g6/blob/main/Campus News/AddArticle.html"
    click CN_FE "https://github.com/syntaxmo/itcs333-project-g6/blob/main/Campus News/CampusNews.html"
    click CN_FE "https://github.com/syntaxmo/itcs333-project-g6/blob/main/Campus News/EditArticle.html"
    click CN_FE "https://github.com/syntaxmo/itcs333-project-g6/blob/main/Campus News/ViewNews.html"
    click CN_FE "https://github.com/syntaxmo/itcs333-project-g6/blob/main/Campus News/CampusNews.js"
    click CN_FE "https://github.com/syntaxmo/itcs333-project-g6/blob/main/Campus News/ViewNews.js"
    click CN_FE "https://github.com/syntaxmo/itcs333-project-g6/blob/main/Campus News/Style.css"
    click CN_API "https://github.com/syntaxmo/itcs333-project-g6/blob/main/Campus News/PHP/api.php"
    click CN_API "https://github.com/syntaxmo/itcs333-project-g6/blob/main/Campus News/PHP/DatabaseHelper.php"
    click CN_API "https://github.com/syntaxmo/itcs333-project-g6/blob/main/Campus News/PHP/config.php"
    click CN_Store "https://github.com/syntaxmo/itcs333-project-g6/tree/main/Campus News/Pic"

    %% Events Calendar Module
    subgraph "Events Calendar Module"
        direction TB
        EC_FE["Static Files<br/>(PHP/JS/CSS)"]:::frontend
        EC_API["PHP API Layer"]:::backend
        EC_DBInit["init_db.php"]:::script
        EC_Store["Uploads/Images"]:::storage
        EC_FE -->|loads| EC_API
        EC_API -->|CRUD| MySQLDB
        EC_API -->|store/retrieve| EC_Store
    end
    click EC_FE "https://github.com/syntaxmo/itcs333-project-g6/blob/main/Events-Calendar/Events-Calender.php"
    click EC_FE "https://github.com/syntaxmo/itcs333-project-g6/blob/main/Events-Calendar/view.php"
    click EC_FE "https://github.com/syntaxmo/itcs333-project-g6/blob/main/Events-Calendar/index.js"
    click EC_FE "https://github.com/syntaxmo/itcs333-project-g6/blob/main/Events-Calendar/styles.css"
    click EC_API "https://github.com/syntaxmo/itcs333-project-g6/blob/main/Events-Calendar/apiEC/api.php"
    click EC_API "https://github.com/syntaxmo/itcs333-project-g6/blob/main/Events-Calendar/apiEC/config.js"
    click EC_DBInit "https://github.com/syntaxmo/itcs333-project-g6/blob/main/Events-Calendar/apiEC/init_db.php"
    click EC_Store "https://github.com/syntaxmo/itcs333-project-g6/tree/main/Events-Calendar/apiEC/uploads/images"

    %% Club Activities Module
    subgraph "Club Activities Module"
        direction TB
        CA_FE["Static Files<br/>(HTML/CSS/JS)"]:::frontend
        CA_Store["Images"]:::storage
    end
    click CA_FE "https://github.com/syntaxmo/itcs333-project-g6/blob/main/Phase1-ClubActivity/ActivityPage.html"
    click CA_FE "https://github.com/syntaxmo/itcs333-project-g6/blob/main/Phase1-ClubActivity/ClubActivity.html"
    click CA_FE "https://github.com/syntaxmo/itcs333-project-g6/blob/main/Phase1-ClubActivity/style.css"
    click CA_FE "https://github.com/syntaxmo/itcs333-project-g6/blob/main/Phase1-ClubActivity/Phase2-ClubActivity/JavaScript.js"
    click CA_Store "https://github.com/syntaxmo/itcs333-project-g6/tree/main/Phase1-ClubActivity/Images"

    %% Course Notes Module
    subgraph "Course Notes Module"
        direction TB
        CNt_FE["Static Files<br/>(PHP/JS/CSS)"]:::frontend
        CNt_API["PHP API Layer"]:::backend
        CNt_DBInit["init_db.php"]:::script
        CNt_Store["--"]:::storage
        CNt_FE -->|loads| CNt_API
        CNt_API -->|CRUD| MySQLDB
    end
    click CNt_FE "https://github.com/syntaxmo/itcs333-project-g6/blob/main/Phase1_Course-Notes/Course-Notes.php"
    click CNt_FE "https://github.com/syntaxmo/itcs333-project-g6/blob/main/Phase1_Course-Notes/Note-Details.php"
    click CNt_FE "https://github.com/syntaxmo/itcs333-project-g6/blob/main/Phase1_Course-Notes/Style.css"
    click CNt_FE "https://github.com/syntaxmo/itcs333-project-g6/blob/main/Phase1_Course-Notes/index.js"
    click CNt_API "https://github.com/syntaxmo/itcs333-project-g6/blob/main/Phase1_Course-Notes/apiCS.php"
    click CNt_API "https://github.com/syntaxmo/itcs333-project-g6/blob/main/Phase1_Course-Notes/config.js"
    click CNt_DBInit "https://github.com/syntaxmo/itcs333-project-g6/blob/main/Phase1_Course-Notes/init_db.php"

    %% Course Reviews Module
    subgraph "Course Reviews Module"
        direction TB
        CR_FE["Static Files<br/>(HTML/JS/CSS)"]:::frontend
    end
    click CR_FE "https://github.com/syntaxmo/itcs333-project-g6/blob/main/course-review2/Course-Review.html"
    click CR_FE "https://github.com/syntaxmo/itcs333-project-g6/blob/main/course-review2/test.js"
    click CR_FE "https://github.com/syntaxmo/itcs333-project-g6/blob/main/course-review2/Style.Css"

    %% Student Marketplace Module
    subgraph "Student Marketplace Module"
        direction TB
        SM_FE["Static Files<br/>(PHP/JS/CSS)"]:::frontend
        SM_API["PHP API Layer"]:::backend
        SM_DBInit["init_db.php"]:::script
        SM_Store["Uploads/Images"]:::storage
        SM_FE -->|loads| SM_API
        SM_API -->|CRUD| MySQLDB
        SM_API -->|store/retrieve| SM_Store
    end
    click SM_FE "https://github.com/syntaxmo/itcs333-project-g6/blob/main/student-Marketplace/StudentMarketplace.php"
    click SM_FE "https://github.com/syntaxmo/itcs333-project-g6/blob/main/student-Marketplace/itemPage.php"
    click SM_FE "https://github.com/syntaxmo/itcs333-project-g6/blob/main/student-Marketplace/index.js"
    click SM_FE "https://github.com/syntaxmo/itcs333-project-g6/blob/main/student-Marketplace/itemPage.js"
    click SM_FE "https://github.com/syntaxmo/itcs333-project-g6/blob/main/student-Marketplace/style.css"
    click SM_API "https://github.com/syntaxmo/itcs333-project-g6/blob/main/student-Marketplace/api.php"
    click SM_API "https://github.com/syntaxmo/itcs333-project-g6/blob/main/student-Marketplace/config.js"
    click SM_DBInit "https://github.com/syntaxmo/itcs333-project-g6/blob/main/student-Marketplace/init_db.php"
    click SM_Store "https://github.com/syntaxmo/itcs333-project-g6/tree/main/student-Marketplace/uploads/images"

    %% Root Landing
    RootIndex["index.html (Landing Page)"]:::frontend
    RootIndex -->|"links to modules"| CN_FE
    RootIndex --> EC_FE
    RootIndex --> CA_FE
    RootIndex --> CNt_FE
    RootIndex --> CR_FE
    RootIndex --> SM_FE

    %% Shared Framework
    Bootstrap -.-> CN_FE
    Bootstrap -.-> EC_FE
    Bootstrap -.-> CA_FE
    Bootstrap -.-> CNt_FE
    Bootstrap -.-> CR_FE
    Bootstrap -.-> SM_FE

    %% Styles
    classDef client fill:#cce5ff,stroke:#337ab7,stroke-width:2px;
    classDef server fill:#d4edda,stroke:#3c763d,stroke-width:2px;
    classDef database fill:#f2dede,stroke:#a94442,stroke-width:2px;
    classDef storage fill:#fcf8e3,stroke:#8a6d3b,stroke-width:2px;
    classDef frontend fill:#cce5ff,stroke:#337ab7,stroke-width:1px;
    classDef backend fill:#d4edda,stroke:#3c763d,stroke-width:1px;
    classDef framework fill:#f5f5f5,stroke:#767676,stroke-width:1px,stroke-dasharray: 5 5;
    classDef script fill:#eeeeee,stroke:#cccccc,stroke-width:1px;
```
