# salimlaghrib/culture_digitale_platform architecture

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

- Interactive diagram: https://gitdiagram.com/salimlaghrib/culture_digitale_platform
- Repository: https://github.com/salimlaghrib/culture_digitale_platform

## Overview

##### Project Type and Purpose
- This is a frontend-only Angular SPA generated with Angular CLI 17.3.12.
- Purpose: deliver an interactive UI for browsing “courses,” viewing sequences, and rendering PDFs in modals.

##### File Structure
- Top-level files: angular.json, package.json (Angular CLI config and build setup).
- src/main.ts & src/index.html: application bootstrap and host page.
- src/app/app.module.ts & app-routing.module.ts: root module and router definitions.
- src/app/components: feature directories (home, courses, sequence, reader-pdf, modal-pdf, header, footer).
- src/app/model: TypeScript interfaces (Course, Quiz, Sequence, Author) defining domain objects.
- No dedicated “services” folder—components likely use Angular HttpClient to call backend APIs (implied).

##### README for Additional Insights
- Standard Angular CLI commands (serve, build, test).
- No explicit backend or API documentation—assume the SPA consumes external REST endpoints.

##### Main Components & Their Relationships
a. Browser (client)
– Hosts the Angular app.
b. Angular CLI Dev/Build Server
– ng serve / ng build process.
c. Angular App Root
– app.module: wires up Router, declares all components.
– app-routing.module: defines routes: “/home,” “/courses,” “/sequence/:id,” etc.
d. Feature Components
– HeaderComponent & FooterComponent: persistent UI shell.
– HomeComponent: landing page.
– CoursesComponent: lists courses (uses Course model).
– SequenceComponent: shows course sequence (Sequence model, Quiz model).
– ReaderPdfComponent: renders PDF viewer.
– ModalPdfComponent: wraps PDF viewer in a modal.
e. Models
– Domain objects passed between components and HTTP services.
f. External Services (implied)
– REST API (e.g., /api/courses, /api/sequences/:id).
– PDF rendering library (e.g., PDF.js) used by ReaderPdfComponent.

##### Architectural Patterns & Design Principles
- Component‐Based Architecture: every page or UI element is an Angular component.
- Router‐Driven Navigation: single page, multiple views via app-routing.
- Dependency Injection: HttpClient, modal service injected into components.
- Separation of Concerns:
– UI (components)
– Domain models (interfaces in model folder)
– Infrastructure (HTTP layer, PDF library)

– User navigation → router
– Component → REST API calls
– Component → Model interfaces
– Component → PDF library

## Diagram (Mermaid)

```mermaid
graph TB
    %% Infrastructure
    subgraph "Infrastructure"
        direction TB
        AngularJson["angular.json"]:::infra
        PackageJson["package.json"]:::infra
        MainTS["src/main.ts"]:::infra
        IndexHTML["src/index.html"]:::infra
        AngularCLI["Angular CLI"]:::infra
    end

    AngularJson --> AngularCLI
    PackageJson --> AngularCLI
    AngularCLI -->|"build/serve"| AngularApp
    MainTS --> AngularApp
    IndexHTML --> AngularApp

    %% Angular Application
    subgraph "Angular App" 
        direction TB

        %% Shell
        subgraph "Shell" 
            direction TB
            Header["HeaderComponent"]:::frontend
            Footer["FooterComponent"]:::frontend
        end

        RouterOutlet["Router Outlet"]:::frontend

        %% Feature Components
        subgraph "Feature Components"
            direction TB
            Home["HomeComponent"]:::frontend
            Courses["CoursesComponent"]:::frontend
            Sequence["SequenceComponent"]:::frontend
            ModalPdf["ModalPdfComponent"]:::frontend
            ReaderPdf["ReaderPdfComponent"]:::frontend
        end

        %% Models
        subgraph "Domain Models"
            direction TB
            CourseModel["Course"]:::model
            SequenceModel["Sequence"]:::model
            QuizModel["Quiz"]:::model
            AuthorModel["Author"]:::model
        end
    end

    %% External Services
    RESTAPI["REST API"]:::api
    PDFLib["PDF.js Library"]:::library

    %% Data Flow & Interactions
    Browser["Browser"]:::infra
    Browser -->|"loads"| AngularApp
    Browser -->|"navigates"| RouterOutlet

    RouterOutlet -->|"route '/home'"| Home
    RouterOutlet -->|"route '/courses'"| Courses
    RouterOutlet -->|"route '/sequence/:id'"| Sequence

    Courses -->|"HTTP GET /api/courses"| RESTAPI
    Sequence -->|"HTTP GET /api/sequences/:id"| RESTAPI

    Courses -->|uses| CourseModel
    Sequence -->|uses| SequenceModel
    Sequence -->|uses| QuizModel

    Sequence -->|"open PDF modal"| ModalPdf
    ModalPdf -->|"renders"| ReaderPdf
    ReaderPdf -->|"uses"| PDFLib

    %% Click Events
    click AngularJson "https://github.com/salimlaghrib/culture_digitale_platform/blob/master/angular.json"
    click PackageJson "https://github.com/salimlaghrib/culture_digitale_platform/blob/master/package.json"
    click MainTS "https://github.com/salimlaghrib/culture_digitale_platform/blob/master/src/main.ts"
    click IndexHTML "https://github.com/salimlaghrib/culture_digitale_platform/blob/master/src/index.html"
    click Header "https://github.com/salimlaghrib/culture_digitale_platform/blob/master/src/app/header/header.component.ts"
    click Footer "https://github.com/salimlaghrib/culture_digitale_platform/blob/master/src/app/footer/footer.component.ts"
    click Home "https://github.com/salimlaghrib/culture_digitale_platform/blob/master/src/app/home/home.component.ts"
    click Courses "https://github.com/salimlaghrib/culture_digitale_platform/blob/master/src/app/courses/courses.component.ts"
    click Sequence "https://github.com/salimlaghrib/culture_digitale_platform/blob/master/src/app/sequence/sequence.component.ts"
    click ReaderPdf "https://github.com/salimlaghrib/culture_digitale_platform/blob/master/src/app/reader-pdf/reader-pdf.component.ts"
    click ModalPdf "https://github.com/salimlaghrib/culture_digitale_platform/blob/master/src/app/modal-pdf/modal-pdf.component.ts"
    click CourseModel "https://github.com/salimlaghrib/culture_digitale_platform/blob/master/src/app/model/Course.ts"
    click QuizModel "https://github.com/salimlaghrib/culture_digitale_platform/blob/master/src/app/model/Quiz.ts"
    click SequenceModel "https://github.com/salimlaghrib/culture_digitale_platform/blob/master/src/app/model/Sequence.ts"
    click AuthorModel "https://github.com/salimlaghrib/culture_digitale_platform/blob/master/src/app/model/author.ts"

    %% Styles
    classDef frontend fill:#E3F2FD,stroke:#90CAF9
    classDef api fill:#E8F5E9,stroke:#66BB6A
    classDef model fill:#FFF3E0,stroke:#FFB74D
    classDef library fill:#F3E5F5,stroke:#AB47BC
    classDef infra fill:#ECEFF1,stroke:#78909C
```
