# ismouslih/my-portfolio architecture

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

- Interactive diagram: https://gitdiagram.com/ismouslih/my-portfolio
- Repository: https://github.com/ismouslih/my-portfolio

## Overview

##### Project type and purpose
- This is a **static single-page React application** scaffolded with Vite.
- Its purpose (inferred from the file tree) is likely a personal portfolio or marketing site: it serves sections such as About, Skills, Projects, a downloadable resume PDF, and contact links—all client-side.

##### File structure
Top-level:
- public/ – raw static assets (PDF, images, robots.txt, sitemap.xml)
- src/ – application source
– components/ – reusable UI parts (NavBar, Hero, AboutSection, etc.)
– pages/ – top-level routes (Home, Notfound)
– lib/ – pure data and utilities (projectsSet, SkillsSet, utils.js)
– App.jsx + main.jsx – entry points and React root
– index.css – global styles
Build/config:
- vite.config.js – Vite build settings
- package.json & eslint.config.js – dependencies & lint rules

##### README for additional insights
- Confirms use of Vite (with HMR) and React.
- Mentions ESLint and optional TS template—indicates a focus on fast dev feedback and code quality.

A. Development Flow
1. Developer Workstation
– Source files in src/ and public/ under Git.
– eslint.config.js runs lint rules.
– `npm run dev` spins up the Vite dev server.
2. Vite Dev Server
– Processes App.jsx + modules via ESBuild/Babel (depending on plugin).
– Serves modules with HMR to speed up edits.
3. Browser (localhost:3000)
– Loads index.html, which pulls in the Vite-served bundle.
– React hydrates components (components → pages → App).

B. Production Flow
1. CI/CD Pipeline (optional – e.g. GitHub Actions)
– Runs `npm run build`
– Vite compiles, bundles & outputs static files (index.html, assets) into dist/.
2. Static Web Host / CDN (e.g. Netlify, Vercel, GitHub Pages)
– Deploys dist/ artifacts.
– Serves index.html and JS/CSS from edge locations.
3. End-user Browser
– Requests index.html → JS/CSS → runs React SPA.
– Fetches static assets from public/ (resume PDF, images).

