# alex-adkl/ventes_meubles architecture

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

- Interactive diagram: https://gitdiagram.com/alex-adkl/ventes_meubles
- Repository: https://github.com/alex-adkl/ventes_meubles

## Overview

##### Main Components
- Backend Service: Represent the Laravel application (found under back/ventes_meubles_back). This includes its Controllers (e.g., MeublesController, PaniersController, PhotosController), Models (Meuble, Panier, Photo, User), Routes (API/web endpoints), Migrations, Seeders, and configuration files.
- Frontend Client: Represent the Vue.js application (located in front/VDM_front). Include components, views, router (src/router), state management (using Pinia), and external libraries (Tailwind CSS, Heroicons, Cypress for testing).
- Database: Represent the MySQL database that stores application data (users, meubles, paniers, photos) as configured in the Laravel app.
- External Tools/Services: Optionally, include components like version control (Git), testing frameworks (PHPUnit for back, Vitest/Cypress for front), and any deployment/build tools (Vite, composer, npm).

##### Mapping Out Relationships and Interactions
- Calls from Laravel Controllers to Models, which in turn interact with the Database.
- Detail how migrations and seeders configure the database structure and seed initial data.
- Pointers for the build/deployment process (Vite for both front and back in some cases, Composer for PHP dependencies, npm scripts for JavaScript).

##### Architectural Patterns and Design Principles
- For the Backend: The MVC (Model-View-Controller) pattern is clearly followed (Controllers handle requests, Models represent business data, and Views for server-side rendering when needed).
- For the Frontend: A component-based architecture is used, with dedicated components for different views (Home, Detail, Account, Stock, Panier). State management with Pinia and navigation with Vue Router further emphasize modularity and separation of concerns.
- API layer as the abstraction between frontend and backend. All client-side interactions flow to backend APIs which then perform business logic and data operations.

##### Relevant Technologies and Frameworks
- Backend: Laravel, PHP, MySQL.
- Frontend: Vue.js, Tailwind CSS, Vue Router, Pinia, (optionally Heroicons for UI elements, Cypress/Vitest for testing).
- Tools: Git for version control, Composer for dependency management, Vite as bundler/build tool, Node.js for frontend tooling.

##### Elements
- Labels: Each component should be clearly labeled (ex. “Laravel API – MeublesController”, “Vue.js Component – CardMeuble”, “MySQL Database”).
- Annotations to note external integrations and testing frameworks.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Subgraph
    subgraph "Frontend (Vue.js Application)"
        FE0["Frontend Client (Vue.js)"]:::frontend
        FE1["Vue Components"]:::frontend
        FE2["Vue Views"]:::frontend
        FE3["Vue Router"]:::frontend
        FE4["State Management (Pinia)"]:::frontend
        FE5["Tailwind CSS & Assets"]:::frontend
    end

    %% Backend Subgraph
    subgraph "Backend (Laravel Application)"
        BE1["Laravel Application"]:::backend
        subgraph "Controllers"
            BEC1["MeublesController"]:::backend
            BEC2["PaniersController"]:::backend
            BEC3["PhotosController"]:::backend
        end
        subgraph "Models"
            BEM1["Meuble Model"]:::backend
            BEM2["Panier Model"]:::backend
            BEM3["Photo Model"]:::backend
            BEM4["User Model"]:::backend
        end
        subgraph "Routes"
            BER1["API Routes"]:::backend
            BER2["Web Routes"]:::backend
        end
        subgraph "Migrations & Seeders"
            BEF1["Migrations"]:::backend
            BEF2["Seeders"]:::backend
        end
    end

    %% Database Subgraph
    subgraph "Database (MySQL)"
        DB1["MySQL Database"]:::database
    end

    %% Relationships between Frontend and Backend
    FE0 -->|"APIRequest"| BE1
    FE3 -->|"Navigation"| FE2

    %% Relationships within Backend
    BE1 -->|"Uses"| BER1
    BE1 -->|"Uses"| BER2
    BER1 -->|"RoutesTo"| BEC1
    BER1 -->|"RoutesTo"| BEC2
    BER1 -->|"RoutesTo"| BEC3
    BEC1 -->|"Calls"| BEM1
    BEC2 -->|"Calls"| BEM2
    BEC3 -->|"Calls"| BEM3
    BEF1 -->|"SetsUp"| BE1
    BEF2 -->|"Seeds"| BE1

    %% Relationship from Backend to Database
    BE1 -->|"ORMQuery"| DB1

    %% Click Events for Backend Components
    click BE1 "https://github.com/alex-adkl/ventes_meubles/tree/main/back/ventes_meubles_back"
    click BEC1 "https://github.com/alex-adkl/ventes_meubles/blob/main/back/ventes_meubles_back/app/Http/Controllers/MeublesController.php"
    click BEC2 "https://github.com/alex-adkl/ventes_meubles/blob/main/back/ventes_meubles_back/app/Http/Controllers/PaniersController.php"
    click BEC3 "https://github.com/alex-adkl/ventes_meubles/blob/main/back/ventes_meubles_back/app/Http/Controllers/PhotosController.php"
    click BEM1 "https://github.com/alex-adkl/ventes_meubles/blob/main/back/ventes_meubles_back/app/Models/Meuble.php"
    click BEM2 "https://github.com/alex-adkl/ventes_meubles/blob/main/back/ventes_meubles_back/app/Models/Panier.php"
    click BEM3 "https://github.com/alex-adkl/ventes_meubles/blob/main/back/ventes_meubles_back/app/Models/Photo.php"
    click BEM4 "https://github.com/alex-adkl/ventes_meubles/blob/main/back/ventes_meubles_back/app/Models/User.php"
    click BER1 "https://github.com/alex-adkl/ventes_meubles/blob/main/back/ventes_meubles_back/routes/api.php"
    click BER2 "https://github.com/alex-adkl/ventes_meubles/blob/main/back/ventes_meubles_back/routes/web.php"
    click BEF1 "https://github.com/alex-adkl/ventes_meubles/tree/main/back/ventes_meubles_back/database/migrations"
    click BEF2 "https://github.com/alex-adkl/ventes_meubles/tree/main/back/ventes_meubles_back/database/seeders"

    %% Click Events for Frontend Components
    click FE0 "https://github.com/alex-adkl/ventes_meubles/tree/main/front/VDM_front"
    click FE1 "https://github.com/alex-adkl/ventes_meubles/tree/main/front/VDM_front/src/components"
    click FE2 "https://github.com/alex-adkl/ventes_meubles/tree/main/front/VDM_front/src/views"
    click FE3 "https://github.com/alex-adkl/ventes_meubles/blob/main/front/VDM_front/src/router/index.js"
    click FE4 "https://github.com/alex-adkl/ventes_meubles/tree/main/front/VDM_front/src/stores"
    click FE5 "https://github.com/alex-adkl/ventes_meubles/blob/main/front/VDM_front/tailwind.config.js"

    %% Styles
    classDef frontend fill:#cce5ff,stroke:#004085,stroke-width:2px;
    classDef backend fill:#d4edda,stroke:#155724,stroke-width:2px;
    classDef database fill:#f8d7da,stroke:#721c24,stroke-width:2px;
```
