# kr1shnasomani/portfolio-website architecture

> Architecture diagram of the GitHub repository kr1shnasomani/portfolio-website, 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/kr1shnasomani/portfolio-website
- Repository: https://github.com/kr1shnasomani/portfolio-website

## Overview

##### Project type and purpose
- This is a single-page portfolio website:
– Frontend-only (no custom backend code in this repo)
– Built with React (TSX), TypeScript, Vite, Tailwind CSS
– Static assets (images, CSS, JS) served from `/public` or via your hosting/CDN
- Main goal: showcase personal achievements, projects, certifications, skills

##### File structure
- Top-level:
– `index.html`: SPA entrypoint
– `vite.config.ts`, `tsconfig.json`, `tailwind.config.ts`: build & tooling configs
– `package.json` / `bun.lockb` / `node_modules` (implicit): dependencies
- `src/`: application code
– `main.tsx` → mounts `<App>`
– `App.tsx` + `App.css` → root component & global styles
– `components/`: domain widgets (AchievementCarousel, SkillsGrid, etc.)
– `components/ui/`: design‐system primitives (button.tsx, dialog.tsx, table.tsx, etc.)
– `hooks/`: cross‐cutting hooks (`use-mobile`, `use-toast`)
– `lib/`: shared utilities (`utils.ts`)
– `pages/`: route targets (`Index.tsx`, `NotFound.tsx`)
- `public/`: static hosting folder (robots.txt, uploads)

##### README
- Title only (“Portfolio Website”) → confirms it is a frontend showcase
- No mention of backend microservices or API layers

##### Main components & interactions
a. Developer Workstation
– Edits `src/`
– Runs Vite Dev Server → hot-reloads
– Runs `npm run build` → generates `dist/` (index.html, CSS, JS bundles, copied `/public` assets)
b. CI/CD / Build Pipeline
– (Optional) GitHub Actions or similar picks up repo → `npm ci` → `npm run build` → outputs artifacts
– Deploys to static hosting (Netlify, Vercel, S3 + CloudFront, GitHub Pages)
c. Hosting / CDN
– Serves `index.html`, JS, CSS, images, `/uploads`
d. Client Browser
– Requests `index.html`
– Loads JS bundle → React hydrates in the DOM
– React Router (implicit via `pages/Index.tsx` & 404) determines views
– Components import from `components/` and `components/ui/`
– UI events trigger local state / toast notifications (`use-toast`), no external API calls
e. Static asset interactions
– Images or uploads (under `public/uploads`) rendered in carousels
– CSS (`App.css`, Tailwind directives) applied at build time

