# khawlaboukniter/youcode_filrouge architecture

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

- Interactive diagram: https://gitdiagram.com/khawlaboukniter/youcode_filrouge
- Repository: https://github.com/khawlaboukniter/youcode_filrouge

## Overview

##### Project type and purpose
- This is a full-stack gallery/event marketplace application (“ArtSpace”):
- Frontend: a React-based 3D/SPA client (artspace-frontend) for users, artists, and admins.
- Backend: a Laravel REST API + MVC application managing users, artists, artworks, events, reservations, tickets, payments, comments.

##### File structure
- Top-level separation:
- artspace-frontend/ → React client, Webpack/Vite, 3D modules, component hierarchy, routes.
- app/, config/, routes/, database/, resources/, public/ → Laravel app (MVC controllers, models, services, repositories, policies, requests, notifications).
- Architectural patterns:
- Backend follows MVC + Service-Repository layers + Policy/Middleware for auth & RBAC.
- Frontend follows component‐based UI + a central AppRouter and api.js for HTTP calls.
- Deployment/config artifacts:
- .env.example, config/*.php, composer.json, package.json, vite.config.js, artisan script.

##### Detailed capture of essential elements
- Do not simply list files; group by logical component (Auth, Artworks, Events, Reservations).
- Shared modules (ValidationHelper, AppServiceProvider) in the infrastructure layer.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Layer
    subgraph "Frontend (React SPA)" 
        direction TB
        FE_ROOT["React SPA Client"]:::frontend
        ROUTER["AppRouter"]:::frontend
        API_CLIENT["api.js"]:::frontend
        VIEWER["3D Viewer Components"]:::frontend
        AUTH_PAGES["Login / Register Pages"]:::frontend
        ADMIN_PAGES["Admin Dashboard Pages"]:::frontend
        ADMIN_CMPS["Admin Dashboard Components"]:::frontend
        ARTIST_PAGE["Artist Dashboard Page"]:::frontend
        ARTIST_CMPS["Artist Dashboard Components"]:::frontend
        USER_PAGE["User Dashboard Page"]:::frontend
        USER_CMPS["User Dashboard Components"]:::frontend
    end

    %% Backend Layer
    subgraph "Backend (Laravel API)" 
        direction TB
        API_GATEWAY["API Gateway\n(public/index.php)"]:::gateway
        ROLES_MW["RoleMiddleware"]:::middleware
        subgraph "HTTP Layer"
            direction TB
            ROUTES["Route Definitions"]:::controller
            CONTROLLERS["Controllers"]:::controller
        end
        subgraph "Validation Layer"
            direction TB
            REQ["Form Requests"]:::validation
        end
        subgraph "Service Layer"
            direction TB
            SERVICES["Services"]:::service
        end
        subgraph "Repository Layer"
            direction TB
            REPOS["Repositories"]:::repo
        end
        subgraph "Models & Policies"
            direction TB
            MODELS["Models"]:::model
            POLICIES["Policies"]:::policy
        end
        subgraph "Notifications & Helpers"
            direction TB
            NOTIFS["Notifications"]:::external
            HELPERS["Helpers & Providers"]:::infrastructure
        end
    end

    %% Database & External
    DB["Database\n(MySQL/Postgres)"]:::database
    PAYMENT["Payment Gateway"]:::cloud
    MAIL["Mail/Notification Service"]:::cloud

    %% Frontend -> Backend flows
    FE_ROOT -->|uses| ROUTER
    ROUTER -->|calls| API_CLIENT
    API_CLIENT -->|HTTP Requests| API_GATEWAY

    %% Backend internal flows
    API_GATEWAY -->|routes to| ROUTES
    ROUTES -->|guarded by| ROLES_MW
    ROUTES -->|invoke| CONTROLLERS
    CONTROLLERS -->|validate| REQ
    CONTROLLERS -->|use| SERVICES
    SERVICES -->|access| REPOS
    REPOS -->|query| DB
    SERVICES -->|emit| NOTIFS
    SERVICES -->|call| PAYMENT
    NOTIFS -->|send via| MAIL
    SERVICES -->|use| HELPERS
    CONTROLLERS -->|authorize| POLICIES
    SERVICES -->|work with| MODELS

    %% Click Events Frontend
    click FE_ROOT "https://github.com/khawlaboukniter/youcode_filrouge/tree/master/artspace-frontend/"
    click ROUTER "https://github.com/khawlaboukniter/youcode_filrouge/blob/master/artspace-frontend/src/routes/AppRouter.js"
    click API_CLIENT "https://github.com/khawlaboukniter/youcode_filrouge/blob/master/artspace-frontend/src/api.js"
    click VIEWER "https://github.com/khawlaboukniter/youcode_filrouge/tree/master/artspace-frontend/src/components/3D/"
    click AUTH_PAGES "https://github.com/khawlaboukniter/youcode_filrouge/blob/master/artspace-frontend/src/pages/Login.js"
    click AUTH_PAGES "https://github.com/khawlaboukniter/youcode_filrouge/blob/master/artspace-frontend/src/pages/Register.js"
    click ADMIN_PAGES "https://github.com/khawlaboukniter/youcode_filrouge/blob/master/artspace-frontend/src/pages/AdminDash.js"
    click ADMIN_PAGES "https://github.com/khawlaboukniter/youcode_filrouge/blob/master/artspace-frontend/src/pages/AdminArtistsPage.js"
    click ADMIN_PAGES "https://github.com/khawlaboukniter/youcode_filrouge/blob/master/artspace-frontend/src/pages/AdminEvents.js"
    click ADMIN_PAGES "https://github.com/khawlaboukniter/youcode_filrouge/blob/master/artspace-frontend/src/pages/AdminStats.js"
    click ADMIN_PAGES "https://github.com/khawlaboukniter/youcode_filrouge/blob/master/artspace-frontend/src/pages/AdminUsersPage.js"
    click ADMIN_CMPS "https://github.com/khawlaboukniter/youcode_filrouge/tree/master/artspace-frontend/src/components/admin/"
    click ARTIST_PAGE "https://github.com/khawlaboukniter/youcode_filrouge/blob/master/artspace-frontend/src/pages/ArtistDash.js"
    click ARTIST_CMPS "https://github.com/khawlaboukniter/youcode_filrouge/tree/master/artspace-frontend/src/components/artistDash/"
    click USER_PAGE "https://github.com/khawlaboukniter/youcode_filrouge/blob/master/artspace-frontend/src/pages/UserDash.js"
    click USER_CMPS "https://github.com/khawlaboukniter/youcode_filrouge/tree/master/artspace-frontend/src/components/userDash/"

    %% Click Events Backend
    click API_GATEWAY "https://github.com/khawlaboukniter/youcode_filrouge/blob/master/public/index.php"
    click ROUTES "https://github.com/khawlaboukniter/youcode_filrouge/blob/master/routes/api.php"
    click CONTROLLERS "https://github.com/khawlaboukniter/youcode_filrouge/tree/master/app/Http/Controllers/"
    click ROLES_MW "https://github.com/khawlaboukniter/youcode_filrouge/blob/master/app/Http/Middleware/RoleMiddleware.php"
    click REQ "https://github.com/khawlaboukniter/youcode_filrouge/tree/master/app/Http/Requests/"
    click SERVICES "https://github.com/khawlaboukniter/youcode_filrouge/tree/master/app/Services/"
    click REPOS "https://github.com/khawlaboukniter/youcode_filrouge/tree/master/app/Repositories/"
    click MODELS "https://github.com/khawlaboukniter/youcode_filrouge/tree/master/app/Models/"
    click POLICIES "https://github.com/khawlaboukniter/youcode_filrouge/tree/master/app/Policies/"
    click NOTIFS "https://github.com/khawlaboukniter/youcode_filrouge/blob/master/app/Notifications/PaymentSuccessNotification.php"
    click HELPERS "https://github.com/khawlaboukniter/youcode_filrouge/blob/master/app/Helpers/ValidationHelper.php"

    click DB "https://github.com/khawlaboukniter/youcode_filrouge/tree/master/database/migrations/"

    classDef frontend fill:#cce5ff,stroke:#004085,color:#004085
    classDef gateway fill:#d4edda,stroke:#155724,color:#155724
    classDef controller fill:#d1ecf1,stroke:#0c5460,color:#0c5460
    classDef middleware fill:#f8d7da,stroke:#721c24,color:#721c24
    classDef validation fill:#fff3cd,stroke:#856404,color:#856404
    classDef service fill:#ffe5b4,stroke:#b5651d,color:#b5651d
    classDef repo fill:#f5f5dc,stroke:#8b4513,color:#8b4513
    classDef model fill:#e2e3e5,stroke:#6c757d,color:#6c757d
    classDef policy fill:#f0f0f0,stroke:#636363,color:#636363
    classDef infrastructure fill:#e2f0d9,stroke:#2e7d32,color:#2e7d32
    classDef database fill:#d6d8db,stroke:#1b1e21,color:#1b1e21
    classDef cloud fill:#d1ecf1,stroke:#0c5460,color:#0c5460
```
