# satellasoft/opentask architecture

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

- Interactive diagram: https://gitdiagram.com/satellasoft/opentask
- Repository: https://github.com/satellasoft/opentask

## Overview

##### Project type and purpose
- This is a monolithic, server-rendered, full-stack web application written in PHP (7.2) using the MVC pattern.
- Its purpose ("Open Task") is to manage tasks, teams, file uploads, discussion forums, user management, etc., backed by a MariaDB database.

##### File structure
- Top level:
- App/ – core MVC code (Config, Controller, Core, Entity, Model, View, shared Function)
- Public/ – web-root assets (index.php, .htaccess, CSS, JS, images, uploaded files)
- Vendor/ – third-party Composer packages
- Docs/ – database scripts and documentation
- composer.json, README.md, .htaccess, engine workflows
- MVC pattern is explicit:
- Controllers in App/Controller
- Models in App/Model
- Entities in App/Entity (data-transfer objects)
- Views in App/View
- Core contains base Controller, Model, router, and bootstrap logic
- Configuration files: App/Config/config.php (database & routing), .htaccess (URL rewriting)
- Public/index.php is the single entry point that bootstraps Core/Core.php

##### README for additional insights
- Confirms MVC pattern and single-entry, single-configuration design
- Describes how .htaccess rewrites all requests into Public/ for security
- Details database creation via Docs/Database/SQL.txt

##### Essential details without over-segmenting
- Entities & Models together as the “Data Access Layer.”
- Core (routing, bootstrap) as the entrypoint.
- .htaccess rewriting layer to Public/index.php.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Layer
    Browser["Web Browser"]:::frontend
    Browser -->|"HTTP Request"| Apache

    %% Web Server Layer
    Apache["Apache + PHP-FPM"]:::server
    Apache -->|".htaccess rewrite"| HTROOT
    HTROOT[".htaccess (root)"]:::config
    HTROOT -->|rewrite to| PUBHT
    PUBHT["Public/.htaccess"]:::config
    PUBHT -->|serve| Index

    click HTROOT "https://github.com/satellasoft/opentask/blob/master/.htaccess"
    click PUBHT "https://github.com/satellasoft/opentask/blob/master/Public/.htaccess"

    %% Entry Point
    Index["Public/index.php\n(Front Controller)"]:::logic
    click Index "https://github.com/satellasoft/opentask/blob/master/Public/index.php"
    Index -->|bootstrap| Core

    %% Core Bootstrap & Routing
    Core["App/Core/Core.php\n(Router & Bootstrap)"]:::logic
    click Core "https://github.com/satellasoft/opentask/blob/master/App/Core/Core.php"

    %% Configuration & Helpers
    Config["App/Config/config.php"]:::config
    click Config "https://github.com/satellasoft/opentask/blob/master/App/Config/config.php"
    Helpers["App/Function/functions.php"]:::config
    click Helpers "https://github.com/satellasoft/opentask/blob/master/App/Function/functions.php"
    Core -->|load config| Config
    Core -->|load helpers| Helpers

    %% Application Layer
    subgraph "Application Layer"
        direction TB
        Controllers["App/Controller\n(Controllers)"]:::logic
        click Controllers "https://github.com/satellasoft/opentask/tree/master/App/Controller"
        ApiCtrl["ApiController"]:::logic
        click ApiCtrl "https://github.com/satellasoft/opentask/blob/master/App/Controller/ApiController.php"
        Controllers --> ApiCtrl

        Core --> Controllers
        Controllers -->|call| Models
        Controllers -->|render| Views
    end

    %% Business Logic Layer
    subgraph "Business Logic & Data Access"
        direction TB
        Models["App/Model\n(Models)"]:::logic
        click Models "https://github.com/satellasoft/opentask/tree/master/App/Model"
        CoreCtrl["App/Core/Controller.php"]:::logic
        click CoreCtrl "https://github.com/satellasoft/opentask/blob/master/App/Core/Controller.php"
        CoreModel["App/Core/Model.php"]:::logic
        click CoreModel "https://github.com/satellasoft/opentask/blob/master/App/Core/Model.php"
        UploadUtil["App/Core/UploadFile.php"]:::logic
        click UploadUtil "https://github.com/satellasoft/opentask/blob/master/App/Core/UploadFile.php"
        Models --> Entities
        Controllers --> UploadUtil

        Entities["App/Entity\n(Entities)"]:::logic
        click Entities "https://github.com/satellasoft/opentask/tree/master/App/Entity"
    end

    %% Persistence Layer
    subgraph "Persistence Layer"
        direction TB
        DB["MariaDB Database"]:::data
        FileStore["File Storage\nPublic/resources/files"]:::data
        click FileStore "https://github.com/satellasoft/opentask/tree/master/Public/resources/files"
        Models -->|SQL queries| DB
        UploadUtil -->|writes files| FileStore
    end

    %% Presentation Layer
    subgraph "Presentation Layer"
        direction TB
        Views["App/View\n(View Templates)"]:::frontend
        click Views "https://github.com/satellasoft/opentask/tree/master/App/View"
        Static["Static Assets\n(CSS, JS, Images)"]:::frontend
        click Static "https://github.com/satellasoft/opentask/tree/master/Public/js"
        Browser -->|loads| Static
        Controllers -->|pass data to| Views
        Views -->|HTML/CSS/JS| Browser
    end

    %% Vendor Libraries
    Vendor["Vendor Libraries\n(vendor/)"]:::config
    click Vendor "https://github.com/satellasoft/opentask/tree/master/vendor/"
    Core --> Vendor
    Controllers --> Vendor
    Models --> Vendor

    %% Database Docs
    Docs["Database Scripts\nDocs/Database/SQL.txt"]:::config
    click Docs "https://github.com/satellasoft/opentask/blob/master/Docs/Database/SQL.txt"

    classDef frontend fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef logic fill:#90EE90,stroke:#333,stroke-width:1px
    classDef data fill:#FFA500,stroke:#333,stroke-width:1px
    classDef config fill:#D3D3D3,stroke:#333,stroke-width:1px
    classDef server fill:#E6E6FA,stroke:#333,stroke-width:1px
```
