# tomervivek/portfolio architecture

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

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

## Overview

##### Project type and purpose
- This is a Next.js–based React application that serves as a personal portfolio site.
- It uses file-based routing for pages under `pages/`, React components under `components/`, Tailwind CSS for styling, and includes a simple serverless API endpoint (`pages/api/hello.js`).
- It can be deployed as a static site with SSR/SSG support or on a serverless platform such as Vercel.

##### File structure
Top-level directories and files:
- pages/ – Next.js page files and API routes
- components/ – reusable React UI components (Header, Footer, Banner, etc.)
- public/ – static assets (PDF, images)
- styles/ – global CSS and CSS modules (Tailwind and custom animations)
- next.config.js, tailwind.config.js, postcss.config.js – build and styling configuration
- package.json/package-lock.json – dependencies and scripts

Architectural patterns revealed:
- File-based routing (pages map 1:1 to URLs)
- Component-based UI structure
- API routes living alongside pages for serverless functions
- Static asset hosting via `public/`
- Tailwind + CSS modules for styling

##### README for additional insights
- Confirms use of Create-Next-App bootstrap.
- Highlights development workflow (`npm run dev`) and automatic hot reload.
- Mentions API routes and next/font optimization for Google Fonts.
- Suggests deployment on Vercel (serverless hosting, CDN).

##### Main components and their relationships
a. Client (Browser) – initiates HTTP requests for pages, API calls, and static assets
b. Next.js Server or Serverless Platform
– SSR/SSG engine that:
· Renders React pages on the server (if configured)
· Serves pre-built static pages
· Runs API endpoint code (`pages/api/*.js`)
c. React Component Tree
– `pages/index.js` composes UI by importing `components/*`
d. Styling Engine
– Tailwind CSS + CSS modules applied at build time
e. Static Asset Store (public/)
– PDF, images, fonts served directly via CDN or static server
f. External Services
– Google Fonts (via next/font)
– Vercel CDN for global distribution (optional)

##### Architectural patterns and design principles
- Componentization: break UI into reusable components (Banner, Skills, Projects).
- File-based routing: conventions over configuration for frontend and backend routes.
- Serverless functions: API routes abstracted as serverless endpoints.
- Static + dynamic hybrid: leverage SSG for speed and SSR for dynamic data (if needed).
- Utility-first CSS: Tailwind for rapid styling and minimal CSS bundle size.

