# janniet/skateboard architecture

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

- Interactive diagram: https://gitdiagram.com/janniet/skateboard
- Repository: https://github.com/janniet/skateboard

## Overview

##### Project Type Analysis
This is a lightweight PHP web framework following the MVC (Model-View-Controller) pattern, designed for small web projects. The structure is intentionally minimal, with only essential components.

##### Key Components

A. Core Framework Components:
- Router Layer (Entry Point)
- Controller Layer
- View Layer
- Environment Configuration

B. Request/Response Flow:
- HTTP Request Handler
- Routing System
- Controller Processing
- View Rendering
- Response Generation

##### Component Relationships

**[HTTP Request] → [Public Directory]**
- ↓
**[Router (index.php)] → [.env Configuration]**
- ↓
**[Controller Layer] → [Input Processing]**
- ↓           → [Response Handling]
**[View Layer] → [Layout System]**
- ↓
**[HTTP Response]**

##### Important Elements to Highlight

a. Entry Point:
- Public directory (public/index.php)
- .htaccess configuration

b. Core Framework:
- Router configuration
- Controller base class
- View rendering system

c. Configuration:
- Environment variables (.env)
- Framework configuration

##### Specific Implementation Details

- How requests flow from public/index.php to the router
- Router delegation to specific controller methods
- Controller interaction with views
- View rendering through the layout system
- Response generation back to the client

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Request Flow"
        HTTP[HTTP Request]
        RESP[HTTP Response]
    end

    subgraph "Entry Layer"
        PUB["Public Directory"]:::public
        HTR[".htaccess Router"]:::htaccess
        IDX["index.php"]:::entry
    end

    subgraph "Core Framework"
        RT["Router System"]
        ENV["Environment Config"]:::env
        
        subgraph "Controller Layer"
            CTRL["Base Controller"]:::controller
            INP["Input Processing"]
            RESH["Response Handling"]
        end
        
        subgraph "View Layer"
            VL["View System"]:::view
            LAY["Layout System"]:::layout
            TMPL["View Templates"]:::templates
        end
    end

    %% Flow Connections
    HTTP --> PUB
    PUB --> HTR
    HTR --> IDX
    IDX --> RT
    RT --> ENV
    RT --> CTRL
    CTRL --> INP
    CTRL --> RESH
    CTRL --> VL
    VL --> LAY
    VL --> TMPL
    VL --> RESP

    %% Styling
    classDef public fill:#a8d08d
    classDef htaccess fill:#b4c7e7
    classDef entry fill:#70ad47
    classDef controller fill:#ed7d31
    classDef view fill:#4472c4
    classDef layout fill:#2f5597
    classDef templates fill:#5b9bd5
    classDef env fill:#ffc000

    %% Click Events
    click PUB "https://github.com/JannieT/skateboard/tree/master/public/"
    click HTR "https://github.com/JannieT/skateboard/blob/master/public/.htaccess"
    click IDX "https://github.com/JannieT/skateboard/blob/master/public/index.php"
    click CTRL "https://github.com/JannieT/skateboard/blob/master/app/Controller.php"
    click VL "https://github.com/JannieT/skateboard/tree/master/views/"
    click LAY "https://github.com/JannieT/skateboard/blob/master/views/layout.php"
    click TMPL "https://github.com/JannieT/skateboard/blob/master/views/home.php"
    click ENV "https://github.com/JannieT/skateboard/blob/master/.env.example"

    %% Legend
    subgraph Legend
        L1["Entry Components"]:::entry
        L2["Controller Components"]:::controller
        L3["View Components"]:::view
        L4["Configuration"]:::env
    end
```
