# mushtaq96/portfolio-react-app architecture

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

- Interactive diagram: https://gitdiagram.com/mushtaq96/portfolio-react-app
- Repository: https://github.com/mushtaq96/portfolio-react-app

## Overview

##### Project Type and Purpose
- This is a static, single‐page personal portfolio website built with React (front-end only) and styled using Tailwind CSS.
- There is no custom back end or database—everything is hosted as static assets on GitHub Pages, with a GitHub Actions workflow automating the build and deploy.

##### File Structure Analysis
- Top level:
- `.github/workflows/deploy-to-github-pages.yml` → CI/CD pipeline definition
- `public/` → static HTML and meta files (index.html, manifest.json, robots.txt)
- `src/` → React source code with components, assets, CSS, and entry point
- `tailwind.config.js`, `postcss.config.js` → build tooling for Tailwind
- `package.json` → project dependencies and scripts
- Patterns:
- “public” vs. “src” separation (static hosting + SPA structure)
- Component-based directory under `src/components` (React UI)
- `src/assets/projects` for project imagery

##### README Insights
- Uses Yarn for package management
- Development (`yarn start`) vs. production build (`yarn build`)
- Deploys to GitHub Pages via `peaceiris/actions-gh-pages` in GitHub Actions

##### Main Components
a. Developer / Local Machine
- Node.js & Yarn
- Local React dev server (localhost:3000)
b. Version Control & CI/CD
- GitHub repository
- `.github/workflows/deploy-to-github-pages.yml`
- GitHub Actions runner (ubuntu-latest)
- Steps: checkout, setup-node, yarn install, yarn build, deploy via GH Pages action
c. Build Artifacts
- `build/` folder (bundled JS/CSS, hashed filenames, minified assets)
d. Hosting & CDN
- GitHub Pages static site
- `index.html`, JS bundle, CSS, image assets served over HTTPS
e. Client (User’s Browser)
- Requests static files
- Loads React SPA, renders components (Navbar, Home, About, Skills, Work, Contact)

##### Relationships & Data Flow
- Developer pushes to `main` → triggers GitHub Actions
- CI fetches source, builds assets (Tailwind & React build pipeline) → produces `build/`
- CI pushes `build/` to GitHub Pages branch → hosted at `username.github.io/repo`
- End user’s browser fetches `index.html` → React SPA loads JS bundle → user interacts with components, asset requests

##### Architectural Patterns & Principles
- Single‐Page Application (SPA)
- Component‐based UI (React)
- Utility‐first CSS (Tailwind)
- GitOps style CI/CD (push-based deployment)
- Separation of concerns: “public” vs. “src”, build vs. runtime

