# aashishthakuri/3d-portfolio architecture

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

- Interactive diagram: https://gitdiagram.com/aashishthakuri/3d-portfolio
- Repository: https://github.com/aashishthakuri/3d-portfolio

## Overview

##### Project type and purpose
- This is a full-stack, server-side-rendered (SSR) React application built with Next.js (v13+ using the “app” directory).
- It appears to be a personal/portfolio site: it renders pages, a 3D scene, project cards, a contact form, and uses optimized fonts.

##### File structure
- Top-level folders:
- app/ – the Next.js “app router” source code (pages, layout, React components).
- public/ – static assets (images, media).
- dist/ – build artifacts: client bundles, server bundles, static chunks, manifests.
- src/app/ – duplicate or legacy source (could be unused; verify if this is shadowed by app/).
- Config files: next.config.js, tsconfig.json, tailwind.config.ts, postcss.config.mjs, eslint.config.mjs, vercel.json.
- Package.json and lock file for dependency management.

##### README for additional insights
- Bootstrapped via Create Next App.
- Uses next/font for automatic font optimization.
- Deploys on Vercel, implying serverless functions / edge network.

##### Main components
a. Source Code (Git repository)
- Directories: app/, public/, next.config.js, Tailwind/PostCSS configs, tsconfig.json.
b. Build Pipeline
- Next.js build process
- Webpack (client-side bundles, server-side bundles)
- next/font optimization
c. Deployment Infrastructure
- Vercel Platform
- CDN / Edge Network
- Serverless Functions or Edge Functions for SSR
d. Runtime Components
- Browser (client)
- React components (ThreeScene, ProjectCard, ContactForm)
- Static assets (images, CSS) served from CDN
- Next.js Serverless / Edge Functions
- SSR / SSG page rendering
- Build manifests and routing
e. External Services
- Vercel font hosting (Geist font)
- Any analytics or third-party scripts (if present)

##### Relationships and Interactions
- Developer pushes code → Git → Vercel CI/CD triggers Next.js build
- Build output:
- Client bundles → uploaded to CDN
- Server bundles → deployed as serverless/edge functions
- Manifests (build-manifest.json, app-build-manifest.json) for runtime routing
- User requests URL in browser → DNS → Vercel CDN (static assets) or Edge Function (SSR)
- Edge Function executes Next.js server bundle → renders React tree → returns HTML + JS + CSS
- Browser hydrates React components, loads Three.js scene, ContactForm, etc.

##### Architectural patterns and design principles
- Monorepo-style source, single Next.js application (not microservices)
- Universal rendering: SSR + client hydration
- Code splitting via Webpack, dynamic imports if used
- File-based routing (app/router)
- Static asset optimization (next/font, automatic image optimization if used)
- Tailwind CSS for utility-first styling

- Both client and server bundles and their flow into deployment
- Clearly label SSR vs. static asset serving
- How the 3D scene and dynamic components load in the browser
- Keep it detailed but focused on these architectural elements—don’t overcomplicate with unrelated infrastructure

## Diagram (Mermaid)

