# mohamediliasskaddar/app-gestion-conge architecture

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

- Interactive diagram: https://gitdiagram.com/mohamediliasskaddar/app-gestion-conge
- Repository: https://github.com/mohamediliasskaddar/app-gestion-conge

## Overview

##### Project type and purpose
- This is an Angular (v19) application scaffolded with Angular CLI.
- It includes both a browser‐side client (src/main.ts) and a Node.js server entrypoint (src/main.server.ts + src/server.ts), indicating it uses Angular Universal for server-side rendering (SSR).
- The app is a leave (congé) management front-end: it provides pages to list, view, edit, and request leaves, handles user authentication, and sends notification emails.

##### Top-level file structure analysis
- Angular configuration: angular.json, tsconfig*.json
- Public assets & index.html
- Server/SSR entrypoints: src/main.server.ts, src/server.ts
- Client entrypoint: src/main.ts
- App code under src/app:
- Pages (conge-calendar, conge-details, conge-edit, conge-form, conge-table, dashboard, login, user‐form)
- Guards (auth.guard.ts)
- Services (auth.service.ts, conge.service.ts, email.service.ts, user.service.ts)
- Shared components (header, sidebar)
- Config & routes (app.config.ts/​.server.ts, app.routes.ts/​.server.ts)
- Utils & seed data: src/app/utils

##### README insights
- Standard Angular CLI commands for dev, build, test, e2e
- No backend code beyond SSR stub; the “real” data API is expected to be an external REST service.

##### Defining the main components
a. Client Browser (Angular application running in the browser)
b. SSR Node Server (Node.js + Express hosting Angular Universal)
c. External REST API (authentication, leave management, user management, email notifications)
d. Data stores (external database behind REST API; not part of this repo but represented)
e. Asset hosting (public/assets served by Node server)

##### Relationships & interactions
- Browser → SSR Node Server: initial page request (HTML + pre‐rendered app).
- Browser ↔ REST API: subsequent HTTP calls from Angular services (AuthService, CongeService, UserService, EmailService).
- SSR Node Server → REST API: server‐side service calls for pre‐rendering pages on first load.
- SSR Node Server → Asset Folder: serves static assets and index.html for client.

##### Architectural patterns & design principles
- Component‐based UI (Angular components grouped into “pages” and “shared”).
- Module separation: top-level app module; feature modules implicit per page directory.
- Client-server design with SSR for SEO/performance.
- Route guards for auth protection.
- Service layer abstracts HTTP calls.

##### Key technologies & frameworks
- Angular v19 (Components, Modules, Services, Guards, Routing)
- Angular Universal (Server-Side Rendering)
- Node.js/Express (SSR server)
- TypeScript
- Karma (unit tests), (e2e tests optional)

##### Final checklist
- Clear component labels (e.g., “Angular Browser App”, “Node SSR Server”, “External REST API”, “Database”)
- Internal Angular elements in sub-containers (pages, services, shared)
- SSR vs. client‐only flows
- Config files and entrypoints

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Browser Application
    subgraph "Angular Browser App" 
        direction TB
        BrowserPages["Pages\n(conge-calendar, conge-details, conge-edit,\nconge-form, conge-table, dashboard,\nlogin, user-form, layout)"]:::client
        BrowserServices["Services\n(AuthService, CongeService,\nUserService, EmailService)"]:::client
        BrowserShared["Shared Components\n(Header, Sidebar)"]:::client
        BrowserGuards["Route Guards\n(AuthGuard)"]:::client
        BrowserUtils["Utilities\n(types, seed-conges)"]:::client
        BrowserRouting["Routing & Config\n(app.routes.ts, app.config.ts)"]:::client
    end

    %% SSR Node Server
    subgraph "Node SSR Server" 
        direction TB
        SSREntry["Entry Points\n(main.server.ts, server.ts)"]:::server
        SSRConfig["Server Routing & Config\n(app.routes.server.ts,\napp.config.server.ts)"]:::server
        SSRBuild["Build & SSR Config\n(angular.json,\ntsconfig*.json)"]:::server
    end

    %% External REST API and Database
    subgraph "External Backend" 
        direction TB
        RESTAPI["External REST API\n(/api/auth, /api/conges,\n/api/users, /api/email)"]:::external
        Database[(Database)]:::external
    end

    %% Asset Store
    AssetStore["Static Assets\n(public/index.html,\npublic/assets)"]:::asset

    %% Interactions
    BrowserPages -->|"initial navigation GET /"| SSREntry
    SSREntry -->|"serves static files"| AssetStore
    SSREntry -->|"GET /api/conges etc."| RESTAPI
    BrowserServices -->|"XHR calls\nGET/POST /api/*"| RESTAPI
    RESTAPI -->|"read/write"| Database

    %% Click events for mapping components
    click BrowserPages "https://github.com/mohamediliasskaddar/app-gestion-conge/blob/master/src/app/pages/conge-calendar/conge-calendar.component.ts"
    click BrowserServices "https://github.com/mohamediliasskaddar/app-gestion-conge/blob/master/src/app/services/auth.service.ts"
    click BrowserServices "https://github.com/mohamediliasskaddar/app-gestion-conge/blob/master/src/app/services/conge.service.ts"
    click BrowserServices "https://github.com/mohamediliasskaddar/app-gestion-conge/blob/master/src/app/services/user.service.ts"
    click BrowserServices "https://github.com/mohamediliasskaddar/app-gestion-conge/blob/master/src/app/services/email.service.ts"
    click BrowserShared "https://github.com/mohamediliasskaddar/app-gestion-conge/blob/master/src/app/shared/header/header.component.ts"
    click BrowserShared "https://github.com/mohamediliasskaddar/app-gestion-conge/blob/master/src/app/shared/sidebar/sidebar.component.ts"
    click BrowserGuards "https://github.com/mohamediliasskaddar/app-gestion-conge/blob/master/src/app/guards/auth.guard.ts"
    click BrowserUtils "https://github.com/mohamediliasskaddar/app-gestion-conge/blob/master/src/app/utils/types.ts"
    click BrowserRouting "https://github.com/mohamediliasskaddar/app-gestion-conge/blob/master/src/app/app.routes.ts"
    click BrowserRouting "https://github.com/mohamediliasskaddar/app-gestion-conge/blob/master/src/app/app.config.ts"
    click SSREntry "https://github.com/mohamediliasskaddar/app-gestion-conge/blob/master/src/main.server.ts"
    click SSREntry "https://github.com/mohamediliasskaddar/app-gestion-conge/blob/master/src/server.ts"
    click SSRConfig "https://github.com/mohamediliasskaddar/app-gestion-conge/blob/master/src/app/app.routes.server.ts"
    click SSRConfig "https://github.com/mohamediliasskaddar/app-gestion-conge/blob/master/src/app/app.config.server.ts"
    click SSRBuild "https://github.com/mohamediliasskaddar/app-gestion-conge/blob/master/angular.json"
    click AssetStore "https://github.com/mohamediliasskaddar/app-gestion-conge/blob/master/public/index.html"
    click AssetStore "https://github.com/mohamediliasskaddar/app-gestion-conge/tree/master/public/assets/"

    %% Styling
    classDef client fill:#D0E8FF,stroke:#4D9DE0,stroke-width:1px,font-weight:bold
    classDef server fill:#DFF7D8,stroke:#46A049,stroke-width:1px,font-weight:bold
    classDef external fill:#FFE6CC,stroke:#E08E0B,stroke-width:1px,font-weight:bold
    classDef asset fill:#F2D1F0,stroke:#A63D7A,stroke-width:1px,font-weight:bold
```
