# mittal-parth/personal-portfolio architecture

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

- Interactive diagram: https://gitdiagram.com/mittal-parth/personal-portfolio
- Repository: https://github.com/mittal-parth/personal-portfolio

## Overview

##### Main Components
- Frontend (Client Side):
- The core of the application resides under the "src" directory. This includes:
▪ React components (e.g., Hero, Skills & Experience, Projects, BlogPosts, etc.) that represent different sections of the portfolio.
▪ Assets and constants that manage personal information and images.
▪ Helper functions and additional style files.
- The entry point is "src/main.jsx" which bootstraps the entire React app.
- Static Files & HTML:
- "index.html" acts as the main HTML file loaded initially.
- The "public" directory contains any static assets needed by the app.
- Serverless Functions/Backend:
- The "netlify/functions" directory contains functions such as "fetchContributions.js" that are executed server-side on Netlify to fetch dynamic data (e.g., open source contributions from GitHub).
- Configuration & Deployment:
- Files like ".env.example", "netlify.toml", "tailwind.config.cjs", and "vite.config.js" indicate how the environment is set up. They also detail integration points with tools (e.g., environment variable management on Netlify).

##### Relationships and Interactions
- The User connects to the frontend, which is rendered by React.
- The React components interact with each other to display sections of the portfolio, pulling personal data from a constants file and assets.
- For dynamic content (like GitHub contributions), the React components communicate (via API calls) to serverless functions (running on Netlify), which in turn may access external APIs (GitHub).
- The environment variables (.env) configure sensitive data (like GitHub tokens) used by these serverless functions.

##### Architectural Patterns and Design Principles
- Single-Page Application (SPA) architecture driven by React, with clear separation between view components and data/configuration (maintained in the "constants" and "assets" directories).
- The use of serverless functions introduces a microservice-like approach for specific dynamic tasks (e.g., fetching contributions).
- Code modularity is evident with separation into reusable components, helper functions ("src/lib/helperFunctions.js"), and static resources.
- The project follows standard deployment practices for a modern web application, especially with integration to Netlify for hosting and continuous deployment.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% External User node
    U("User/Browser"):::user

    %% Frontend (React SPA)
    subgraph "Frontend (React SPA)"
        A("Main Entry (React)"):::frontend
        subgraph "Components"
            B("Hero Component"):::frontend
            C("Projects Component"):::frontend
            D("BlogPosts Component"):::frontend
        end
        E("Assets & Constants"):::frontend
        F("Helper Functions"):::frontend
    end

    %% Static Resources
    subgraph "Static Resources"
        G("index.html"):::static
        H("Public Directory"):::static
    end

    %% Serverless Functions (Netlify)
    subgraph "Serverless Functions (Netlify)"
        I("fetchContributions"):::serverless
    end

    %% Configuration & Deployment
    subgraph "Configuration & Deployment"
        J(".env.example"):::config
        K("netlify.toml"):::config
        L("vite.config.js"):::config
        M("tailwind.config.cjs"):::config
    end

    %% External Integration
    N("GitHub API"):::external

    %% Connections
    U -->|"loads"| A
    U -->|"accesses"| G
    U -->|"accesses"| H

    A -->|"calls"| I

    J ---|"configures"| A
    K ---|"deploy_config"| A
    L ---|"build_config"| A
    M ---|"style_config"| A

    J ---|"configures"| I
    K ---|"deploy_config"| I
    L ---|"build_config"| I
    M ---|"style_config"| I

    I -->|"fetches_from"| N

    %% Internal Frontend Connections
    A --> B
    A --> C
    A --> D
    A --> E
    A --> F

    %% Click Events
    click A "https://github.com/mittal-parth/personal-portfolio/blob/main/src/main.jsx"
    click B "https://github.com/mittal-parth/personal-portfolio/blob/main/src/components/Hero.jsx"
    click C "https://github.com/mittal-parth/personal-portfolio/blob/main/src/components/Projects.jsx"
    click D "https://github.com/mittal-parth/personal-portfolio/blob/main/src/components/BlogPosts.jsx"
    click G "https://github.com/mittal-parth/personal-portfolio/blob/main/index.html"
    click H "https://github.com/mittal-parth/personal-portfolio/tree/main/public"
    click I "https://github.com/mittal-parth/personal-portfolio/blob/main/netlify/functions/fetchContributions.js"
    click J "https://github.com/mittal-parth/personal-portfolio/blob/main/.env.example"
    click K "https://github.com/mittal-parth/personal-portfolio/blob/main/netlify.toml"
    click L "https://github.com/mittal-parth/personal-portfolio/blob/main/vite.config.js"
    click M "https://github.com/mittal-parth/personal-portfolio/blob/main/tailwind.config.cjs"

    %% Styles
    classDef user fill:#FFE0B2,stroke:#EF6C00,stroke-width:2px;
    classDef frontend fill:#BBDEFB,stroke:#0D47A1,stroke-width:2px;
    classDef serverless fill:#FFCDD2,stroke:#B71C1C,stroke-width:2px;
    classDef static fill:#C8E6C9,stroke:#1B5E20,stroke-width:2px;
    classDef config fill:#FFF9C4,stroke:#F57F17,stroke-width:2px;
    classDef external fill:#D1C4E9,stroke:#512DA8,stroke-width:2px;
```
