# boubsila/webproject2025 architecture

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

- Interactive diagram: https://gitdiagram.com/boubsila/webproject2025
- Repository: https://github.com/boubsila/webproject2025

## Overview

##### Project type and purpose
- This is a full-stack online marketplace (“Art Marketplace Platform”) where artisan sellers, customers, delivery partners and administrators each have a dedicated dashboard.
- Front-end: Angular SPA.
- Back-end: ASP.NET Core REST API with N-tier layered architecture (Presentation → Business → Data → Domain).
- Persists data via Entity Framework Core to a relational database.
- Secured by JWT token authentication.

##### File structure
- Top-level directories:
- Frontend: Angular project under /Frontend/frontend_artisans.
- Backend: ASP.NET solution under /Backend/Backend_Artisans with four sub-projects:
– Domain: entity definitions and DTOs
– Data: EF Core DbContext, migrations, repository implementation
– Business: service interfaces and implementations
– Backend_Artisans: API controllers, authentication service, Program.cs, appsettings
- Notice typical MVC/RESTful API controllers in Backend_Artisans/Controllers.
- Database migration files in Data/Migrations.
- Angular modules in src/app (Auth, Dashboard per role, NavBar, Services).
- Configuration files: angular.json, tsconfig.json, appsettings.json, launchSettings.json.

##### README for insights
- Confirms tech stack: Angular + ASP.NET Core + EF Core + JWT.
- Lists user roles and use cases: Artisan, Client, Delivery partner, Admin.
- Shows example API endpoints for each role.
- Describes N-tier REST architecture.

