# muthan111/swe3033_assignment architecture

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

- Interactive diagram: https://gitdiagram.com/muthan111/swe3033_assignment
- Repository: https://github.com/muthan111/swe3033_assignment

## Overview

##### Project type and purpose
- This is a server-rendered, full-stack PHP web application that implements basic project/task management and chat features.
- It uses PHP for back-end logic, MySQL (via mysqli) for the database, and plain HTML/CSS for the front end.

##### File structure
- Top-level “page” directories (ChatPage, CreateProjectPage, CreateTaskPage, DisplayProjectPage, HomePage, LoginPage, RegistrationPage) each contain view templates (PHP+HTML) and their CSS.
- A shared PHP/logic layer lives under “PHP/” with functions for login, project and task operations, DB connection, and redirection.
- The “Database/” folder holds setup scripts (create_database.php, create_table.php).
- index.php is the entry point (likely routing users to Login or Homepage), logout.php ends sessions, Sidebar/ provides a shared navigation component.

##### README
- Confirms a Scrum-based team assignment under a prescriptive model.

##### Detailed capture of architectural elements
- Sidebar component included across pages
- Login flow: LoginPage → login_functions → DB query → redirect_function → HomePage or error
- Project/task flow: CreateProjectPage/CreateTaskPage → project_functions/tasks_functions → DB → DisplayProjectPage

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Layers top to bottom
    Browser["Client Browser"]:::external
    Server["Web Server & PHP"]:::server
    Browser -->|"HTTP request"| Server

    Server -->|"entry point"| index
    Server -->|"session end"| logout

    subgraph "Controllers & Views"
        Chat["ChatPage UI & Controller"]:::frontend
        CreateProj["CreateProjectPage UI & Controller"]:::frontend
        CreateTask["CreateTaskPage UI & Controller"]:::frontend
        DisplayProj["DisplayProjectPage UI & Controller"]:::frontend
        Home["HomePage UI & Controller"]:::frontend
        Login["LoginPage UI & Controller"]:::frontend
        Reg["RegistrationPage UI & Controller"]:::frontend
        SidebarComp["Sidebar (Shared Navigation)"]:::frontend
        Images["Static Assets - images/"]:::frontend
    end

    index --> Chat
    index --> CreateProj
    index --> CreateTask
    index --> DisplayProj
    index --> Home
    index --> Login
    index --> Reg

    Chat --> SidebarComp
    CreateProj --> SidebarComp
    CreateTask --> SidebarComp
    DisplayProj --> SidebarComp
    Home --> SidebarComp
    Login --> SidebarComp
    Reg --> SidebarComp

    Chat --> Images
    CreateProj --> Images
    CreateTask --> Images
    DisplayProj --> Images
    Home --> Images
    Login --> Images
    Reg --> Images

    subgraph "Business Logic Modules"
        Auth["Authentication (login_functions.inc.php)"]:::logic
        ProjLogic["Project Operations (project_functions.php)"]:::logic
        TaskLogic["Task Operations (tasks_functions.php)"]:::logic
        Redirect["Redirect Utility (redirect_function.php)"]:::logic
        DBConn["DB Connection (mysqli_connect.php)"]:::logic
    end

    Login --> Auth
    Auth --> Redirect
    CreateProj --> ProjLogic
    CreateTask --> TaskLogic
    DisplayProj --> ProjLogic
    DisplayProj --> TaskLogic

    Chat --> TaskLogic

    Auth --> DBConn
    ProjLogic --> DBConn
    TaskLogic --> DBConn
    Redirect --> DBConn

    DBConn --> DB

    subgraph "Database Setup"
        DBSetup1["create_database.php"]:::data
        DBSetup2["create_table.php"]:::data
    end

    DBSetup1 --> DB
    DBSetup2 --> DB

    DB["MySQL Database"]:::data

    %% Click Events
    click Chat "https://github.com/muthan111/swe3033_assignment/blob/main/ChatPage/chat_page.php"
    click CreateProj "https://github.com/muthan111/swe3033_assignment/blob/main/CreateProjectPage/create_project.php"
    click CreateTask "https://github.com/muthan111/swe3033_assignment/blob/main/CreateTaskPage/create_task.php"
    click DisplayProj "https://github.com/muthan111/swe3033_assignment/blob/main/DisplayProjectPage/display_project.php"
    click Home "https://github.com/muthan111/swe3033_assignment/blob/main/HomePage/Homepage.php"
    click Login "https://github.com/muthan111/swe3033_assignment/blob/main/LoginPage/login.php"
    click Reg "https://github.com/muthan111/swe3033_assignment/blob/main/RegistrationPage/index_html.php"
    click SidebarComp "https://github.com/muthan111/swe3033_assignment/blob/main/Sidebar/sidebar.php"
    click Auth "https://github.com/muthan111/swe3033_assignment/blob/main/PHP/login_functions.inc.php"
    click ProjLogic "https://github.com/muthan111/swe3033_assignment/blob/main/PHP/project_functions.php"
    click TaskLogic "https://github.com/muthan111/swe3033_assignment/blob/main/PHP/tasks_functions.php"
    click Redirect "https://github.com/muthan111/swe3033_assignment/blob/main/PHP/redirect_function.php"
    click DBConn "https://github.com/muthan111/swe3033_assignment/blob/main/PHP/mysqli_connect.php"
    click DBSetup1 "https://github.com/muthan111/swe3033_assignment/blob/main/Database/create_database.php"
    click DBSetup2 "https://github.com/muthan111/swe3033_assignment/blob/main/Database/create_table.php"
    click index "https://github.com/muthan111/swe3033_assignment/blob/main/index.php"
    click logout "https://github.com/muthan111/swe3033_assignment/blob/main/logout.php"

    %% Styles
    classDef external fill:#dddddd,stroke:#888,stroke-width:1px
    classDef server fill:#f0f0f0,stroke:#666,stroke-width:1px
    classDef frontend fill:#cfe2f3,stroke:#2a5d84,stroke-width:2px
    classDef logic fill:#d9ead3,stroke:#38761d,stroke-width:2px
    classDef data fill:#f9cb9c,stroke:#b45f06,stroke-width:2px
```
