# devanshsahni/portfolio architecture

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

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

## Overview

##### Project type and purpose
- This is a front-end, single-page application (SPA) built with React.js.
- Purpose: Personal portfolio website showcasing skills, projects, resume, and animations.
- Hosted on Vercel as a static site, with client-side routing and dynamic components.

##### File structure
- Top-level files: package.json (npm scripts & dependencies), README.md, .gitignore.
- Public/: Static assets folder containing index.html (entry point) and images.
- src/: All application source code
- src/index.js: ReactDOM.render startup
- src/App.js: Root component & router setup
- src/Components/: Individual React components (Navbar, Home, About, Projects, Skills, Resume, Footer, etc.)
- src/LottieFiles/: JSON animation data for lottie-react
- src/images, src/Resume.pdf: Static media assets
- src/index.css: Global styles
- No separate backend or database—pure client-side.

##### Insights from README
- Uses Create-React-App (implied by file layout & npm scripts).
- Deployed via Vercel as a static site.

##### Main components
a. Client (User’s Browser)
b. CDN / Static Web Server (Vercel) serving index.html + bundles
c. React SPA
- Core: App.js + Router
- Sub-components: Navbar, Home, About, Skills, Projects, Resume, Footer, MoveToTop, Typed
- Assets: Lottie animations, images, resume PDF
d. Build Pipeline
- Developer’s local machine → Git repository → npm install → webpack/Babel (CRA) → build output (static assets)
e. Third-party services/libraries
- npm registry (for packages)
- Vercel (CI/CD & hosting)

##### Relationships and data flows
1. Developer commits code → pushes to GitHub.
2. Vercel pulls on push → runs npm install & npm run build → outputs static files.
3. Browser requests URL → served index.html + JS/CSS bundles from CDN.
4. React Router renders appropriate component (Home, About, etc.) without full page reload.
6. User interactions (clicks, scrolls) trigger component state changes and animations.

##### Architectural patterns & design principles
- Component-based architecture (each UI section is an isolated React component).
- SPA with client-side routing (fast navigation, no server-side page reload).
- Static site hosting (CDN for global performance).
- Build & deploy pipeline (CI/CD via Vercel).
- Separation of concerns: static assets vs. code vs. build config.

##### Final advice
- Every boundary where code or data changes hands (developer → repo → build system → hosting → client).
- Drill down into the React SPA by grouping related components.
- Dependencies on third-party libraries and static assets.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% External Entities
    Developer["Developer"]:::external
    GitHub["GitHub Repo"]:::external
    Vercel["Vercel CI/CD"]:::external
    CDN["CDN / Static Web Server"]:::external
    Browser["User Browser"]:::client

    %% Code Repository Layer
    subgraph "Code Repository"
        direction TB
        RepoConfig["package.json & package-lock.json"]:::config
        Readme["README.md"]:::config
        GitIgnore[".gitignore"]:::config
    end

    %% Build & Deploy Pipeline
    Developer -->|push code| GitHub
    GitHub -->|triggers build| Vercel
    Vercel -->|npm install & npm run build| BuildOutput["Build Output (static files)"]:::assets
    BuildOutput -->|deploy| CDN

    %% Runtime Layer
    Browser -->|HTTP GET URL| CDN
    CDN -->|serve index.html & bundles| Browser
    Browser -->|ReactDOM.render| SPA["React SPA"]:::client

    %% React SPA Components
    subgraph "React SPA" 
        direction TB
        App["App.js"]:::react
        Navbar["Navbar.js"]:::react
        Home["Home.js"]:::react
        About["About.js"]:::react
        Projects["Projects.js"]:::react
        ProjectBox["ProjectBox.js"]:::react
        Skills["Skills.js"]:::react
        ResumeComp["Resume.js"]:::react
        Footer["Footer.js"]:::react
        MoveToTop["MoveToTop.js"]:::react
        Typed["Typed.js"]:::react
        Lottie["LottieFiles"]:::assets
        Images["images"]:::assets
        ResumePDF["Resume.pdf"]:::assets
        Styles["index.css"]:::assets

        App -->|uses router| Navbar
        App -->|route: Home| Home
        App -->|route: About| About
        App -->|route: Projects| Projects
        Projects -->|renders| ProjectBox
        App -->|route: Skills| Skills
        App -->|route: Resume| ResumeComp
        App -->|layout| Footer
        App -->|utility| MoveToTop
        App -->|utility| Typed
        App -->|load animations| Lottie
        App -->|load images| Images
        App -->|load PDF| ResumePDF
        App -->|apply styles| Styles
    end

    %% Click Events
    click RepoConfig "https://github.com/devanshsahni/portfolio/blob/main/package.json"
    click Readme "https://github.com/devanshsahni/portfolio/blob/main/README.md"
    click GitIgnore "https://github.com/devanshsahni/portfolio/blob/main/.gitignore"
    click App "https://github.com/devanshsahni/portfolio/blob/main/src/App.js"
    click Navbar "https://github.com/devanshsahni/portfolio/blob/main/src/Components/Navbar.js"
    click Home "https://github.com/devanshsahni/portfolio/blob/main/src/Components/Home.js"
    click About "https://github.com/devanshsahni/portfolio/blob/main/src/Components/About.js"
    click Projects "https://github.com/devanshsahni/portfolio/blob/main/src/Components/Projects.js"
    click ProjectBox "https://github.com/devanshsahni/portfolio/blob/main/src/Components/ProjectBox.js"
    click Skills "https://github.com/devanshsahni/portfolio/blob/main/src/Components/Skills.js"
    click ResumeComp "https://github.com/devanshsahni/portfolio/blob/main/src/Components/Resume.js"
    click Footer "https://github.com/devanshsahni/portfolio/blob/main/src/Components/Footer.js"
    click MoveToTop "https://github.com/devanshsahni/portfolio/blob/main/src/Components/MoveToTop.js"
    click Typed "https://github.com/devanshsahni/portfolio/blob/main/src/Components/Typed.js"
    click Lottie "https://github.com/devanshsahni/portfolio/tree/main/src/LottieFiles/"
    click Images "https://github.com/devanshsahni/portfolio/tree/main/src/images/"
    click ResumePDF "https://github.com/devanshsahni/portfolio/blob/main/src/Resume.pdf"
    click Styles "https://github.com/devanshsahni/portfolio/blob/main/src/index.css"

    %% Styles
    classDef external fill:#8bd3dd,stroke:#333,stroke-width:1px
    classDef client fill:#f9bc60,stroke:#333,stroke-width:1px
    classDef react fill:#61dafb,stroke:#333,stroke-width:1px
    classDef assets fill:#d3d3d3,stroke:#333,stroke-width:1px
    classDef config fill:#cfe2f3,stroke:#333,stroke-width:1px
```
