# florishafkenscheid/portfolio architecture

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

- Interactive diagram: https://gitdiagram.com/florishafkenscheid/portfolio
- Repository: https://github.com/florishafkenscheid/portfolio

## Overview

##### Main Components

A. Client Layer
- Web Browser
- Static Assets (CSS/JS)

B. Server Layer
- Apache Web Server (.htaccess present)
- PHP Application
- MVC Components:
- Controllers
- Views
- Route System

C. Data Layer
- MySQL/MariaDB Database (indicated by database.sql)

##### Component Relationships and Structure

- [Client Layer]
- ↕
- [Server Layer]
- ↕
- [Data Layer]

##### Break down each layer in detail

Client Layer:
- [Browser] ←→ [Static Assets]
- CSS (views/css)
- JavaScript (views/js)

Server Layer:
- [Route System] → [Controllers] → [Views]
- Route.php       - BaseController    - layout/
- BlogController     - *.view.php
- HomeController
- etc.

Data Layer:
- [Database]
- (Defined in database.sql)

##### Specific Implementation Details

**[BaseController]**
- ↓
**[Specific Controllers]**
- BlogController
- ContactController
- ProjectsController
- HomeController
- InfoController

##### View Structure
**[Views]**
- Layout Templates
- Page Views
- Asset Management

Important Considerations:

##### Request Flow
- How controllers interact with views
- Database interactions where applicable

##### MVC Pattern
- Clearly separate the three main components
- Relationships between them
- Where the Route system fits in

##### Special Attention
- Routing system as it's a crucial component
- How .htaccess fits into the request handling
- Where static assets are served from

##### Additional Elements

- Component types
- Request/Response flow

- The MVC architecture
- Request handling flow
- Database interactions
- Static asset serving
- Template system structure

Remember to include notes about potential scaling points and areas where the architecture might evolve, as indicated by the README's mention of this being an "ever evolving portfolio project."

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles
    classDef client fill:#2374ab,color:white
    classDef server fill:#48a9a6,color:white
    classDef data fill:#e4cc37,color:black
    classDef static fill:#89909f,color:white
    classDef critical fill:#d96666,color:white

    %% Client Layer
    subgraph CL["Client Layer"]
        Browser["Web Browser"]
        StaticAssets["Static Assets"]
        CSS["CSS Files"]
        JS["JavaScript Files"]
        
        Browser --> StaticAssets
        StaticAssets --> CSS
        StaticAssets --> JS
    end

    %% Server Layer
    subgraph SL["Server Layer"]
        WebServer["Apache Web Server"]
        EntryPoint["Application Entry Point"]
        Router["Route System"]
        
        subgraph Controllers["Controllers"]
            BaseCtrl["Base Controller"]
            BlogCtrl["Blog Controller"]
            ContactCtrl["Contact Controller"]
            HomeCtrl["Home Controller"]
            InfoCtrl["Info Controller"]
            ProjectsCtrl["Projects Controller"]
            ErrorCtrl["Error Controller"]
            
            BaseCtrl --> BlogCtrl
            BaseCtrl --> ContactCtrl
            BaseCtrl --> HomeCtrl
            BaseCtrl --> InfoCtrl
            BaseCtrl --> ProjectsCtrl
            BaseCtrl --> ErrorCtrl
        end
        
        subgraph Views["View System"]
            Layout["Layout Templates"]
            PageViews["Page Views"]
            
            Layout --> PageViews
        end
    end

    %% Data Layer
    subgraph DL["Data Layer"]
        DB["Database"]
        DBController["Database Controller"]
        
        DBController --> DB
    end

    %% Connections between layers
    Browser --> WebServer
    WebServer --> EntryPoint
    EntryPoint --> Router
    Router --> Controllers
    Controllers --> Views
    Controllers --> DBController

    %% Click events for component mapping
    click CSS "https://github.com/florishafkenscheid/portfolio/blob/master/views/css/style.css"
    click JS "https://github.com/florishafkenscheid/portfolio/blob/master/views/js/main.js"
    click Router "https://github.com/florishafkenscheid/portfolio/blob/master/route/Route.php"
    click BaseCtrl "https://github.com/florishafkenscheid/portfolio/blob/master/controller/BaseController.php"
    click DB "https://github.com/florishafkenscheid/portfolio/blob/master/database.sql"
    click DBController "https://github.com/florishafkenscheid/portfolio/blob/master/controller/DatabaseController.php"
    click Views "https://github.com/florishafkenscheid/portfolio/tree/master/views/"
    click Layout "https://github.com/florishafkenscheid/portfolio/tree/master/views/layout/"
    click BlogCtrl "https://github.com/florishafkenscheid/portfolio/blob/master/controller/BlogController.php"
    click ContactCtrl "https://github.com/florishafkenscheid/portfolio/blob/master/controller/ContactController.php"
    click HomeCtrl "https://github.com/florishafkenscheid/portfolio/blob/master/controller/HomeController.php"
    click InfoCtrl "https://github.com/florishafkenscheid/portfolio/blob/master/controller/InfoController.php"
    click ProjectsCtrl "https://github.com/florishafkenscheid/portfolio/blob/master/controller/ProjectsController.php"
    click ErrorCtrl "https://github.com/florishafkenscheid/portfolio/blob/master/controller/ErrorController.php"
    click PageViews "https://github.com/florishafkenscheid/portfolio/tree/master/views/"
    click WebServer "https://github.com/florishafkenscheid/portfolio/blob/master/.htaccess"
    click EntryPoint "https://github.com/florishafkenscheid/portfolio/blob/master/index.php"

    %% Style applications
    class Browser,StaticAssets client
    class WebServer,Router,Controllers,Views,EntryPoint server
    class DB,DBController data
    class CSS,JS static
    class Router critical

    %% Legend
    subgraph Legend
        C1["Client Component"]:::client
        S1["Server Component"]:::server
        D1["Data Component"]:::data
        ST1["Static Asset"]:::static
        CR1["Critical Path"]:::critical
    end
```
