# yamaniyassine/portfolio architecture

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

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

## Overview

##### Project type and purpose
- This is a single-page portfolio application built with React (no backend services).
- Its purpose is to showcase personal projects, skills, and contact information in a responsive, themable SPA.

##### File structure
- Top level:
- package.json / package-lock.json → npm project, React dependencies, build scripts
- public/ → static assets served at runtime (index.html, PDFs, manifest.json, robots.txt)
- src/ → React source code
- src/components/ → presentational and UI-logic components (Navbar, Hero, About, Projects, Skills, Contact, Footer, Darkmodeswitch, ScrollToTop)
- src/contexts/ → ThemeContext for dark/light mode across the app
- src/App.js → root component that ties together Context provider and page structure
- src/index.js → ReactDOM entry point, injects App into public/index.html

##### README
- Minimal: “npm start” to launch the development server.
- No backend or external APIs are defined—this is purely client-side.

a. Main components
- Client Browser (user agent)
- Development/build environment (npm start / webpack dev server)
- Static asset server (serves public/)
- React Application
– Entry point: index.html + index.js
– Context layer: ThemeContext.Provider
– UI Components: Navbar, Hero, About, Projects, Skills, Contact, Footer, DarkModeSwitch, ScrollToTop
- Assets and configuration: CSS files, PDFs, manifest.json, robots.txt
b. Relationships & interactions
- Browser requests index.html → Dev server / static server → React bundle + assets
- index.js mounts App into DOM
- App wraps child components in ThemeContext.Provider
- DarkModeSwitch dispatches theme changes through Context → all components consume theme
- ScrollToTop listens to route/scroll events → programmatic scroll
- User interactions (clicks, navigation) flow from UI Components → React state/Context
c. Architectural patterns
- Component-based decomposition (each view section is its own component)
- Context API for cross-cutting concerns (theme management)
- Static asset hosting for PDFs and manifest (PWA readiness)
d. Key technologies
- React, ReactDOM
- Context API
- Create-React-App toolchain (webpack, Babel)
- CSS modules / global CSS (App.css, index.css, component-specific CSS)

##### Elements
- HTTP request from Browser to Server
- Module imports and Context data flow
- User event flows (e.g., click → state update → re-render)
- Entry points (index.html/index.js)
- Context/provider layer
- UI components
- Static assets

##### Detailed guidance
- “index.js” mounting “App” in the DOM.
- Under that, group all UI components (Navbar, Hero, About, Projects, Skills, Contact, Footer, DarkModeSwitch, ScrollToTop).

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Top-level
    Browser["Browser"]:::browser
    Server["Dev Server / Static Server"]:::server

    Browser -->|HTTP Request| Server
    Server --> indexHTML
    indexHTML --> bundle
    bundle --> indexJS
    indexJS -->|mounts App| App

    %% Entry Points
    indexHTML["public/index.html"]:::entrypoint
    indexJS["src/index.js"]:::entrypoint

    %% Application Shell
    subgraph "Application Shell"
        App["App Component"]:::component
        AppCSS["App Styles"]:::asset
    end
    indexJS --> App
    AppCSS --> App

    %% Global Styles
    indexCSS["Global Styles"]:::asset
    indexCSS --> indexJS

    %% Context Layer
    ThemeContext["ThemeContext Provider"]:::context
    App --> ThemeContext

    %% UI Components
    subgraph "UI Components"
        Navbar["Navbar"]:::component
        Hero["Hero"]:::component
        About["About Section"]:::component
        Projects["Projects Section"]:::component
        Skills["Skills Section"]:::component
        Contact["Contact Section"]:::component
        Footer["Footer"]:::component
        DarkModeLogic["Dark Mode Logic"]:::component
        DarkModeStyles["Dark Mode Styles"]:::asset
        ScrollToTop["ScrollToTop Utility"]:::component
    end
    ThemeContext -->|provides theme| Navbar
    ThemeContext --> Hero
    ThemeContext --> About
    ThemeContext --> Projects
    ThemeContext --> Skills
    ThemeContext --> Contact
    ThemeContext --> Footer
    App --> ScrollToTop
    DarkModeLogic -->|theme toggle| ThemeContext
    DarkModeStyles --> DarkModeLogic

    %% Static Asset Store
    subgraph "Static Assets"
        PDFs["PDFs"]:::asset
        Manifest["manifest.json"]:::asset
        Robots["robots.txt"]:::asset
        AssetsDir["Assets Directory"]:::asset
    end
    Server --> PDFs
    Server --> Manifest
    Server --> Robots
    Server --> AssetsDir
    AssetsDir --> Hero
    AssetsDir --> About

    %% Config
    Config["package.json / package-lock.json"]:::asset
    Server --> Config

    %% Click Events
    click indexHTML "https://github.com/yamaniyassine/portfolio/blob/main/public/index.html"
    click indexJS "https://github.com/yamaniyassine/portfolio/blob/main/src/index.js"
    click App "https://github.com/yamaniyassine/portfolio/blob/main/src/App.js"
    click AppCSS "https://github.com/yamaniyassine/portfolio/blob/main/src/App.css"
    click indexCSS "https://github.com/yamaniyassine/portfolio/blob/main/src/index.css"
    click ThemeContext "https://github.com/yamaniyassine/portfolio/blob/main/src/contexts/ThemeContext.js"
    click Navbar "https://github.com/yamaniyassine/portfolio/blob/main/src/components/Navbar.js"
    click Hero "https://github.com/yamaniyassine/portfolio/blob/main/src/components/Hero.js"
    click About "https://github.com/yamaniyassine/portfolio/blob/main/src/components/About.js"
    click Projects "https://github.com/yamaniyassine/portfolio/blob/main/src/components/Projects.js"
    click Skills "https://github.com/yamaniyassine/portfolio/blob/main/src/components/Skills.js"
    click Contact "https://github.com/yamaniyassine/portfolio/blob/main/src/components/Contact.js"
    click Footer "https://github.com/yamaniyassine/portfolio/blob/main/src/components/Footer.js"
    click DarkModeLogic "https://github.com/yamaniyassine/portfolio/blob/main/src/components/Darkmodeswitch/CustomToggleSwitch.js"
    click DarkModeStyles "https://github.com/yamaniyassine/portfolio/blob/main/src/components/Darkmodeswitch/CustomToggleSwitch.css"
    click ScrollToTop "https://github.com/yamaniyassine/portfolio/blob/main/src/components/ScrollToTop.js"
    click AssetsDir "https://github.com/yamaniyassine/portfolio/tree/main/src/assets"
    click Config "https://github.com/yamaniyassine/portfolio/blob/main/package.json"

    %% Styles
    classDef browser fill:#FFD580,stroke:#333,stroke-width:1px
    classDef server fill:#B0E0E6,stroke:#333,stroke-width:1px
    classDef entrypoint fill:#98FB98,stroke:#333,stroke-width:1px
    classDef component fill:#FFB6C1,stroke:#333,stroke-width:1px
    classDef context fill:#E6E6FA,stroke:#333,stroke-width:1px
    classDef asset fill:#FFFACD,stroke:#333,stroke-width:1px
```