- Container boundaries illustrating runtime environments (Client vs. Server/Serverless).
- Callouts for configuration files that influence the build/deploy process.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Layers
    subgraph "Client (Browser)" 
        direction TB
        Client["Client (Browser)"]:::frontend
    end

    subgraph "Next.js Server / Serverless" 
        direction TB
        subgraph "Page Renderer (SSR/SSG)" 
            direction TB
            IDX["pages/index.js"]:::frontend
            APP["pages/_app.js"]:::frontend
            DOC["pages/_document.js"]:::frontend
            subgraph "React Components" 
                direction TB
                Header["Header.js"]:::frontend
                Banner["Banner.js"]:::frontend
                Skills["Skills.js"]:::frontend
                SkillComp["SkillComponent.js"]:::frontend
                Projects["Projects.js"]:::frontend
                Experience["Experience.js"]:::frontend
                Education["Education.js"]:::frontend
                EduCard["EducationCard.js"]:::frontend
                GridPattern["GridPattern.js"]:::frontend
            end
            subgraph "Styling Engine" 
                direction TB
                GlobalsCSS["globals.css"]:::styling
                CircleAnim["CircleAnimation.module.css"]:::styling
                TailwindConfig["tailwind.config.js"]:::styling
                PostCSSConfig["postcss.config.js"]:::styling
            end
        end
        subgraph "API Routes (Serverless Functions)" 
            direction TB
            HelloAPI["pages/api/hello.js"]:::api
        end
    end

    subgraph "Static Asset Store (public/)" 
        direction TB
        Resume["Vivek-resume.pdf"]:::assets
        SkillsAssets["public/skills/"]:::assets
    end

    subgraph "External Services" 
        direction TB
        GoogleFonts["Google Fonts"]:::external
        VercelCDN["Vercel CDN"]:::external
    end

    %% Connections
    Client -->|"HTTP GET /"| IDX
    IDX -->|"Renders HTML + JS bundle"| Client
    Client -->|"API Call /api/hello"| HelloAPI
    HelloAPI -->|"JSON Response"| Client
    Client -->|"GET static assets"| Resume
    Client -->|"GET static assets"| SkillsAssets
    IDX -->|"fetch fonts"| GoogleFonts
    Client -->|"font fetch"| GoogleFonts
    GoogleFonts -->|"CDN"| VercelCDN
    Client -->|"assets via CDN"| VercelCDN

    %% Click Events
    click IDX "https://github.com/tomervivek/portfolio/blob/main/pages/index.js"
    click APP "https://github.com/tomervivek/portfolio/blob/main/pages/_app.js"
    click DOC "https://github.com/tomervivek/portfolio/blob/main/pages/_document.js"
    click HelloAPI "https://github.com/tomervivek/portfolio/blob/main/pages/api/hello.js"
    click Header "https://github.com/tomervivek/portfolio/blob/main/components/Header.js"
    click Banner "https://github.com/tomervivek/portfolio/blob/main/components/Banner.js"
    click Skills "https://github.com/tomervivek/portfolio/blob/main/components/Skills.js"
    click SkillComp "https://github.com/tomervivek/portfolio/blob/main/components/SkillComponent.js"
    click Projects "https://github.com/tomervivek/portfolio/blob/main/components/Projects.js"
    click Experience "https://github.com/tomervivek/portfolio/blob/main/components/Experience.js"
    click Education "https://github.com/tomervivek/portfolio/blob/main/components/Education.js"
    click EduCard "https://github.com/tomervivek/portfolio/blob/main/components/EducationCard.js"
    click GridPattern "https://github.com/tomervivek/portfolio/blob/main/components/GridPattern.js"
    click GlobalsCSS "https://github.com/tomervivek/portfolio/blob/main/styles/globals.css"
    click CircleAnim "https://github.com/tomervivek/portfolio/blob/main/styles/CircleAnimation.module.css"
    click TailwindConfig "https://github.com/tomervivek/portfolio/blob/main/tailwind.config.js"
    click PostCSSConfig "https://github.com/tomervivek/portfolio/blob/main/postcss.config.js"
    click Resume "https://github.com/tomervivek/portfolio/blob/main/public/Vivek-resume.pdf"
    click SkillsAssets "https://github.com/tomervivek/portfolio/tree/main/public/skills/"
    click TailwindConfig "https://github.com/tomervivek/portfolio/blob/main/tailwind.config.js"
    click PostCSSConfig "https://github.com/tomervivek/portfolio/blob/main/postcss.config.js"
    click README "https://github.com/tomervivek/portfolio/blob/main/README.md"
    click NextConfig "https://github.com/tomervivek/portfolio/blob/main/next.config.js"
    click JSConfig "https://github.com/tomervivek/portfolio/blob/main/jsconfig.json"
    click PackageJSON "https://github.com/tomervivek/portfolio/blob/main/package.json"
    click PackageLock "https://github.com/tomervivek/portfolio/blob/main/package-lock.json"
    click Gitignore "https://github.com/tomervivek/portfolio/blob/main/.gitignore"

    %% Styles
    classDef frontend fill:#cce5ff,stroke:#004085,color:#004085
    classDef api fill:#d4edda,stroke:#155724,color:#155724
    classDef styling fill:#fff3cd,stroke:#856404,color:#856404
    classDef assets fill:#e2e3e5,stroke:#6c757d,color:#6c757d
    classDef external fill:#f8d7da,stroke:#721c24,color:#721c24
```
