# ismail-en-niou/mandomati_pfe architecture

> Architecture diagram of the GitHub repository ismail-en-niou/mandomati_pfe, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-09-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ismail-en-niou/mandomati_pfe
- Repository: https://github.com/ismail-en-niou/mandomati_pfe

## Overview

##### Project type and purpose
- This is a React single-page application (SPA) scaffolded with Vite.
- It serves as a multi-role educational management portal (Admin, Professor, Student, Parent, HR, Root), with login, routing, and UI state managed in-browser.

##### High-level file-structure analysis
- Top level:
- index.html – SPA entry point
- vite.config.js, postcss.config.js, tailwind.config.js – build and styling configs
- src/ – all application code
- src/components/ – reusable UI pieces (modals, tables, cards, calendar, etc.)
- src/pages/ – route-specific container components grouped by user role
- src/context/ – React Context providers for Auth, Admin, RH, Root
- package.json & ESLint config – dependencies and linting rules

##### Architectural characteristics & patterns
- SPA with client-side routing (React Router implied by pages folder structure).
- UI organized in a component hierarchy:
Context Providers → App → Navbar/Top → Page Container → Role-specific components.
- Shared state via React Context (auth, admin state, etc.).
- Build-time pipeline using Vite, PostCSS, Tailwind and ESLint.

##### Main components
- Browser (end user)
- React SPA
- App Shell (index.html, main.jsx)
- Context Layer (AuthContext, AdminContext, etc.)
- Routing Layer (maps URLs to page components)
- UI Component Layer (reusable components from src/components/)
- Page Layer (role-based pages under src/pages/)
- Static asset store (public folder & imported images/assets)
- External API Service(s) (REST/GraphQL—endpoints consumed by contexts or hooks)
- Build & Deployment (Vite dev server, production static host like Vercel)

##### Relationships & interactions
- Browser → (HTTP) → Vite Dev Server or Static Host → delivers index.html + bundled JS/CSS
- React App bootstraps → mounts into DOM
- Contexts initialize (e.g., check auth via API)
- Router directs user to correct page based on role
- Page components request data via Context or direct fetch to external API
- Components render UI, user events propagate back through contexts or local state
- Assets loaded from public directory or bundled path

##### Key architectural patterns & principles
- Component-based architecture for UI reuse
- Context APIs for cross-cutting state
- Clear folder structure separating reusable components from pages
- Build-time toolchain (Vite, PostCSS, Tailwind) decoupled from runtime

