# saurabhog/portfolio architecture

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

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

## Overview

##### Project Type and Purpose
- This is a single‐page portfolio website (JAMstack style) built with React/Vite, styled by Tailwind CSS, and backed by Supabase for data storage (portfolio items, certificates, comments).
- It’s not a microservices‐based backend—Supabase provides the database, auth, and storage as a service.

##### File Structure
- src/ → React application code
- main.jsx + index.html → entry points
- App.jsx → root component, routes to pages
- Pages/ → individual route components (Home, About, Contact, etc.)
- components/ → reusable UI pieces (Navbar, CardProject, InputField, Modal, LoadingScreen, etc.)
- supabase.js → Supabase client configuration
- public/ → static assets (Lottie animations, resume PDF, robots.txt, sitemap)
- config files → vite.config.js, tailwind.config.js, eslint.config.js, postcss.config.js
- vercel.json → deployment settings

##### README for Additional Insights
- Confirms tech stack: React, Tailwind, Supabase, AOS, Framer Motion, Material UI, SweetAlert2.
- Environment variables (VITE_SUPABASE_URL, VITE_SUPABASE_ANON_KEY) injected at build time.

##### Main Components
a. User’s Browser (Client)
b. CDN/Hosting Layer (Vercel or any static‐site host)
c. React Single‐Page Application
– App Routes (Pages folder)
– UI Components (components folder)
– Asset loading (public folder)
d. Supabase Backend
– Database (tables for portfolio, certificates, comments)
– Auth (optional user accounts)
– Storage (for files such as resume.pdf, images)
e. External Libraries & Services
– AOS, Framer Motion (animations)
– Lucide & Material UI (iconography, UI components)
– SweetAlert2 (modal dialogs)
f. CI/CD Pipeline (GitHub → Vercel)