a. Main components
- Users (Artisan, Client, Delivery, Admin)
- Angular SPA (Presentation layer)
- ASP.NET Core API (Presentation → Controllers)
- Business Logic layer (IService, Service)
- Data Access layer (DbContext, IRepo, Repo)
- Domain Model (Entities, DTOs)
- Relational Database (SQL Server)
- Authentication Service (JWT token provider/validator)
b. Relationships & interactions
- Users → HTTP(S) calls → Angular SPA
- Angular services call REST endpoints on ASP.NET Core API
- Controllers inject Business services → call Data repositories → query/update DB
- Authentication: login/register endpoints issue JWT; Angular interceptor attaches token; API middleware validates token
c. Architectural patterns & design principles
- Layered (N-tier) architecture: Presentation, Application (Controllers), Domain, Business, Infrastructure (Data)
- RESTful API design
- Dependency Injection for services and repositories
- JWT-based stateless authentication
- Separation of concerns (Angular modules per feature, .NET projects per layer)
d. Key technologies/frameworks
- Angular (TypeScript, RxJS, Guards, Interceptors)
- ASP.NET Core (Controllers, Middleware, DI)
- Entity Framework Core (Code-first migrations)
- JWT tokens for auth

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Actors
    subgraph "Users"
        Artisan["Artisan"]:::actor
        Client["Client"]:::actor
        Delivery["Delivery Partner"]:::actor
        Admin["Admin"]:::actor
    end
    Artisan -->|uses| Browser["Browser"]:::browser
    Client -->|uses| Browser
    Delivery -->|uses| Browser
    Admin -->|uses| Browser

    %% Frontend
    Browser -->|HTTP GET/POST| SPA["Angular SPA"]:::frontend

    subgraph "Angular SPA"
        direction TB
        Auth["Auth Module"]:::auth
        Dash["Dashboard Modules"]:::dash
        Nav["NavBar Module"]:::nav
        Serv["Services Layer"]:::services
        Auth --> Serv
        Dash --> Serv
        Nav --> Serv
    end

    %% Config files
    SPA --> Config["Config Files"]:::config

    %% Backend API
    SPA -->|Calls REST API| API["ASP.NET Core API"]:::backend

    subgraph "ASP.NET Core API"
        direction TB
        Controllers["Controllers"]:::controller
        AuthService["Authentication Service"]:::authsvc
        Biz["Business Logic Layer"]:::business
        DataLayer["Data Access Layer"]:::data
        Domain["Domain Model"]:::domain

        Controllers --> Biz
        Biz --> DataLayer
        DataLayer --> Domain
        AuthService --> Controllers
    end

    %% Database
    DataLayer -->|SQL SELECT/UPDATE| DB["SQL Server"]:::db

    %% Click Events - Frontend
    click SPA "https://github.com/boubsila/webproject2025/tree/main/Frontend/frontend_artisans/src/app"
    click Auth "https://github.com/boubsila/webproject2025/tree/main/Frontend/frontend_artisans/src/app/Authentification"
    click Auth "https://github.com/boubsila/webproject2025/blob/main/Frontend/frontend_artisans/src/app/Authentification/auth.service.ts"
    click Auth "https://github.com/boubsila/webproject2025/blob/main/Frontend/frontend_artisans/src/app/Authentification/addToken.interceptor.ts"
    click Auth "https://github.com/boubsila/webproject2025/blob/main/Frontend/frontend_artisans/src/app/Authentification/auth.guard.ts"
    click Auth "https://github.com/boubsila/webproject2025/tree/main/Frontend/frontend_artisans/src/app/Authentification/login"
    click Auth "https://github.com/boubsila/webproject2025/tree/main/Frontend/frontend_artisans/src/app/Authentification/register"
    click Dash "https://github.com/boubsila/webproject2025/tree/main/Frontend/frontend_artisans/src/app/Dashboard"
    click Dash "https://github.com/boubsila/webproject2025/tree/main/Frontend/frontend_artisans/src/app/Dashboard/admin-dashboard"
    click Dash "https://github.com/boubsila/webproject2025/tree/main/Frontend/frontend_artisans/src/app/Dashboard/artisan-dashboard"
    click Dash "https://github.com/boubsila/webproject2025/tree/main/Frontend/frontend_artisans/src/app/Dashboard/client-dashboard"
    click Dash "https://github.com/boubsila/webproject2025/tree/main/Frontend/frontend_artisans/src/app/Dashboard/livreur-dashboard"
    click Nav "https://github.com/boubsila/webproject2025/tree/main/Frontend/frontend_artisans/src/app/NavBar"
    click Nav "https://github.com/boubsila/webproject2025/tree/main/Frontend/frontend_artisans/src/app/NavBar/carousel"
    click Nav "https://github.com/boubsila/webproject2025/tree/main/Frontend/frontend_artisans/src/app/NavBar/navbar"
    click Serv "https://github.com/boubsila/webproject2025/tree/main/Frontend/frontend_artisans/src/app/services"
    click Serv "https://github.com/boubsila/webproject2025/blob/main/Frontend/frontend_artisans/src/app/services/avis.service.ts"
    click Serv "https://github.com/boubsila/webproject2025/blob/main/Frontend/frontend_artisans/src/app/services/order.service.ts"
    click Serv "https://github.com/boubsila/webproject2025/blob/main/Frontend/frontend_artisans/src/app/services/product.service.ts"
    click Serv "https://github.com/boubsila/webproject2025/blob/main/Frontend/frontend_artisans/src/app/services/user.service.ts"
    click Config "https://github.com/boubsila/webproject2025/blob/main/Frontend/frontend_artisans/angular.json"
    click Config "https://github.com/boubsila/webproject2025/blob/main/Frontend/frontend_artisans/tsconfig.json"
    click Config "https://github.com/boubsila/webproject2025/blob/main/Frontend/frontend_artisans/src/app/app.routes.ts"
    click Config "https://github.com/boubsila/webproject2025/blob/main/Frontend/frontend_artisans/src/app/app.config.ts"

    %% Click Events - Backend
    click API "https://github.com/boubsila/webproject2025/tree/main/Backend/Backend_Artisans/Backend_Artisans"
    click Controllers "https://github.com/boubsila/webproject2025/tree/main/Backend/Backend_Artisans/Backend_Artisans/Controllers"
    click Controllers "https://github.com/boubsila/webproject2025/blob/main/Backend/Backend_Artisans/Backend_Artisans/Controllers/AuthenticationController.cs"
    click Controllers "https://github.com/boubsila/webproject2025/blob/main/Backend/Backend_Artisans/Backend_Artisans/Controllers/AvisController.cs"
    click Controllers "https://github.com/boubsila/webproject2025/blob/main/Backend/Backend_Artisans/Backend_Artisans/Controllers/CommandeController.cs"
    click Controllers "https://github.com/boubsila/webproject2025/blob/main/Backend/Backend_Artisans/Backend_Artisans/Controllers/ProduitController.cs"
    click Controllers "https://github.com/boubsila/webproject2025/blob/main/Backend/Backend_Artisans/Backend_Artisans/Controllers/StatisticsController.cs"
    click AuthService "https://github.com/boubsila/webproject2025/blob/main/Backend/Backend_Artisans/Backend_Artisans/Authentication/AuthenticationService.cs"
    click Biz "https://github.com/boubsila/webproject2025/tree/main/Backend/Backend_Artisans/Business"
    click Biz "https://github.com/boubsila/webproject2025/blob/main/Backend/Backend_Artisans/Business/IService.cs"
    click Biz "https://github.com/boubsila/webproject2025/blob/main/Backend/Backend_Artisans/Business/Service.cs"
    click DataLayer "https://github.com/boubsila/webproject2025/tree/main/Backend/Backend_Artisans/Data"
    click DataLayer "https://github.com/boubsila/webproject2025/blob/main/Backend/Backend_Artisans/Data/AppDbContext.cs"
    click DataLayer "https://github.com/boubsila/webproject2025/blob/main/Backend/Backend_Artisans/Data/IRepo.cs"
    click DataLayer "https://github.com/boubsila/webproject2025/blob/main/Backend/Backend_Artisans/Data/Repo.cs"
    click DataLayer "https://github.com/boubsila/webproject2025/tree/main/Backend/Backend_Artisans/Data/Migrations"
    click DataLayer "https://github.com/boubsila/webproject2025/blob/main/Backend/Backend_Artisans/Data/Migrations/20250518210637_init.cs"
    click DataLayer "https://github.com/boubsila/webproject2025/blob/main/Backend/Backend_Artisans/Data/Migrations/20250522212257_MapCommentaireToCommentaireData.cs"
    click DataLayer "https://github.com/boubsila/webproject2025/blob/main/Backend/Backend_Artisans/Data/Migrations/20250604195121_seed-add-data-users.cs"
    click DataLayer "https://github.com/boubsila/webproject2025/blob/main/Backend/Backend_Artisans/Data/Migrations/20250604200410_seed-add-data-product.cs"
    click Domain "https://github.com/boubsila/webproject2025/tree/main/Backend/Backend_Artisans/Domain"
    click Domain "https://github.com/boubsila/webproject2025/blob/main/Backend/Backend_Artisans/Domain/Entities/Avis.cs"
    click Domain "https://github.com/boubsila/webproject2025/blob/main/Backend/Backend_Artisans/Domain/Entities/Commande.cs"
    click Domain "https://github.com/boubsila/webproject2025/blob/main/Backend/Backend_Artisans/Domain/Entities/Produit.cs"
    click Domain "https://github.com/boubsila/webproject2025/blob/main/Backend/Backend_Artisans/Domain/Entities/User.cs"
    click Domain "https://github.com/boubsila/webproject2025/blob/main/Backend/Backend_Artisans/Domain/DTOs/AvisDTO.cs"
    click Domain "https://github.com/boubsila/webproject2025/blob/main/Backend/Backend_Artisans/Domain/DTOs/AvisClientDTO.cs"
    click Domain "https://github.com/boubsila/webproject2025/blob/main/Backend/Backend_Artisans/Domain/DTOs/ReponseArtisanDTO.cs"

    %% Styles
    classDef actor fill:#b2f2bb,stroke:#2f9e44,stroke-width:1px
    classDef browser fill:#dee2e6,stroke:#495057,stroke-width:1px
    classDef frontend fill:#74c0fc,stroke:#1c7ed6,stroke-width:1px,stroke-dasharray: 2 2
    classDef auth fill:#ffd43b,stroke:#fcc419,stroke-width:1px
    classDef dash fill:#4dabf7,stroke:#228be6,stroke-width:1px
    classDef nav fill:#4dabf7,stroke:#228be6,stroke-width:1px
    classDef services fill:#a5d8ff,stroke:#339af0,stroke-width:1px
    classDef config fill:#adb5bd,stroke:#6c757d,stroke-width:1px
    classDef backend fill:#c3fae8,stroke:#20c997,stroke-width:1px
    classDef controller fill:#99e9f2,stroke:#12b886,stroke-width:1px
    classDef authsvc fill:#ffa8a8,stroke:#f03e3e,stroke-width:1px
    classDef business fill:#fcc2ff,stroke:#d6336c,stroke-width:1px
    classDef data fill:#ffe066,stroke:#f59f00,stroke-width:1px
    classDef domain fill:#ffd8a8,stroke:#f76707,stroke-width:1px
    classDef db fill:#ff922b,stroke:#e8590c,stroke-width:1px
```
