# saadpasta/developerfolio architecture

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

- Interactive diagram: https://gitdiagram.com/saadpasta/developerfolio
- Repository: https://github.com/saadpasta/developerfolio

## Overview

##### Project Type and Purpose
- This is a single-page, front-end React application (built with Create React App) that serves as a developer portfolio template.
- It fetches data from external APIs (GitHub GraphQL, Medium RSS, Twitter embed) and renders it using React components and Lottie animations.

##### File Structure
- Top level:
- Dockerfile, .github/workflows/deploy.yml (CI/CD), env.example (.env schema)
- public/ (static HTML, manifest, robots.txt)
- src/ (React code)
- Inside src/:
- App.js, index.js, serviceWorker.js (bootstrap and PWA)
- components/ (presentational, reusable UI bits)
- containers/ (pages or feature sections)
- contexts/ (React Context for theming/styling)
- hooks/ (custom hooks, e.g. useLocalStorage)
- utils.js and fetch.js (API wrappers)
- portfolio.js (configuration data)

##### Insights from README
- Purpose: A highly configurable, responsive portfolio template.
- Key features:
- Customizable via src/portfolio.js and SCSS variables
- Data driven sections (GitHub repos, Medium blogs, Twitter timeline)
- Docker support and GitHub Actions–based auto-deploy

##### Detail and Coverage
- Every essential element: containers, components, context, hooks, service worker, build, deploy, hosting, and external services
- Avoid over-splitting; group related files under logical modules (e.g., “Components” vs. listing each card component)

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% User and Browser
    User["User"]:::external -->|interacts with| Browser["Browser"]:::external
    Browser -->|loads| ReactApp["React App (SPA)"]:::ui

    %% UI Layer
    subgraph "UI Layer"
        direction TB
        Containers["Container Layer"]:::ui
        Components["Presentation Layer"]:::ui
        Contexts["Theming/Context Layer"]:::ui
        Hooks["Custom Hooks"]:::ui
    end

    ReactApp --> Containers
    ReactApp --> Components
    ReactApp --> Contexts
    ReactApp --> Hooks

    %% Container Details
    subgraph "Containers"
        direction TB
        Main["Main Layout"]:::ui
        Blogs["Blogs Section"]:::ui
        Projects["Projects Section"]:::ui
        TwitterEmbed["Twitter Embed Section"]:::ui
    end
    Containers --> Main
    Containers --> Blogs
    Containers --> Projects
    Containers --> TwitterEmbed

    %% Components Details
    subgraph "Components"
        direction TB
        ToggleSwitch["Toggle Switch"]:::ui
        BlogCard["Blog Card"]:::ui
        RepoCard["GitHub Repo Card"]:::ui
        OtherComponents["Other UI Components"]:::ui
    end
    Components --> ToggleSwitch
    Components --> BlogCard
    Components --> RepoCard
    Components --> OtherComponents

    %% Contexts and Hooks
    Contexts --> StyleContext["StyleContext"]:::ui
    Hooks --> UseLocalStorage["useLocalStorage"]:::ui

    %% Data & Services Layer
    subgraph "Data Layer"
        direction TB
        APIWrappers["API Service Wrappers"]:::data
        Utils["General Helpers"]:::data
        PortfolioConfig["portfolio.js"]:::data
        ServiceWorker["serviceWorker.js"]:::data
        Assets["Static Assets & Lottie"]:::data
        PublicFiles["Public Static Files"]:::data
        subgraph "External APIs"
            direction TB
            GitHubAPI["GitHub GraphQL API"]:::data
            MediumRSS["Medium RSS Feed"]:::data
            TwitterAPI["Twitter Embed"]:::data
        end
    end

    ReactApp --> APIWrappers
    ReactApp --> Utils
    ReactApp --> PortfolioConfig
    ReactApp --> ServiceWorker
    ReactApp --> Assets
    ReactApp --> PublicFiles

    APIWrappers --> GitHubAPI
    APIWrappers --> MediumRSS
    APIWrappers --> TwitterAPI

    %% Build & Deployment
    subgraph "Build & Deploy"
        direction TB
        Docker["Dockerfile"]:::build
        CI["GitHub Actions (deploy.yml)"]:::build
        Hosting["Static Hosting"]:::build
    end

    ReactApp -->|npm run build| Docker
    Docker --> Hosting
    CI --> Hosting

    %% Click Events
    click ReactApp "https://github.com/saadpasta/developerfolio/blob/master/src/App.js"
    click Browser "https://github.com/saadpasta/developerfolio/blob/master/src/index.js"
    click Components "https://github.com/saadpasta/developerfolio/tree/master/src/components/"
    click ToggleSwitch "https://github.com/saadpasta/developerfolio/blob/master/src/components/ToggleSwitch/ToggleSwitch.js"
    click BlogCard "https://github.com/saadpasta/developerfolio/blob/master/src/components/blogCard/BlogCard.js"
    click RepoCard "https://github.com/saadpasta/developerfolio/blob/master/src/components/githubRepoCard/GithubRepoCard.js"
    click OtherComponents "https://github.com/saadpasta/developerfolio/tree/master/src/components/"
    click Containers "https://github.com/saadpasta/developerfolio/tree/master/src/containers/"
    click Main "https://github.com/saadpasta/developerfolio/blob/master/src/containers/Main.js"
    click Blogs "https://github.com/saadpasta/developerfolio/blob/master/src/containers/blogs/Blogs.js"
    click Projects "https://github.com/saadpasta/developerfolio/blob/master/src/containers/projects/Projects.js"
    click TwitterEmbed "https://github.com/saadpasta/developerfolio/blob/master/src/containers/twitter-embed/twitter.js"
    click StyleContext "https://github.com/saadpasta/developerfolio/blob/master/src/contexts/StyleContext.js"
    click UseLocalStorage "https://github.com/saadpasta/developerfolio/blob/master/src/hooks/useLocalStorage.js"
    click APIWrappers "https://github.com/saadpasta/developerfolio/blob/master/fetch.js"
    click Utils "https://github.com/saadpasta/developerfolio/blob/master/src/utils.js"
    click PortfolioConfig "https://github.com/saadpasta/developerfolio/blob/master/src/portfolio.js"
    click ServiceWorker "https://github.com/saadpasta/developerfolio/blob/master/src/serviceWorker.js"
    click Assets "https://github.com/saadpasta/developerfolio/tree/master/src/assets/"
    click PublicFiles "https://github.com/saadpasta/developerfolio/blob/master/public/index.html"
    click PublicFiles "https://github.com/saadpasta/developerfolio/blob/master/public/manifest.json"
    click PublicFiles "https://github.com/saadpasta/developerfolio/blob/master/public/robots.txt"
    click Docker "https://github.com/saadpasta/developerfolio/tree/master/Dockerfile"
    click CI "https://github.com/saadpasta/developerfolio/blob/master/.github/workflows/deploy.yml"

    %% Styles
    classDef ui fill:#D0E8FF,stroke:#333,stroke-width:1px
    classDef data fill:#D0FFD6,stroke:#333,stroke-width:1px
    classDef build fill:#FFE8C2,stroke:#333,stroke-width:1px
    classDef external fill:#F0F0F0,stroke:#333,stroke-width:1px
```
