# ouadjih/portfolio23 architecture

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

- Interactive diagram: https://gitdiagram.com/ouadjih/portfolio23
- Repository: https://github.com/ouadjih/portfolio23

## Overview

##### Project type and purpose
- Type: Single-Page Application (SPA) built with React.
- Purpose: A personal portfolio site that showcases projects, allows resume download, provides a contact form, links to social media, and (future) a “Learn with me” section.

##### File structure
- Top-level:
- package.json / package-lock.json → Node/React dependencies
- public/ → Static host folder (index.html, manifest.json, resume PDF)
- src/ → React source code
- src subfolders:
- src/components → Reusable UI components (Navbar, Hero, Form, Grid, Loader, Media, Succes)
- src/pages → Route-level pages (Home, Projects, Contact, Error, Layout)
- src/context → ThemeContext to manage theme state globally
- src/Assets → Images and data.js for static data
- src/App.js, index.js → App bootstrap and ReactDOM render

##### README for additional insights
- Features called out: Projects page, project details view, resume download, contact form, social media links, future learning page.

a. Main components
1. Client Browser
2. CDN / Static Host (e.g., Netlify, Vercel, GitHub Pages)
3. React SPA
– App Shell (App.js + index.html)
– Router & Layout (Layout.js + pages index.js)
– Pages (Home, Projects, Contact, Error)
– Shared Components (Navbar, Hero, Grid, Form, Loader, Media, Succes)
– Context Layer (ThemeContext)
– Assets Layer (Images, data.js, resume PDF)
4. External Services
– Email/Form service API (e.g., Formspree, SendGrid)
– Social Media Platforms (LinkedIn, GitHub, Twitter links)

b. Relationships & interactions
- User → Browser: Enters URL
- Browser → CDN/Host: GET index.html + static bundle
- CDN/Host → React SPA: Serve JS/CSS bundles, assets
- React Router: Maps paths to page components
- ThemeContext: Provides theme state to all components
- Form component → External service: POST form data
- Resume link → Direct download from public folder

c. Architectural patterns and design principles
- Component-based architecture (React)
- Single source of truth for theme (Context API)
- Static assets served via public folder (PWA manifest.json)
- Separation of concerns: UI components vs. page components vs. context