##### Architectural Patterns & Design Principles
- SPA Pattern: one HTML shell, dynamic routing in client
- JAMstack: prebuilt assets served via CDN, API calls to backend‐as‐a‐service
- Component‐based UI: reusable, composable React components
- Separation of Concerns: presentation (React/Tailwind) vs. data (Supabase) vs. build (Vite)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client and Hosting
    Browser["User Browser"]:::frontend
    CDN["Vercel CDN / Static Hosting"]:::frontend

    %% React SPA
    subgraph "React Single‐Page Application" 
        direction TB
        EntryPoints["Entry Points"]:::frontend
        AppRoot["App.jsx (Root Component)"]:::frontend
        subgraph "Routing Layer (Pages)" 
            direction TB
            Page404["404.jsx"]:::frontend
            About["About.jsx"]:::frontend
            Contact["Contact.jsx"]:::frontend
            Home["Home.jsx"]:::frontend
            Portfolio["Portofolio.jsx"]:::frontend
            ThankYou["ThankYou.jsx"]:::frontend
            Welcome["WelcomeScreen.jsx"]:::frontend
        end
        subgraph "UI Components" 
            direction TB
            Background["Background.jsx"]:::frontend
            CardProject["CardProject.jsx"]:::frontend
            Certificate["Certificate.jsx"]:::frontend
            Commentar["Commentar.jsx"]:::frontend
            InputField["InputField.jsx"]:::frontend
            LoadingScreen["LoadingScreen.jsx"]:::frontend
            Modal["Modal.jsx"]:::frontend
            Navbar["Navbar.jsx"]:::frontend
            ProjectDetail["ProjectDetail.jsx"]:::frontend
            SocialLinks["SocialLinks.jsx"]:::frontend
            TechStackIcon["TechStackIcon.jsx"]:::frontend
            DiscordIcon["Discord.tsx"]:::frontend
        end
        SupabaseClient["supabase.js"]:::frontend
    end

    %% Supabase Backend
    subgraph "Supabase Backend (BaaS)" 
        direction TB
        Database["Database (Tables)"]:::backend
        Auth["Auth Service"]:::backend
        Storage["File Storage"]:::backend
    end

    %% External Libraries & CI/CD
    subgraph "External & CI/CD" 
        direction TB
        Libraries["AOS, Framer Motion, Lucide, Material UI, SweetAlert2"]:::external
        GitHub["GitHub Repo"]:::external
        VercelCI["Vercel Build & Deploy"]:::external
    end

    %% Static Assets
    StaticAssets["public/ (resume.pdf, robots.txt, sitemap.xml, Lottie.json, Coding.json, google verification)"]:::frontend

    %% Styling & Build Config
    Configs["vite.config.js, tailwind.config.js, postcss.config.js, eslint.config.js"]:::frontend

    %% Connections
    Browser -->|"HTTPS"| CDN
    CDN --> EntryPoints
    EntryPoints --> AppRoot
    AppRoot --> Page404
    AppRoot --> About
    AppRoot --> Contact
    AppRoot --> Home
    AppRoot --> Portfolio
    AppRoot --> ThankYou
    AppRoot --> Welcome
    Page404 --> Background
    About --> Background
    Contact --> Background
    Home --> Background
    Portfolio --> Background
    ThankYou --> Background
    Welcome --> Background
    Background --> CardProject
    CardProject --> ProjectDetail
    ProjectDetail --> Certificate
    ProjectDetail --> Commentar
    CardProject --> SocialLinks
    SocialLinks --> TechStackIcon
    TechStackIcon --> DiscordIcon
    AppRoot --> SupabaseClient
    SupabaseClient -->|REST / Realtime| Database
    SupabaseClient -->|REST| Auth
    SupabaseClient -->|Storage API| Storage
    StaticAssets -->|CDN Serve| CDN
    Configs -->|Build Time| EntryPoints
    GitHub -->|"push"| VercelCI
    VercelCI -->|deploy| CDN
    Libraries --> AppRoot

    %% Click Events
    click EntryPoints "https://github.com/saurabhog/portfolio/blob/main/src/main.jsx"
    click EntryPoints "https://github.com/saurabhog/portfolio/blob/main/index.html"
    click AppRoot "https://github.com/saurabhog/portfolio/blob/main/src/App.jsx"
    click Page404 "https://github.com/saurabhog/portfolio/blob/main/src/Pages/404.jsx"
    click About "https://github.com/saurabhog/portfolio/blob/main/src/Pages/About.jsx"
    click Contact "https://github.com/saurabhog/portfolio/blob/main/src/Pages/Contact.jsx"
    click Home "https://github.com/saurabhog/portfolio/blob/main/src/Pages/Home.jsx"
    click Portfolio "https://github.com/saurabhog/portfolio/blob/main/src/Pages/Portofolio.jsx"
    click ThankYou "https://github.com/saurabhog/portfolio/blob/main/src/Pages/ThankYou.jsx"
    click Welcome "https://github.com/saurabhog/portfolio/blob/main/src/Pages/WelcomeScreen.jsx"
    click Background "https://github.com/saurabhog/portfolio/blob/main/src/components/Background.jsx"
    click CardProject "https://github.com/saurabhog/portfolio/blob/main/src/components/CardProject.jsx"
    click Certificate "https://github.com/saurabhog/portfolio/blob/main/src/components/Certificate.jsx"
    click Commentar "https://github.com/saurabhog/portfolio/blob/main/src/components/Commentar.jsx"
    click InputField "https://github.com/saurabhog/portfolio/blob/main/src/components/InputField.jsx"
    click LoadingScreen "https://github.com/saurabhog/portfolio/blob/main/src/components/LoadingScreen.jsx"
    click Modal "https://github.com/saurabhog/portfolio/blob/main/src/components/Modal.jsx"
    click Navbar "https://github.com/saurabhog/portfolio/blob/main/src/components/Navbar.jsx"
    click ProjectDetail "https://github.com/saurabhog/portfolio/blob/main/src/components/ProjectDetail.jsx"
    click SocialLinks "https://github.com/saurabhog/portfolio/blob/main/src/components/SocialLinks.jsx"
    click TechStackIcon "https://github.com/saurabhog/portfolio/blob/main/src/components/TechStackIcon.jsx"
    click DiscordIcon "https://github.com/saurabhog/portfolio/blob/main/src/components/icons/Discord.tsx"
    click SupabaseClient "https://github.com/saurabhog/portfolio/blob/main/src/supabase.js"
    click StaticAssets "https://github.com/saurabhog/portfolio/tree/main/public/"
    click Configs "https://github.com/saurabhog/portfolio/blob/main/vite.config.js"
    click Configs "https://github.com/saurabhog/portfolio/blob/main/tailwind.config.js"
    click Configs "https://github.com/saurabhog/portfolio/blob/main/postcss.config.js"
    click Configs "https://github.com/saurabhog/portfolio/blob/main/eslint.config.js"
    click VercelCI "https://github.com/saurabhog/portfolio/blob/main/vercel.json"
    click VercelCI "https://github.com/saurabhog/portfolio/blob/main/package.json"
    click VercelCI "https://github.com/saurabhog/portfolio/blob/main/package-lock.json"

    %% Styles
    classDef frontend fill:#B3DFFF,stroke:#0366d6,stroke-width:1px
    classDef backend fill:#D4F8C4,stroke:#28a745,stroke-width:1px
    classDef external fill:#E2E2E2,stroke:#666666,stroke-width:1px
```
