# yassine-dox/internship-management architecture

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

- Interactive diagram: https://gitdiagram.com/yassine-dox/internship-management
- Repository: https://github.com/yassine-dox/internship-management

## Overview

##### Project type and purpose
- This is a classic full-stack web application for managing volunteer registrations and internship stages.
- It uses PHP for server-side logic, MySQL for data storage, and Bootstrap 5 + HTML/CSS for the UI.

##### File structure
- Top-level PHP pages (login.php, rejistre.php, demande.php, etc.) serve as controllers and views.
- coon.php holds the database connection logic.
- infosession.php and deconnexion.php manage session state.
- bootstrap-5.3.3-dist contains all static CSS/JS assets for styling and front-end behaviors.
- There is no separate “models” folder, but the database tables implied by the README represent the data layer.

##### Extract README insights
- The app supports: user signup/login, city/association management, stage scheduling, and volunteer “demande_inscription.”
- Database schema has five tables (volontaire, ville, association, stage, demande_inscription) with clear foreign-key relationships.
- The stack is PHP/MySQL/Bootstrap, served over Apache (implied via XAMPP/WAMP).

##### Main components
a. Presentation Layer (Client Browser + Bootstrap Assets)
- HTML/CSS/JS files (delivered via Apache)
- bootstrap-5.3.3-dist/js & css
b. Web Server / Application Layer
- Apache + PHP runtime
- PHP scripts:
– coon.php (DB connector)
– login.php / rejistre.php (authentication)
– demande.php / infosession.php / deconnexion.php (session & request handling)
– navbare.php (UI fragment)
c. Data Layer
- MySQL database with five tables and relationships:
– volontaire ⇄ ville (Many-to-One)
– stage ⇄ association (Many-to-One)
– demande_inscription ⇄ volontaire & stage (Many-to-One on both)
d. (External) Infrastructure
- XAMPP/WAMP for local dev
- Potential future integration: email server for notifications

##### Relationships and interactions
- Browser issues HTTP requests (GET/POST) to PHP endpoints.
- PHP scripts authenticate sessions, validate input, and call coon.php to query or update MySQL.
- Query results are rendered into HTML templates (with navbare.php included).
- State changes (new volunteer sign-up, new demande_inscription) persist in the MySQL data layer.

##### Architectural patterns and design principles
- MVC-style:
- View = PHP pages + Bootstrap templates
- Controller = PHP scripts handling request logic
- Model = MySQL tables accessed via coon.php
- Separation of concerns: front-end assets in bootstrap-5.3.3-dist, back-end in root PHP files
- Session management for authentication

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Presentation Layer
    subgraph "Presentation Layer"
        direction TB
        CSS["bootstrap-5.3.3-dist/css"]:::frontend
        JS["bootstrap-5.3.3-dist/js"]:::frontend
        Browser["Browser (Client)"]:::frontend
        CSS --> Browser
        JS --> Browser
    end

    %% Application Layer
    subgraph "Application Layer\n(Apache & PHP)"
        direction TB
        Controllers["Controllers"]:::backend
        subgraph Auth["Authentication"]
            direction TB
            Login["login.php"]:::backend
            Rejistre["rejistre.php"]:::backend
        end
        subgraph Session["Session Management"]
            direction TB
            Infosession["infosession.php"]:::backend
            Deconnexion["deconnexion.php"]:::backend
        end
        subgraph Request["Demande Handling"]
            direction TB
            Demande["demande.php"]:::backend
        end
        subgraph UI["UI Fragment"]
            direction TB
            Navbare["navbare.php"]:::backend
        end
        subgraph Model["Database Connector"]
            direction TB
            Coon["coon.php"]:::backend
            Coon11["coon11.php"]:::backend
        end
        Controllers --> Login
        Controllers --> Rejistre
        Controllers --> Infosession
        Controllers --> Deconnexion
        Controllers --> Demande
        Login --> Navbare
        Rejistre --> Navbare
        Infosession --> Navbare
        Deconnexion --> Navbare
        Demande --> Navbare
        Login --> Coon
        Rejistre --> Coon
        Infosession --> Coon
        Deconnexion --> Coon
        Demande --> Coon
        %% alternate connector
        Controllers --> Coon11
    end

    %% Data Layer
    subgraph "Data Layer\n(MySQL Database)"
        direction TB
        DB["MySQL DB"]:::db
        README["README.md"]:::db
    end

    %% Interactions
    Browser -->|"HTTP"| Controllers
    Controllers -->|"SQL"| DB
    DB -->|"Result Set"| Controllers
    Controllers -->|"HTML Response"| Browser

    %% Click Events
    click CSS "https://github.com/yassine-dox/internship-management/tree/main/bootstrap-5.3.3-dist/css/"
    click JS "https://github.com/yassine-dox/internship-management/tree/main/bootstrap-5.3.3-dist/js/"
    click Coon "https://github.com/yassine-dox/internship-management/blob/main/coon.php"
    click Coon11 "https://github.com/yassine-dox/internship-management/blob/main/coon11.php"
    click Login "https://github.com/yassine-dox/internship-management/blob/main/login.php"
    click Rejistre "https://github.com/yassine-dox/internship-management/blob/main/rejistre.php"
    click Infosession "https://github.com/yassine-dox/internship-management/blob/main/infosession.php"
    click Deconnexion "https://github.com/yassine-dox/internship-management/blob/main/deconnexion.php"
    click Demande "https://github.com/yassine-dox/internship-management/blob/main/demande.php"
    click Navbare "https://github.com/yassine-dox/internship-management/blob/main/navbare.php"
    click README "https://github.com/yassine-dox/internship-management/blob/main/README.md"

    %% Styles
    classDef frontend fill:#e0f7fa,stroke:#006064,color:#000
    classDef backend fill:#fff3e0,stroke:#e65100,color:#000
    classDef db fill:#e8f5e9,stroke:#1b5e20,color:#000

    %% Link Styles
    linkStyle 0 stroke:#0000ff,stroke-width:2px
    linkStyle 1 stroke:#00aa00,stroke-width:2px
    linkStyle 2 stroke:#00aa00,stroke-width:2px
    linkStyle 3 stroke:#0000ff,stroke-width:2px
```
