# onlyoneaman/portfolio-website architecture

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

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

## Overview

##### Project type and purpose
- This is a front-end single-page application (SPA) template built with React + TypeScript.
- It uses Vite as the dev server/bundler and Tailwind for styling.
- No “backend” per se—everything is static assets and client-side code.

##### High-level architectural components
A. Developer Toolchain
– Node.js + pnpm/npm
– linters/prettier (ESLint, Prettier)
– TypeScript compiler (tsc) & swc (for scripts)
– Vite dev server / build pipeline
B. Source Code (src/)
– entrypoint: index.html → index.tsx → App.tsx
– UI Components (src/components/ui)
– Page Components (HomePage, AboutPage, ContactPage under src/components)
– Layout (Sidebar, Container, Footer, SeoPart, etc.)
– Assets (src/assets/images)
– Utility library (src/lib/utils.ts)
C. Styling
– Tailwind CSS (tailwind.config.cjs + postcss.config.cjs)
D. Build Output
– Bundled JS/CSS → /dist (static files)
– Static host or CDN (Netlify, Vercel, GitHub Pages)

##### Relationships and data flow
- Developer runs `pnpm dev` → Vite dev server compiles TS/JS/CSS on the fly.
- Browser requests index.html → Vite injects dev client → React SPA boots.
- React router (if used) or internal state navigates between HomePage, AboutPage, ContactPage.
- Components assemble UI by importing common/ui subcomponents.
- Tailwind classes feed into PostCSS → final CSS served.
- On build (`pnpm build`), Vite outputs optimized static assets for hosting.