##### Architectural patterns & design principles
- Single-Page App (SPA)
- Component-based architecture
- Design-System primitives (`components/ui`) vs. domain widgets (`components/`)
- Build pipeline separation: Dev Server vs. Production build
- Static hosting / CDN delivery

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Developer Workstation"
        dev["Developer Workstation"]:::dev
        viteDev["Vite Dev Server"]:::build
        buildScript["npm run build (TS→JS, Tailwind→CSS)"]:::build
    end

    dev --> viteDev
    dev --> buildScript

    subgraph "Build & Tooling Configurations"
        viteConfig["vite.config.ts"]:::config
        tsConfig1["tsconfig.json"]:::config
        tsConfig2["tsconfig.app.json"]:::config
        tsConfig3["tsconfig.node.json"]:::config
        tailwindConfig["tailwind.config.ts"]:::config
        postcssConfig["postcss.config.js"]:::config
        pkgJson["package.json"]:::config
        bunLock["bun.lockb"]:::config
        pkgLock["package-lock.json"]:::config
    end

    buildScript --> viteConfig
    buildScript --> tsConfig1
    buildScript --> tsConfig2
    buildScript --> tsConfig3
    buildScript --> tailwindConfig
    buildScript --> postcssConfig
    buildScript --> pkgJson
    buildScript --> bunLock
    buildScript --> pkgLock

    subgraph "Build Output"
        assets["assets/"]:::output
        public["public/"]:::static
    end

    buildScript --> assets
    buildScript --> public

    ci["CI/CD Pipeline"]:::ci
    ci --> buildScript
    ci --> assets
    ci --> public

    subgraph "Hosting / CDN"
        hosting["Static Hosting (Netlify, S3/CDN)"]:::hosting
        uploads["uploads/"]:::static
        robots["robots.txt"]:::static
    end

    assets --> hosting
    public --> hosting
    public --> uploads
    public --> robots

    subgraph "Client Browser & Runtime"
        indexhtml["index.html"]:::runtime
        jsBundle["JS Bundle"]:::runtime
        cssBundle["CSS Bundle"]:::runtime

        subgraph "React Application"
            main["main.tsx"]:::code
            App["App.tsx"]:::code
            appCSS["App.css"]:::code
            indexCSS["index.css"]:::code
            viteEnv["vite-env.d.ts"]:::code

            subgraph "Routing / Pages"
                indexPage["Index.tsx"]:::page
                notFound["NotFound.tsx"]:::page
            end

            subgraph "Domain Widgets"
                ach["AchievementCarousel.tsx"]:::comp
                cert["CertificationCarousel.tsx"]:::comp
                proj["ProjectCarousel.tsx"]:::comp
                skills["SkillsGrid.tsx"]:::comp
            end

            subgraph "UI Primitives"
                btn["button.tsx"]:::ui
                dialog["dialog.tsx"]:::ui
                table["table.tsx"]:::ui
                toast["toast.tsx"]:::ui
                toaster["toaster.tsx"]:::ui
            end

            subgraph "Hooks"
                useMobile["use-mobile.tsx"]:::hook
                useToast["use-toast.ts"]:::hook
            end

            utils["utils.ts"]:::lib
        end
    end

    hosting --> indexhtml
    indexhtml --> jsBundle
    indexhtml --> cssBundle
    jsBundle --> main
    main --> App
    App --> appCSS
    App --> indexCSS
    main --> viteEnv
    App --> indexPage
    App --> notFound
    indexPage --> ach
    indexPage --> cert
    indexPage --> proj
    indexPage --> skills
    ach --> btn
    cert --> dialog
    proj --> table
    skills --> toast
    skills --> toaster
    btn --> useMobile
    toast --> useToast
    useMobile --> utils
    useToast --> utils

    click indexhtml "https://github.com/kr1shnasomani/portfolio-website/blob/main/index.html"
    click viteConfig "https://github.com/kr1shnasomani/portfolio-website/blob/main/vite.config.ts"
    click tsConfig1 "https://github.com/kr1shnasomani/portfolio-website/blob/main/tsconfig.json"
    click tsConfig2 "https://github.com/kr1shnasomani/portfolio-website/blob/main/tsconfig.app.json"
    click tsConfig3 "https://github.com/kr1shnasomani/portfolio-website/blob/main/tsconfig.node.json"
    click tailwindConfig "https://github.com/kr1shnasomani/portfolio-website/blob/main/tailwind.config.ts"
    click postcssConfig "https://github.com/kr1shnasomani/portfolio-website/blob/main/postcss.config.js"
    click pkgJson "https://github.com/kr1shnasomani/portfolio-website/blob/main/package.json"
    click bunLock "https://github.com/kr1shnasomani/portfolio-website/blob/main/bun.lockb"
    click pkgLock "https://github.com/kr1shnasomani/portfolio-website/blob/main/package-lock.json"
    click assets "https://github.com/kr1shnasomani/portfolio-website/tree/main/assets/"
    click public "https://github.com/kr1shnasomani/portfolio-website/tree/main/public/"
    click uploads "https://github.com/kr1shnasomani/portfolio-website/tree/main/public/uploads/"
    click robots "https://github.com/kr1shnasomani/portfolio-website/blob/main/public/robots.txt"
    click main "https://github.com/kr1shnasomani/portfolio-website/blob/main/src/main.tsx"
    click App "https://github.com/kr1shnasomani/portfolio-website/blob/main/src/App.tsx"
    click appCSS "https://github.com/kr1shnasomani/portfolio-website/blob/main/src/App.css"
    click indexCSS "https://github.com/kr1shnasomani/portfolio-website/blob/main/src/index.css"
    click viteEnv "https://github.com/kr1shnasomani/portfolio-website/blob/main/src/vite-env.d.ts"
    click indexPage "https://github.com/kr1shnasomani/portfolio-website/blob/main/src/pages/Index.tsx"
    click notFound "https://github.com/kr1shnasomani/portfolio-website/blob/main/src/pages/NotFound.tsx"
    click ach "https://github.com/kr1shnasomani/portfolio-website/blob/main/src/components/AchievementCarousel.tsx"
    click cert "https://github.com/kr1shnasomani/portfolio-website/blob/main/src/components/CertificationCarousel.tsx"
    click proj "https://github.com/kr1shnasomani/portfolio-website/blob/main/src/components/ProjectCarousel.tsx"
    click skills "https://github.com/kr1shnasomani/portfolio-website/blob/main/src/components/SkillsGrid.tsx"
    click btn "https://github.com/kr1shnasomani/portfolio-website/blob/main/src/components/ui/button.tsx"
    click dialog "https://github.com/kr1shnasomani/portfolio-website/blob/main/src/components/ui/dialog.tsx"
    click table "https://github.com/kr1shnasomani/portfolio-website/blob/main/src/components/ui/table.tsx"
    click toast "https://github.com/kr1shnasomani/portfolio-website/blob/main/src/components/ui/toast.tsx"
    click toaster "https://github.com/kr1shnasomani/portfolio-website/blob/main/src/components/ui/toaster.tsx"
    click useMobile "https://github.com/kr1shnasomani/portfolio-website/blob/main/src/hooks/use-mobile.tsx"
    click useToast "https://github.com/kr1shnasomani/portfolio-website/blob/main/src/hooks/use-toast.ts"
    click utils "https://github.com/kr1shnasomani/portfolio-website/blob/main/src/lib/utils.ts"

    classDef dev fill:#f9f,stroke:#333,stroke-width:1px
    classDef build fill:#bbf,stroke:#336,stroke-width:1px
    classDef config fill:#bbf,stroke:#336,stroke-width:1px
    classDef output fill:#ccc,stroke:#333,stroke-width:1px
    classDef static fill:#eee,stroke:#333,stroke-width:1px
    classDef ci fill:#ffb,stroke:#995,stroke-width:1px
    classDef hosting fill:#bfb,stroke:#3a3,stroke-width:1px
    classDef runtime fill:#fda,stroke:#d60,stroke-width:1px
    classDef code fill:#fcf,stroke:#c3c,stroke-width:1px
    classDef page fill:#fee,stroke:#c33,stroke-width:1px
    classDef comp fill:#fef,stroke:#c0c,stroke-width:1px
    classDef ui fill:#efe,stroke:#0c0,stroke-width:1px
    classDef hook fill:#def,stroke:#069,stroke-width:1px
    classDef lib fill:#ddf,stroke:#339,stroke-width:1px
```