```mermaid
graph TD
    %% Source Code Layer
    subgraph "Source Code" 
        direction TB
        AppDir["app/"] 
        PublicImages["public/images/"]
        PublicProjects["public/projects/"]
        NextConfig["next.config.js"]
        TailwindConfig["tailwind.config.ts"]
        PostCSSConfig["postcss.config.mjs"]
        TSConfig["tsconfig.json"]
        ESLintConfig["eslint.config.mjs"]
        VercelConfig["vercel.json"]
        AppPage["page.tsx"]
        NotFoundPage["not-found.tsx"]
        RootLayout["layout.tsx"]
        GlobalStyles["globals.css"]
        ThreeScene["ThreeScene.tsx"]
        ProjectCard["ProjectCard.tsx"]
        ContactForm["ContactForm.tsx"]
        ContactSection["Contact.tsx"]
        UniverseBg["UniverseBackground.tsx"]
    end

    %% Build System Layer
    subgraph "Build System" 
        direction TB
        NextBuild["Next.js Build\n(Webpack + next/font)"]
        BuildManifest["build-manifest.json"]
        AppBuildManifest["app-build-manifest.json"]
        WebpackCache["cache/webpack/"]
        ServerBundles["server/"]
        StaticChunks["static/chunks/"]
        StaticCSS["static/css/"]
    end

    %% Deployment Infrastructure
    subgraph "Vercel Platform"
        direction TB
        CDN["CDN / Edge Network"]
        EdgeFuncs["Serverless / Edge Functions"]
    end

    %% Runtime Components
    subgraph "Runtime"
        direction TB
        Browser["Browser (Client)"]
        subgraph "Client React Components"
            direction TB
            ThreeSceneClient["ThreeScene"]
            ProjectCardClient["ProjectCard"]
            ContactFormClient["ContactForm"]
            ContactSectionClient["ContactSection"]
            UniverseBgClient["UniverseBackground"]
        end
    end

    %% Data Flows
    AppDir -->|includes routes & components| NextBuild
    PublicImages --> NextBuild
    PublicProjects --> NextBuild
    NextConfig --> NextBuild
    TailwindConfig --> NextBuild
    PostCSSConfig --> NextBuild
    TSConfig --> NextBuild
    ESLintConfig --> NextBuild
    VercelConfig --> NextBuild

    NextBuild -->|produces| BuildManifest
    NextBuild -->|produces| AppBuildManifest
    NextBuild -->|writes cache| WebpackCache
    NextBuild -->|outputs| ServerBundles
    NextBuild -->|outputs| StaticChunks
    NextBuild -->|outputs| StaticCSS

    BuildManifest --> CDN
    AppBuildManifest --> EdgeFuncs
    ServerBundles --> EdgeFuncs
    StaticChunks --> CDN
    StaticCSS --> CDN

    Browser -->|requests page| CDN
    Browser -->|requests SSR| EdgeFuncs
    EdgeFuncs -->|serves HTML+JS+CSS| Browser
    CDN -->|serves assets| Browser

    Browser --> ThreeSceneClient
    Browser --> ProjectCardClient
    Browser --> ContactFormClient
    Browser --> ContactSectionClient
    Browser --> UniverseBgClient

    %% Click Events
    click AppDir "https://github.com/aashishthakuri/3d-portfolio/tree/master/app/"
    click PublicImages "https://github.com/aashishthakuri/3d-portfolio/tree/master/public/images/"
    click PublicProjects "https://github.com/aashishthakuri/3d-portfolio/tree/master/public/projects/"
    click NextConfig "https://github.com/aashishthakuri/3d-portfolio/blob/master/next.config.js"
    click TailwindConfig "https://github.com/aashishthakuri/3d-portfolio/blob/master/tailwind.config.ts"
    click PostCSSConfig "https://github.com/aashishthakuri/3d-portfolio/blob/master/postcss.config.mjs"
    click TSConfig "https://github.com/aashishthakuri/3d-portfolio/blob/master/tsconfig.json"
    click ESLintConfig "https://github.com/aashishthakuri/3d-portfolio/blob/master/eslint.config.mjs"
    click VercelConfig "https://github.com/aashishthakuri/3d-portfolio/blob/master/vercel.json"
    click AppPage "https://github.com/aashishthakuri/3d-portfolio/blob/master/app/page.tsx"
    click NotFoundPage "https://github.com/aashishthakuri/3d-portfolio/blob/master/app/not-found.tsx"
    click RootLayout "https://github.com/aashishthakuri/3d-portfolio/blob/master/app/layout.tsx"
    click GlobalStyles "https://github.com/aashishthakuri/3d-portfolio/blob/master/app/globals.css"
    click ThreeScene "https://github.com/aashishthakuri/3d-portfolio/blob/master/app/components/ThreeScene.tsx"
    click ProjectCard "https://github.com/aashishthakuri/3d-portfolio/blob/master/app/components/ProjectCard.tsx"
    click ContactForm "https://github.com/aashishthakuri/3d-portfolio/blob/master/app/components/ContactForm.tsx"
    click ContactSection "https://github.com/aashishthakuri/3d-portfolio/blob/master/app/components/Contact.tsx"
    click UniverseBg "https://github.com/aashishthakuri/3d-portfolio/blob/master/app/components/UniverseBackground.tsx"
    click BuildManifest "https://github.com/aashishthakuri/3d-portfolio/blob/master/dist/build-manifest.json"
    click AppBuildManifest "https://github.com/aashishthakuri/3d-portfolio/blob/master/dist/app-build-manifest.json"
    click WebpackCache "https://github.com/aashishthakuri/3d-portfolio/tree/master/dist/cache/webpack/"
    click ServerBundles "https://github.com/aashishthakuri/3d-portfolio/tree/master/dist/server/"
    click StaticChunks "https://github.com/aashishthakuri/3d-portfolio/tree/master/dist/static/chunks/"
    click StaticCSS "https://github.com/aashishthakuri/3d-portfolio/tree/master/dist/static/css/"

    %% Styles
    classDef source fill:#e6ffed,stroke:#2c662d,stroke-width:1px
    classDef build fill:#e7f0fd,stroke:#2165c3,stroke-width:1px
    classDef infra fill:#fff3e0,stroke:#c77700,stroke-width:1px
    classDef client fill:#f3e5f5,stroke:#6a1b9a,stroke-width:1px

    class AppDir,PublicImages,PublicProjects,NextConfig,TailwindConfig,PostCSSConfig,TSConfig,ESLintConfig,VercelConfig,AppPage,NotFoundPage,RootLayout,GlobalStyles,ThreeScene,ProjectCard,ContactForm,ContactSection,UniverseBg source
    class NextBuild,BuildManifest,AppBuildManifest,WebpackCache,ServerBundles,StaticChunks,StaticCSS build
    class CDN,EdgeFuncs infra
    class Browser,ThreeSceneClient,ProjectCardClient,ContactFormClient,ContactSectionClient,UniverseBgClient client
```