##### Important architectural patterns & design principles
- Component-based architecture (React functional components).
- Separation of concerns:
– “ui” folder for generic, reusable controls
– “Common” buttons/containers vs. page-specific components
– “Layout” folder handles frame (header/sidebar/footer)
- Configuration-as-code (all config in package.json + .cjs/.mjs files).
- Fast iterations via Vite’s HMR and swc for scripts.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Developer Toolchain
    subgraph "Developer Toolchain"
        ESLINTRC[".eslintrc.cjs"]:::toolchain
        ESLINTIGNORE[".eslintignore"]:::toolchain
        PRETTIERCFG["prettier.config.mjs"]:::toolchain
        PRETTIERIGN[".prettierignore"]:::toolchain
        TSCONFIG["tsconfig.json"]:::toolchain
        VITECFG["vite.config.ts"]:::toolchain
        POSTCSSCFG["postcss.config.cjs"]:::toolchain
        TAILWINDCFG["tailwind.config.cjs"]:::toolchain
        PKGJSON["package.json"]:::toolchain
        PKGLOCK["package-lock.json"]:::toolchain
        NPMRC[".npmrc"]:::toolchain
    end

    %% Source Code
    subgraph "Source Code (src/)" 
        INDEXHTML["index.html"]:::source
        INDEXTSX["src/index.tsx"]:::source
        APPTSX["src/App.tsx"]:::source
        subgraph "UI Components"
            BTN["button.tsx"]:::source
            AVR["avatar.tsx"]:::source
            RSZ["resizable.tsx"]:::source
        end
        subgraph "Page Components"
            HP["HomePage"]:::source
            APG["AboutPage"]:::source
            CP["ContactPage"]:::source
        end
        subgraph "Common Components"
            CTBTN["ContactButton.tsx"]:::source
            EMBTN["EmailButton.tsx"]:::source
            GITBTN["GetInTouchButton.tsx"]:::source
            CTITLE["ContainerTitle.tsx"]:::source
        end
        subgraph "Layout Components"
            CNT["Container.tsx"]:::source
            FTR["Footer.tsx"]:::source
            SEO["SeoPart.tsx"]:::source
            subgraph "Sider"
                AVBX["AvatarBox.tsx"]:::source
                RTBTN["RouteButtons.tsx"]:::source
                SB["SocialButtons.tsx"]:::source
                SDR["Sider.tsx"]:::source
                SDRIDX["index.tsx"]:::source
            end
        end
        ASSETS["src/assets/images"]:::source
        UTILS["src/lib/utils.ts"]:::source
        APPCSS["src/App.css"]:::source
        TESTS["src/App.test.tsx"]:::source
    end

    %% Styling
    subgraph "Styling"
        TAILWINDCFG2["tailwind.config.cjs"]:::styling
        POSTCSSCFG2["postcss.config.cjs"]:::styling
    end

    %% Build Output
    DIST["dist/"]:::output

    %% Deployment/Hosting
    HOST["Static Host / CDN"]:::hosting

    %% Relationships
    %% Developer workflow
    ESLINTRC -->|configures| VITECFG
    PRETTIERCFG -->|formats| APPTSX
    TSCONFIG -->|compiles| INDEXTSX
    VITECFG -->|bundles| DIST
    POSTCSSCFG -->|processes| APPCSS
    TAILWINDCFG -->|generates| APPCSS

    %% Runtime flow
    INDEXHTML -->|loads| INDEXTSX
    INDEXTSX -->|renders| APPTSX
    APPTSX -->|imports| HP
    APPTSX -->|imports| APG
    APPTSX -->|imports| CP
    HP -->|uses| BTN
    HP -->|uses| AVR
    HP -->|uses| RSZ
    CP -->|uses| CTBTN
    CP -->|uses| EMBTN
    CP -->|uses| GITBTN
    CP -->|uses| CTITLE
    APPTSX -->|wraps| CNT
    APPTSX -->|wraps| FTR
    APPTSX -->|wraps| SEO
    APPTSX -->|wraps| SDRIDX
    SDRIDX -->|imports| AVBX
    SDRIDX -->|imports| RTBTN
    SDRIDX -->|imports| SB
    SDRIDX -->|imports| SDR

    %% Assets and utils
    APPTSX -->|loads| ASSETS
    APPTSX -->|calls| UTILS
    APPTSX -->|tested by| TESTS

    %% Build to host
    DIST -->|deploys| HOST

    %% Click Events
    click ESLINTRC "https://github.com/onlyoneaman/portfolio-website/blob/main/.eslintrc.cjs"
    click ESLINTIGNORE "https://github.com/onlyoneaman/portfolio-website/blob/main/.eslintignore"
    click PRETTIERCFG "https://github.com/onlyoneaman/portfolio-website/blob/main/prettier.config.mjs"
    click PRETTIERIGN "https://github.com/onlyoneaman/portfolio-website/blob/main/.prettierignore"
    click TSCONFIG "https://github.com/onlyoneaman/portfolio-website/blob/main/tsconfig.json"
    click VITECFG "https://github.com/onlyoneaman/portfolio-website/blob/main/vite.config.ts"
    click POSTCSSCFG "https://github.com/onlyoneaman/portfolio-website/blob/main/postcss.config.cjs"
    click TAILWINDCFG "https://github.com/onlyoneaman/portfolio-website/blob/main/tailwind.config.cjs"
    click PKGJSON "https://github.com/onlyoneaman/portfolio-website/blob/main/package.json"
    click PKGLOCK "https://github.com/onlyoneaman/portfolio-website/blob/main/package-lock.json"
    click NPMRC "https://github.com/onlyoneaman/portfolio-website/blob/main/.npmrc"
    click INDEXHTML "https://github.com/onlyoneaman/portfolio-website/blob/main/index.html"
    click INDEXTSX "https://github.com/onlyoneaman/portfolio-website/blob/main/src/index.tsx"
    click APPTSX "https://github.com/onlyoneaman/portfolio-website/blob/main/src/App.tsx"
    click BTN "https://github.com/onlyoneaman/portfolio-website/blob/main/src/components/ui/button.tsx"
    click AVR "https://github.com/onlyoneaman/portfolio-website/blob/main/src/components/ui/avatar.tsx"
    click RSZ "https://github.com/onlyoneaman/portfolio-website/blob/main/src/components/ui/resizable.tsx"
    click HP "https://github.com/onlyoneaman/portfolio-website/blob/main/src/components/HomePage/index.tsx"
    click APG "https://github.com/onlyoneaman/portfolio-website/blob/main/src/components/AboutPage/index.tsx"
    click CP "https://github.com/onlyoneaman/portfolio-website/blob/main/src/components/ContactPage/index.tsx"
    click CTBTN "https://github.com/onlyoneaman/portfolio-website/blob/main/src/components/Common/ContactButton.tsx"
    click EMBTN "https://github.com/onlyoneaman/portfolio-website/blob/main/src/components/Common/EmailButton.tsx"
    click GITBTN "https://github.com/onlyoneaman/portfolio-website/blob/main/src/components/Common/GetInTouchButton.tsx"
    click CTITLE "https://github.com/onlyoneaman/portfolio-website/blob/main/src/components/Common/ContainerTitle.tsx"
    click CNT "https://github.com/onlyoneaman/portfolio-website/blob/main/src/components/Layout/Container.tsx"
    click FTR "https://github.com/onlyoneaman/portfolio-website/blob/main/src/components/Layout/Footer.tsx"
    click SEO "https://github.com/onlyoneaman/portfolio-website/blob/main/src/components/Layout/SeoPart.tsx"
    click AVBX "https://github.com/onlyoneaman/portfolio-website/blob/main/src/components/Layout/Sider/AvatarBox.tsx"
    click RTBTN "https://github.com/onlyoneaman/portfolio-website/blob/main/src/components/Layout/Sider/RouteButtons.tsx"
    click SB "https://github.com/onlyoneaman/portfolio-website/blob/main/src/components/Layout/Sider/SocialButtons.tsx"
    click SDR "https://github.com/onlyoneaman/portfolio-website/blob/main/src/components/Layout/Sider/Sider.tsx"
    click SDRIDX "https://github.com/onlyoneaman/portfolio-website/blob/main/src/components/Layout/Sider/index.tsx"
    click ASSETS "https://github.com/onlyoneaman/portfolio-website/tree/main/src/assets/images"
    click UTILS "https://github.com/onlyoneaman/portfolio-website/blob/main/src/lib/utils.ts"
    click APPCSS "https://github.com/onlyoneaman/portfolio-website/blob/main/src/App.css"
    click TESTS "https://github.com/onlyoneaman/portfolio-website/blob/main/src/App.test.tsx"

    %% Styles
    classDef toolchain fill:#cccccc,stroke:#333,stroke-width:1px;
    classDef source fill:#bbdefb,stroke:#333,stroke-width:1px;
    classDef styling fill:#f8bbd0,stroke:#333,stroke-width:1px;
    classDef output fill:#ffe0b2,stroke:#333,stroke-width:1px;
    classDef hosting fill:#c8e6c9,stroke:#333,stroke-width:1px;
```