##### Detail level
- Representative page groups (Admin Pages, Student Pages, etc.)
- Asset flow from public/ folder.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Build Phase
    subgraph "Build Phase"
        direction TB
        VITE_CONF["vite.config.js"]:::build
        POSTCSS_CONF["postcss.config.js"]:::build
        TAILWIND_CONF["tailwind.config.js"]:::build
        ESLINT_CONF["eslint.config.js"]:::build
        VITE_CONF -->|configures| BUNDLER["Vite Dev Server / Bundler"]:::build
        POSTCSS_CONF -->|configures| BUNDLER
        TAILWIND_CONF -->|configures| BUNDLER
        ESLINT_CONF -->|lints| BUNDLER
    end

    %% Deployment Phase
    subgraph "Deployment Phase"
        direction TB
        VERCEL["Vercel / Static Host"]:::build
    end

    BUNDLER -->|deploys to| VERCEL

    %% Runtime Phase
    subgraph "Runtime Phase"
        direction TB
        BROWSER["Browser (User)"]:::runtime
        SERVE["Serve index.html + bundle"]:::build
        BROWSER -->|HTTP GET /| SERVE
        SERVE -->|delivers| BROWSER

        %% Entry Layer
        ENTRY["index.html (App Shell)"]:::runtime
        BROWSER --> ENTRY
        click ENTRY "https://github.com/ismail-en-niou/mandomati_pfe/blob/main/index.html"

        MAIN["src/main.jsx (Bootstrapper)"]:::runtime
        ENTRY --> MAIN
        click MAIN "https://github.com/ismail-en-niou/mandomati_pfe/blob/main/src/main.jsx"

        APP["src/App.jsx (Root App)"]:::runtime
        MAIN --> APP
        click APP "https://github.com/ismail-en-niou/mandomati_pfe/blob/main/src/App.jsx"

        %% Context Layer
        subgraph "Context Layer" 
            direction TB
            AUTH_CTX["AuthContext"]:::state
            ADMIN_CTX["AdminContext"]:::state
            RH_CTX["RHContext"]:::state
            ROOT_CTX["RootContext"]:::state
        end
        APP --> AUTH_CTX
        APP --> ADMIN_CTX
        APP --> RH_CTX
        APP --> ROOT_CTX
        click AUTH_CTX "https://github.com/ismail-en-niou/mandomati_pfe/blob/main/src/context/authContext.jsx"
        click ADMIN_CTX "https://github.com/ismail-en-niou/mandomati_pfe/blob/main/src/context/AdminContext.jsx"
        click RH_CTX "https://github.com/ismail-en-niou/mandomati_pfe/blob/main/src/context/rhContext.jsx"
        click ROOT_CTX "https://github.com/ismail-en-niou/mandomati_pfe/blob/main/src/context/RootContext.jsx"

        %% Routing Layer
        ROUTER["Router Layer (defines routes)"]:::runtime
        AUTH_CTX --> ROUTER
        ADMIN_CTX --> ROUTER
        RH_CTX --> ROUTER
        ROOT_CTX --> ROUTER

        %% Page Layer
        subgraph "Page Layer"
            direction TB
            ADMIN_PAGES["Admin Pages"]:::runtime
            PROF_PAGES["Professor Pages"]:::runtime
            STUDENT_PAGES["Student Pages"]:::runtime
            PARENT_PAGES["Parent Pages"]:::runtime
            RH_PAGES["RH Pages"]:::runtime
            ROOT_PAGES["Root Pages"]:::runtime
            LOGIN_PAGE["Login Page"]:::runtime
            UNAUTH_PAGE["Unauthorized Page"]:::runtime
            NOTFOUND_PAGE["Not Found Page"]:::runtime
            HELP_PAGE["Help Page"]:::runtime
        end
        ROUTER --> ADMIN_PAGES
        ROUTER --> PROF_PAGES
        ROUTER --> STUDENT_PAGES
        ROUTER --> PARENT_PAGES
        ROUTER --> RH_PAGES
        ROUTER --> ROOT_PAGES
        ROUTER --> LOGIN_PAGE
        ROUTER --> UNAUTH_PAGE
        ROUTER --> NOTFOUND_PAGE
        ROUTER --> HELP_PAGE
        click ADMIN_PAGES "https://github.com/ismail-en-niou/mandomati_pfe/tree/main/src/pages/admin/"
        click PROF_PAGES "https://github.com/ismail-en-niou/mandomati_pfe/tree/main/src/pages/prof/"
        click STUDENT_PAGES "https://github.com/ismail-en-niou/mandomati_pfe/tree/main/src/pages/Student/"
        click PARENT_PAGES "https://github.com/ismail-en-niou/mandomati_pfe/tree/main/src/pages/parent/"
        click RH_PAGES "https://github.com/ismail-en-niou/mandomati_pfe/tree/main/src/pages/RH/"
        click ROOT_PAGES "https://github.com/ismail-en-niou/mandomati_pfe/tree/main/src/pages/root/"
        click LOGIN_PAGE "https://github.com/ismail-en-niou/mandomati_pfe/blob/main/src/pages/login/Login.jsx"
        click UNAUTH_PAGE "https://github.com/ismail-en-niou/mandomati_pfe/blob/main/src/pages/Unauthorized/Unauthorized.jsx"
        click NOTFOUND_PAGE "https://github.com/ismail-en-niou/mandomati_pfe/blob/main/src/pages/notfound/NotFoundPage.jsx"
        click HELP_PAGE "https://github.com/ismail-en-niou/mandomati_pfe/blob/main/src/pages/help/Help.jsx"

        %% Component Library
        subgraph "Component Library"
            direction TB
            NAVBAR["Navbar"]:::runtime
            MODAL["Modal"]:::runtime
            CALENDAR["Calendar"]:::runtime
            TABLE["Table"]:::runtime
            PAGINATION["Pagination"]:::runtime
            LOADER["Loading Spinner"]:::runtime
            NOTIF["Notification Panel"]:::runtime
            CONFIRM["Confirmation Modal"]:::runtime
            EMPTY["Empty State"]:::runtime
            GREETING["Greeting"]:::runtime
            WARNING["Screen Size Warning"]:::runtime
            TOPBAR["Top Bar"]:::runtime
        end
        ADMIN_PAGES --> NAVBAR
        PROF_PAGES --> NAVBAR
        STUDENT_PAGES --> NAVBAR
        PARENT_PAGES --> NAVBAR
        RH_PAGES --> NAVBAR
        ROOT_PAGES --> NAVBAR
        ADMIN_PAGES --> MODAL
        ADMIN_PAGES --> TABLE
        ADMIN_PAGES --> CALENDAR
        STUDENT_PAGES --> PAGINATION
        STUDENT_PAGES --> LOADER
        ALL_PAGES["All Pages"]:::runtime
        ALL_PAGES --> NOTIF
        ALL_PAGES --> CONFIRM
        ALL_PAGES --> EMPTY
        ALL_PAGES --> GREETING
        ALL_PAGES --> WARNING
        ALL_PAGES --> TOPBAR
        click NAVBAR "https://github.com/ismail-en-niou/mandomati_pfe/blob/main/src/components/Navbar/Navbar.jsx"
        click MODAL "https://github.com/ismail-en-niou/mandomati_pfe/blob/main/src/components/Modal/modal.jsx"
        click CALENDAR "https://github.com/ismail-en-niou/mandomati_pfe/blob/main/src/components/Calendar/Calendar.jsx"
        click TABLE "https://github.com/ismail-en-niou/mandomati_pfe/blob/main/src/components/Table/Table.jsx"
        click PAGINATION "https://github.com/ismail-en-niou/mandomati_pfe/blob/main/src/components/Pagination.jsx"
        click LOADER "https://github.com/ismail-en-niou/mandomati_pfe/blob/main/src/components/LoadingSpinner.jsx"
        click NOTIF "https://github.com/ismail-en-niou/mandomati_pfe/blob/main/src/components/NotificationPanel/NotificationPanel.jsx"
        click CONFIRM "https://github.com/ismail-en-niou/mandomati_pfe/blob/main/src/components/ConfirmationModal.jsx"
        click EMPTY "https://github.com/ismail-en-niou/mandomati_pfe/blob/main/src/components/EmptyState.jsx"
        click GREETING "https://github.com/ismail-en-niou/mandomati_pfe/blob/main/src/components/Greeting/Greeting.jsx"
        click WARNING "https://github.com/ismail-en-niou/mandomati_pfe/blob/main/src/components/ScreenSizeWarning.jsx"
        click TOPBAR "https://github.com/ismail-en-niou/mandomati_pfe/blob/main/src/components/Top.jsx"

        %% Assets
        ASSETS_PUBLIC["public/ (Static Assets)"]:::external
        ASSETS_SRC["src/assets/"]:::external
        APP --> ASSETS_PUBLIC
        APP --> ASSETS_SRC
        click ASSETS_PUBLIC "https://github.com/ismail-en-niou/mandomati_pfe/tree/main/public/"
        click ASSETS_SRC "https://github.com/ismail-en-niou/mandomati_pfe/tree/main/src/assets/"

        %% External API
        API["External API Service"]:::external
        AUTH_CTX --> API
        ADMIN_CTX --> API
        RH_CTX --> API
        ROOT_CTX --> API
        ADMIN_PAGES --> API
        STUDENT_PAGES --> API

        %% Deployment flow
        VERCEL -->|serves| SERVE
    end

    %% Legend and Styles
    classDef runtime fill:#cfe2ff,stroke:#333,stroke-width:1px
    classDef state fill:#d1e7dd,stroke:#333,stroke-width:1px
    classDef build fill:#ffe5b4,stroke:#333,stroke-width:1px
    classDef external fill:#e2e3e5,stroke:#333,stroke-width:1px
```
