# mehmettilhann/arabalazim architecture

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

- Interactive diagram: https://gitdiagram.com/mehmettilhann/arabalazim
- Repository: https://github.com/mehmettilhann/arabalazim

## Overview

##### Project Type & Purpose
- Full-stack, server-rendered PHP web application for vehicle rental and sales.
- Two user roles: End users (browse/list/rent/buy cars, comment, account management) and Admins (CRUD on cars, users, comments, view transactions, configure settings).

##### Core Components
a. Clients
- Web browser (desktop/mobile) – sends HTTP(S) requests and renders HTML/CSS/JS.
b. Web/Application Server
- Apache/Nginx + PHP-FPM executing PHP scripts.
- Entry-points:
– Root scripts (Arabalazim.php, contact_us.php, etc.)
– Module folders:
- login-register/ (authentication, password reset)
- arac-kirala/ (car catalog, details, booking, comments)
- admin/ (admin dashboard and management pages)
– Composer-managed PHPMailer library for outbound email.
c. Data Store
- MySQL database (users, cars, bookings, comments, transactions).
d. External Services
- SMTP server (via PHPMailer) for email notifications (password reset, booking confirmations).
e. Static Assets
- CSS, JS, images served from the same web server.

##### Relationships & Data Flows
- User Browser →(HTTPS)→ Web Server: page requests, form submissions.
- Web Server → PHP Modules: authentication, business logic.
- PHP Modules → MySQL: SELECT/INSERT/UPDATE queries.
- PHP Modules → PHPMailer → SMTP: send email.
- Web Server → Browser: HTML/CSS/JS responses.
- Admin Panel ↔ Database: manage cars, users, comments, orders.

##### Architectural Patterns & Principles
- Monolithic-modular structure: folder per feature (login, rental, admin).
- Separation of concerns:
- Presentation (HTML, CSS, JS)
- Application logic (PHP scripts)
- Data persistence (MySQL)
- Externalize email logic via PHPMailer library (composer dependency).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Title
    %% Arabalazim System Architecture

    %% Nodes
    Browser["User Browser<br/>HTML/JS/CSS"]:::browser
    WebServer["Web Server<br/>Apache/Nginx + PHP-FPM"]:::server
    Static["Static Assets<br/>CSS/JS/Images"]:::server

    subgraph "PHP Application"
        direction TB
        Auth["Authentication Module"]:::app
        Rental["User Rental Flow Module"]:::app
        Admin["Admin Dashboard Module"]:::app
        PHPMailerLib["PHPMailer Library"]:::external
    end

    Database["MySQL Database"]:::db
    SMTP["SMTP Server"]:::external

    %% Connections
    Browser -->|"GET/POST"| WebServer
    WebServer -->|"serve static"| Static
    WebServer -->|"execute PHP"| Auth
    WebServer -->|"execute PHP"| Rental
    WebServer -->|"execute PHP"| Admin

    Auth -->|"SQL SELECT/UPDATE"| Database
    Rental -->|"SQL SELECT/UPDATE"| Database
    Admin -->|"SQL SELECT/UPDATE"| Database

    Auth -->|"send email"| PHPMailerLib
    Rental -->|"send email"| PHPMailerLib

    PHPMailerLib -->|"SMTP send"| SMTP

    WebServer -->|"HTML/CSS/JS response"| Browser

    %% Click Events
    click Auth "https://github.com/mehmettilhann/arabalazim/tree/main/login-register/"
    click Rental "https://github.com/mehmettilhann/arabalazim/tree/main/arac-kirala/"
    click Admin "https://github.com/mehmettilhann/arabalazim/tree/main/admin/"
    click PHPMailerLib "https://github.com/mehmettilhann/arabalazim/tree/main/PHPMailer/"

    %% Styles
    classDef browser fill:#b2f2bb,stroke:#2f8f40,color:#000
    classDef server fill:#bee5f7,stroke:#307fc0,color:#000
    classDef app fill:#d0e1f9,stroke:#3366cc,color:#000
    classDef db fill:#ffd8a8,stroke:#cc8400,color:#000
    classDef external fill:#e2e3e5,stroke:#6c757d,color:#000
```