##### Technologies & Frameworks to Call Out
- React (UI library)
- Tailwind CSS (styling)
- PostCSS (CSS processing)
- Yarn & Node.js (dependency management & build)
- GitHub Actions & peaceiris/actions-gh-pages (CI/CD & deployment)
- GitHub Pages (static hosting)

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Developer / Local Environment
    subgraph "Developer / Local Machine"
        direction TB
        NodeYarn["Node.js & Yarn"]:::dev
        ReactServer["React Dev Server<br/>(localhost:3000)"]:::dev
        subgraph "Source Code (src & public)"
            direction TB
            Entry["src/index.js"]:::dev
            click Entry "https://github.com/mushtaq96/portfolio-react-app/blob/main/src/index.js"
            GlobalCSS["src/index.css"]:::dev
            click GlobalCSS "https://github.com/mushtaq96/portfolio-react-app/blob/main/src/index.css"
            App["src/App.js"]:::dev
            click App "https://github.com/mushtaq96/portfolio-react-app/blob/main/src/App.js"
            subgraph "UI Components"
                direction TB
                Navbar["Navbar.jsx"]:::dev
                click Navbar "https://github.com/mushtaq96/portfolio-react-app/blob/main/src/components/Navbar.jsx"
                Home["Home.jsx"]:::dev
                click Home "https://github.com/mushtaq96/portfolio-react-app/blob/main/src/components/Home.jsx"
                About["About.jsx"]:::dev
                click About "https://github.com/mushtaq96/portfolio-react-app/blob/main/src/components/About.jsx"
                Skills["Skills.jsx"]:::dev
                click Skills "https://github.com/mushtaq96/portfolio-react-app/blob/main/src/components/Skills.jsx"
                Work["Work.jsx"]:::dev
                click Work "https://github.com/mushtaq96/portfolio-react-app/blob/main/src/components/Work.jsx"
                Contact["Contact.jsx"]:::dev
                click Contact "https://github.com/mushtaq96/portfolio-react-app/blob/main/src/components/Contact.jsx"
            end
            Assets["Project Imagery"]:::dev
            click Assets "https://github.com/mushtaq96/portfolio-react-app/tree/main/src/assets/projects"
            IndexHTML["public/index.html"]:::dev
            click IndexHTML "https://github.com/mushtaq96/portfolio-react-app/blob/main/public/index.html"
            Manifest["public/manifest.json"]:::dev
            click Manifest "https://github.com/mushtaq96/portfolio-react-app/blob/main/public/manifest.json"
            Robots["public/robots.txt"]:::dev
            click Robots "https://github.com/mushtaq96/portfolio-react-app/blob/main/public/robots.txt"
        end
        TailwindConfig["tailwind.config.js"]:::dev
        click TailwindConfig "https://github.com/mushtaq96/portfolio-react-app/blob/main/tailwind.config.js"
        PostCSSConfig["postcss.config.js"]:::dev
        click PostCSSConfig "https://github.com/mushtaq96/portfolio-react-app/blob/main/postcss.config.js"
        PackageJSON["package.json"]:::dev
        click PackageJSON "https://github.com/mushtaq96/portfolio-react-app/blob/main/package.json"
    end

    %% CI/CD Pipeline
    subgraph "CI/CD Pipeline"
        direction TB
        Repo["GitHub Repository"]:::ci
        Workflow["Workflow Definition"]:::ci
        click Workflow "https://github.com/mushtaq96/portfolio-react-app/blob/main/.github/workflows/deploy-to-github-pages.yml"
        Runner["Actions Runner<br/>(ubuntu-latest)"]:::ci
        Checkout["Checkout Code"]:::ci
        SetupNode["Setup Node.js"]:::ci
        YarnInstall["Yarn Install"]:::ci
        Build["Yarn Build"]:::ci
        Deploy["Deploy to GitHub Pages"]:::ci
    end

    %% Hosting Layer
    subgraph "Hosting & CDN"
        direction TB
        Artifacts["[( build/ )]<br/>Built Assets"]:::host
        Pages["GitHub Pages<br/>(username.github.io/repo)"]:::host
    end

    %% Client / User Browser
    subgraph "Client / Browser"
        direction TB
        Browser["User’s Browser"]:::client
    end

    %% Connections
    NodeYarn --> ReactServer
    ReactServer --> Entry
    ReactServer --> GlobalCSS
    ReactServer --> App

    NodeYarn --> PackageJSON
    NodeYarn --> TailwindConfig
    NodeYarn --> PostCSSConfig

    Entry --> Repo
    PackageJSON --> Repo

    Repo -->|push to main| Workflow
    Workflow --> Runner
    Runner --> Checkout
    Checkout --> SetupNode
    SetupNode --> YarnInstall
    YarnInstall --> Build
    Build --> Artifacts
    Artifacts --> Deploy
    Deploy --> Pages

    Browser -->|requests index.html| Pages
    Pages -->|serves static assets| Artifacts
    Browser -->|loads SPA| Artifacts
    Browser -->|renders components| App

    %% Click Events for CI/CD files have been added above

    %% Styles
    classDef dev fill:#e0f2fe,stroke:#0284c7,color:#0369a1,stroke-width:1px
    classDef ci fill:#dcfce7,stroke:#16a34a,color:#166534,stroke-width:1px
    classDef host fill:#ede9fe,stroke:#7c3aed,color:#5b21b6,stroke-width:1px
    classDef client fill:#ffedd5,stroke:#f97316,color:#c2410c,stroke-width:1px
```