C. Internal Code Modules
– **App.jsx** glues together routing (Home/Notfound) and site layout.
– **components/** houses UI building blocks.
– **lib/** supplies data (skills, projects) and small utils.
– **pages/** define route endpoints.
– **public/** holds truly static resources.

##### Architectural patterns & design principles
– **SPA (Single-Page Application)**: React + client-side routing.
– **Module-based**: clearly separated components, pages, and data helpers.
– **Static pre-render**: content (resume, images) served directly via CDN.
– **HMR / fast dev feedback** courtesy of Vite and React Refresh plugin.

##### Essential architectural elements to capture
- Project structure (src vs. public)
- Build toolchain (Vite plugins, Babel/SWC)
- Deployment target (static host/CDN)
- Client-side routing (Home, Notfound)
- Data sources (local lib files vs. external APIs—none in this case)

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Developer Workstation
    subgraph "Developer Workstation"
        D1["ESLint Configuration"]:::devTools
        D2["package.json"]:::devTools
        D3["Vite Configuration"]:::devTools
        subgraph "public/"
            Passets["Static Public Assets"]:::code
            Presume["Resume PDF"]:::code
            Pimages["Images Directory"]:::code
            Pproj["Projects Raw Assets"]:::code
            Probot["robots.txt"]:::code
            Psitemap["sitemap.xml"]:::code
        end
        subgraph "src/"
            main["Application Entry Point (main.jsx)"]:::code
            App["Application Shell (App.jsx)"]:::code
            indexCSS["Global Styles (index.css)"]:::code
            subgraph "components/"
                NavBar["Navigation Bar"]:::code
                Hero["Hero Section"]:::code
                About["About Section"]:::code
                SkillsComp["Skills Section"]:::code
                ProjectsComp["Projects Section"]:::code
                Contact["Contact Section"]:::code
                ThemeToggle["Theme Toggle Control"]:::code
                CodeBg["Background Code Visual"]:::code
            end
            subgraph "pages/"
                Home["Home Page"]:::code
                Notfound["404 Not Found Page"]:::code
            end
            subgraph "lib/"
                SkillsData["Skills Data Set"]:::code
                ProjectsData["Projects Data Set"]:::code
                Utils["Helper Utilities"]:::code
            end
        end
    end

    %% Development Flow
    D1 & D2 & D3 & Passets & main & App & indexCSS -->|"npm run dev"| VDev["Vite Dev Server"]:::devTools
    VDev -->|"serve modules with HMR"| BrowserDev["Browser (localhost:3000)"]:::runtime

    %% Production Flow
    D2 & D3 & main & App -->|"push to Git"| CI["CI/CD Pipeline"]:::deploy
    CI -->|"npm run build"| Build["Vite Build Process"]:::devTools
    Build -->|"outputs static files in dist/ "| Dist["dist/"]:::deploy
    Dist -->|"deploy artifacts"| CDN["CDN / Static Web Host"]:::deploy
    CDN -->|"HTTP GET index.html, JS, CSS, assets"| BrowserProd["End-user Browser"]:::runtime
    BrowserProd -->|"requests static assets (PDF, images)"| CDN

    %% Click Events
    click Passets "https://github.com/ismouslih/my-portfolio/tree/main/public/"
    click Presume "https://github.com/ismouslih/my-portfolio/blob/main/public/documents/ISMAIL MOUSLIH resume STD v1.2 wp.pdf"
    click Pimages "https://github.com/ismouslih/my-portfolio/tree/main/public/images/"
    click Pproj "https://github.com/ismouslih/my-portfolio/tree/main/public/projects/"
    click Probot "https://github.com/ismouslih/my-portfolio/blob/main/public/robots.txt"
    click Psitemap "https://github.com/ismouslih/my-portfolio/blob/main/public/sitemap.xml"
    click main "https://github.com/ismouslih/my-portfolio/blob/main/src/main.jsx"
    click App "https://github.com/ismouslih/my-portfolio/blob/main/src/App.jsx"
    click indexCSS "https://github.com/ismouslih/my-portfolio/blob/main/src/index.css"
    click D3 "https://github.com/ismouslih/my-portfolio/blob/main/vite.config.js"
    click D1 "https://github.com/ismouslih/my-portfolio/blob/main/eslint.config.js"
    click D2 "https://github.com/ismouslih/my-portfolio/blob/main/package.json"
    click NavBar "https://github.com/ismouslih/my-portfolio/blob/main/src/components/NavBar.jsx"
    click Hero "https://github.com/ismouslih/my-portfolio/blob/main/src/components/HeroSection.jsx"
    click About "https://github.com/ismouslih/my-portfolio/blob/main/src/components/AboutSection.jsx"
    click SkillsComp "https://github.com/ismouslih/my-portfolio/blob/main/src/components/SkillsSection.jsx"
    click ProjectsComp "https://github.com/ismouslih/my-portfolio/blob/main/src/components/ProjectsSection.jsx"
    click Contact "https://github.com/ismouslih/my-portfolio/blob/main/src/components/ContactSection.jsx"
    click ThemeToggle "https://github.com/ismouslih/my-portfolio/blob/main/src/components/ThemeTogggle.jsx"
    click CodeBg "https://github.com/ismouslih/my-portfolio/blob/main/src/components/CodeBackgrond.jsx"
    click Home "https://github.com/ismouslih/my-portfolio/blob/main/src/pages/Home.jsx"
    click Notfound "https://github.com/ismouslih/my-portfolio/blob/main/src/pages/Notfound.jsx"
    click SkillsData "https://github.com/ismouslih/my-portfolio/blob/main/src/lib/SkillsSet.js"
    click ProjectsData "https://github.com/ismouslih/my-portfolio/blob/main/src/lib/projectsSet.js"
    click Utils "https://github.com/ismouslih/my-portfolio/blob/main/src/lib/utils.js"

    %% Styles
    classDef devTools fill:#cce5ff,stroke:#3399ff,color:#003366;
    classDef code fill:#e6ffe6,stroke:#33cc33,color:#004d00;
    classDef deploy fill:#ffe6cc,stroke:#ff9933,color:#663300;
    classDef runtime fill:#f3e6ff,stroke:#b266ff,color:#33004d;
```
