# mayur-dhavan/mayur-portfolio architecture

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

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

## Overview

##### Project type and purpose
- This is a personal portfolio website built in React, using Next.js for server-side rendering (SSR) and static site generation (SSG).
- It consists of a UI layer (React + React-Bootstrap + Animate.css + Tailwind), a static‐asset layer, and a lightweight API route for “contact” submissions.

##### File structure
- Top-level Next.js output: `.next/` (build artifacts, SSR runtime)
- Application source:
- `pages/` – Next.js pages for routing (e.g. `index.tsx`, `_app.tsx`, `_document.tsx`)
- `pages/api/` – serverless API endpoint (`contact.ts`)
- `public/` – static assets (PDF resumes, images, manifest, robots.txt)
- Legacy CRA code: `src/` with `App.js`, `index.js` etc. (likely leftover or used for local development)
- Config files: `next.config.js`, `netlify.toml`, `tsconfig.json`, Tailwind config, package-json variants.
- No database: only a serverless function that forwards data (e.g. to Mailchimp or an email service).

##### README for additional insights
- Bootstrapped with Create React App, but file structure indicates migration to Next.js.
- Hosted on Netlify (`netlify.toml` present).
- Uses React-Bootstrap, Animate.css, Tailwind.css for styling.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Browser and UI Layer
    Browser["User Browser"]:::frontend
    subgraph "UI Layer (Client)"
        Index["pages/index.tsx"]:::frontend
        App["_app.tsx"]:::frontend
        Document["_document.tsx"]:::frontend
        Components["src/components"]:::frontend
        TailwindCSS["styles/tailwind.css"]:::frontend
        LegacyGroup["Legacy CRA Code"]:::legacy
        MailchimpForm["src/components/MailchimpForm.js"]:::external
    end

    %% Next.js Server/Runtime
    subgraph "Next.js Server/Runtime"
        NextBuild[".next/"]:::server
        NextConfig["next.config.js"]:::server
        ServerJS["server.js"]:::server
    end
    NextServer["Next.js Server"]:::server

    %% Static Assets
    subgraph "Static Assets (CDN)"
        PublicAssets["public/assets/"]:::static
        PublicManifests["public/manifest.json,\npublic/robots.txt,\npublic/sitemap.xml,\npublic/webmanifest.json"]:::static
        NextStatic[".next/static/"]:::static
    end

    %% Serverless API
    API["pages/api/contact.ts\n(Serverless Function)"]:::api

    %% External Integration
    ExternalService["Mailchimp/Email Service"]:::external

    %% CI/CD & Hosting
    subgraph "CI/CD & Hosting"
        GitHub["GitHub"]:::ci
        Netlify["Netlify"]:::ci
        NetlifyToml["netlify.toml"]:::ci
        PackageJSON["package.json,\npackage-nextjs.json,\npackage-react.json"]:::ci
    end

    %% Styling Configurations
    subgraph "Config Files"
        TailwindConfig["tailwind.config.js"]:::config
        PostCSS["postcss.config.js"]:::config
        NextEnv["next-env.d.ts"]:::config
        TSConfig["tsconfig.json"]:::config
    end

    %% Legacy CRA components
    subgraph "Legacy CRA Code"
        CRA_App["src/App.js"]:::legacy
        CRA_Index["src/index.js"]:::legacy
        CRA_CSS["src/App.css"]:::legacy
        CRA_Assets["src/assets/"]:::legacy
        CRA_Components["src/components (legacy)"]:::legacy
    end

    %% Connections: User flow
    Browser -->|"requests page"| NextServer
    NextServer -->|"SSG/SSR render"| NextBuild
    NextServer -->|"uses config"| NextConfig
    NextServer -->|"runtime"| ServerJS
    NextServer --> StaticAssets
    StaticAssets -->|"serves assets"| Browser
    NextServer -->|"delivers HTML+JS"| Browser
    Browser -->|"POST /api/contact"| API
    API -->|"forwards data"| ExternalService

    %% CI/CD flow
    GitHub -->|"push"| Netlify
    Netlify -->|"build & deploy"| NextBuild
    Netlify --> StaticAssets
    Netlify --> API

    %% Click Events
    click Index "https://github.com/mayur-dhavan/mayur-portfolio/blob/master/pages/index.tsx"
    click App "https://github.com/mayur-dhavan/mayur-portfolio/blob/master/pages/_app.tsx"
    click Document "https://github.com/mayur-dhavan/mayur-portfolio/blob/master/pages/_document.tsx"
    click Components "https://github.com/mayur-dhavan/mayur-portfolio/tree/master/src/components"
    click TailwindCSS "https://github.com/mayur-dhavan/mayur-portfolio/blob/master/styles/tailwind.css"
    click MailchimpForm "https://github.com/mayur-dhavan/mayur-portfolio/blob/master/src/components/MailchimpForm.js"
    click NextBuild "https://github.com/mayur-dhavan/mayur-portfolio/tree/master/.next/"
    click NextConfig "https://github.com/mayur-dhavan/mayur-portfolio/blob/master/next.config.js"
    click ServerJS "https://github.com/mayur-dhavan/mayur-portfolio/blob/master/server.js"
    click PublicAssets "https://github.com/mayur-dhavan/mayur-portfolio/tree/master/public/assets/"
    click PublicManifests "https://github.com/mayur-dhavan/mayur-portfolio/blob/master/public/manifest.json"
    click NextStatic "https://github.com/mayur-dhavan/mayur-portfolio/tree/master/.next/static/"
    click API "https://github.com/mayur-dhavan/mayur-portfolio/blob/master/pages/api/contact.ts"
    click CRA_App "https://github.com/mayur-dhavan/mayur-portfolio/blob/master/src/App.js"
    click CRA_Index "https://github.com/mayur-dhavan/mayur-portfolio/blob/master/src/index.js"
    click CRA_CSS "https://github.com/mayur-dhavan/mayur-portfolio/blob/master/src/App.css"
    click CRA_Assets "https://github.com/mayur-dhavan/mayur-portfolio/tree/master/src/assets/"
    click CRA_Components "https://github.com/mayur-dhavan/mayur-portfolio/tree/master/src/components"
    click NetlifyToml "https://github.com/mayur-dhavan/mayur-portfolio/blob/master/netlify.toml"
    click PackageJSON "https://github.com/mayur-dhavan/mayur-portfolio/blob/master/package.json"
    click TailwindConfig "https://github.com/mayur-dhavan/mayur-portfolio/blob/master/tailwind.config.js"
    click PostCSS "https://github.com/mayur-dhavan/mayur-portfolio/blob/master/postcss.config.js"
    click NextEnv "https://github.com/mayur-dhavan/mayur-portfolio/blob/master/next-env.d.ts"
    click TSConfig "https://github.com/mayur-dhavan/mayur-portfolio/blob/master/tsconfig.json"

    %% Styles
    classDef frontend fill:#f9f,stroke:#333,stroke-width:1px
    classDef server fill:#bbf,stroke:#333,stroke-width:1px
    classDef static fill:#bfb,stroke:#333,stroke-width:1px
    classDef api fill:#fbb,stroke:#333,stroke-width:1px
    classDef external fill:#ffb,stroke:#333,stroke-width:1px
    classDef ci fill:#fcf,stroke:#333,stroke-width:1px
    classDef config fill:#cff,stroke:#333,stroke-width:1px
    classDef legacy fill:#ddd,stroke:#333,stroke-width:1px
```