d. Key technologies/frameworks/libraries
- React.js for UI
- Context API for state management
- React Router (implied) for client-side routing
- Static hosting platform (CDN)
- Form submission service

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Client Layer
    Browser["User Browser"]:::client

    %% Hosting Layer
    subgraph "CDN / Static Host" 
        HostHTML["index.html"]:::host
        Manifest["manifest.json"]:::host
        ResumePDF["resume.pdf"]:::host
        StaticFiles["favicon & other static files"]:::host
    end

    %% React SPA Layer
    subgraph "React SPA" 
        direction TB

        subgraph "App Shell"
            IndexJS["src/index.js"]:::spa
            AppJS["src/App.js"]:::spa
        end

        subgraph "Router & Layout"
            LayoutJS["src/pages/Layout.js"]:::spa
            IndexPage["src/pages/index.js"]:::spa
        end

        subgraph "Pages"
            HomePage["Home.js"]:::spa
            ProjectsPage["Projects.js"]:::spa
            ContactPage["Contact.js"]:::spa
            ErrorPage["Error.js"]:::spa
        end

        subgraph "Shared UI Components"
            Navbar["Navbar.js"]:::spa
            Hero["Hero.js"]:::spa
            Grid["Grid.js"]:::spa
            FormComp["Form.js"]:::spa
            SuccessMsg["Succes.js"]:::spa
            MediaComp["Media.js"]:::spa
            LoaderComp["Loader.js"]:::spa
        end

        subgraph "Context Layer"
            ThemeContext["ThemeContext.js"]:::spa
        end

        subgraph "Assets Layer"
            DataJS["data.js"]:::spa
            ImagesDir["Images/"]:::spa
        end
    end

    %% External Services
    subgraph "External Integrations"
        FormService["Form Service API"]:::external
        SocialMedia["Social Media Platforms"]:::external
    end

    %% Relationships
    Browser -->|"GET index.html + assets"| HostHTML
    Browser -->|"Downloads JS/CSS bundle"| HostHTML
    HostHTML -->|"Serves bundle"| IndexJS
    IndexJS --> AppJS
    AppJS --> LayoutJS
    LayoutJS --> IndexPage
    LayoutJS --> HomePage
    LayoutJS --> ProjectsPage
    LayoutJS --> ContactPage
    LayoutJS --> ErrorPage
    LayoutJS --> Navbar
    LayoutJS --> Hero
    LayoutJS --> LoaderComp
    ThemeContext --> Navbar
    ThemeContext --> Hero
    ThemeContext --> Grid
    ThemeContext --> FormComp
    ThemeContext --> SuccessMsg
    ThemeContext --> MediaComp
    ThemeContext --> LoaderComp
    ProjectsPage --> Grid
    ContactPage --> FormComp
    FormComp -->|"POST form data"| FormService
    MediaComp -->|"External links"| SocialMedia
    ResumePDF -->|"Direct download link"| Browser
    IndexJS --> ThemeContext
    AppJS --> DataJS
    AppJS --> ImagesDir

    %% Click Events
    click IndexJS "https://github.com/ouadjih/portfolio23/blob/main/src/index.js"
    click AppJS "https://github.com/ouadjih/portfolio23/blob/main/src/App.js"
    click HostHTML "https://github.com/ouadjih/portfolio23/blob/main/public/index.html"
    click LayoutJS "https://github.com/ouadjih/portfolio23/blob/main/src/pages/Layout.js"
    click IndexPage "https://github.com/ouadjih/portfolio23/blob/main/src/pages/index.js"
    click HomePage "https://github.com/ouadjih/portfolio23/blob/main/src/pages/Home.js"
    click ProjectsPage "https://github.com/ouadjih/portfolio23/blob/main/src/pages/Projects.js"
    click ContactPage "https://github.com/ouadjih/portfolio23/blob/main/src/pages/Contact.js"
    click ErrorPage "https://github.com/ouadjih/portfolio23/blob/main/src/pages/Error.js"
    click Navbar "https://github.com/ouadjih/portfolio23/blob/main/src/components/Navbar.js"
    click Hero "https://github.com/ouadjih/portfolio23/blob/main/src/components/Hero.js"
    click Grid "https://github.com/ouadjih/portfolio23/blob/main/src/components/Grid.js"
    click FormComp "https://github.com/ouadjih/portfolio23/blob/main/src/components/Form.js"
    click SuccessMsg "https://github.com/ouadjih/portfolio23/blob/main/src/components/Succes.js"
    click MediaComp "https://github.com/ouadjih/portfolio23/blob/main/src/components/Media.js"
    click LoaderComp "https://github.com/ouadjih/portfolio23/blob/main/src/components/Loader.js"
    click ThemeContext "https://github.com/ouadjih/portfolio23/blob/main/src/context/ThemeContext.js"
    click DataJS "https://github.com/ouadjih/portfolio23/blob/main/src/Assets/data.js"
    click ImagesDir "https://github.com/ouadjih/portfolio23/tree/main/src/Assets/Images/"
    click ResumePDF "https://github.com/ouadjih/portfolio23/blob/main/public/ouadjihboudraa.pdf"
    click Manifest "https://github.com/ouadjih/portfolio23/blob/main/public/manifest.json"

    %% Styles
    classDef client fill:#D6EAF8,stroke:#1B4F72,color:#1B2631
    classDef host fill:#F9E79F,stroke:#7D6608,color:#4D2600
    classDef spa fill:#D5F5E3,stroke:#186A3B,color:#0B5345
    classDef external fill:#F5B7B1,stroke:#78281F,color:#641E16
```
