# sujiththirumalaisamy/cv architecture

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

- Interactive diagram: https://gitdiagram.com/sujiththirumalaisamy/cv
- Repository: https://github.com/sujiththirumalaisamy/cv

## Overview

##### Project type and purpose
- This is a full-stack, single-page web application built with Next.js 14 (React + TypeScript) that renders a minimalist, print-friendly CV.
- It exposes a GraphQL API endpoint to fetch resume data and uses shadcn/ui (a component library) plus Tailwind CSS for styling.
- It can be deployed on Vercel or run in a Docker container via docker-compose.

##### File structure
Top-level:
- Dockerfile + docker-compose.yaml → Containerization/deployment
- next.config.js, package.json, tsconfig.json, ESLint/Prettier → Build and lint setup
- public/ → Static assets (favicon, images, etc.)
src/:
- app/ → Next.js App Router routes
– page.tsx, layout.tsx, globals.css → UI shell and styling
– graphql/route.ts → Next.js API route for GraphQL requests
- apollo/ → GraphQL schema (type-defs.ts) and resolvers (resolvers.ts)
- data/ → resume-data.tsx holds the CV configuration (source of truth)
- components/ → React UI components
– ui/ → shadcn/ui primitives (button, avatar, dialog, etc.)
- lib/utils.ts → Utility functions

##### README for additional insights
- Confirms use of Next.js, TypeScript, Tailwind CSS, shadcn/ui.
- Single config file for resume data.
- Deployment via Vercel or Docker Compose.

##### Main components and their interactions
4.1 Client Browser
- Requests pages (SSR/SSG) and hydrates React components
- Calls GraphQL API (fetch) for dynamic data if required
4.2 Next.js Server (Node.js runtime)
- App Router handles:
– SSR/SSG page.tsx & layout.tsx → uses React + Tailwind + UI components
– API Route at /api/graphql (route.ts) → receives GraphQL queries
- Build pipeline driven by next.config.js + package.json scripts
4.3 GraphQL Layer (Apollo)
- type-defs.ts → GraphQL schema definitions (Query types for resume sections)
- resolvers.ts → Functions that read from resume-data.tsx and return the data
- route.ts stitches Apollo Server into Next.js API route
4.4 Data Source
- resume-data.tsx → JavaScript/TS data structure defining CV content
4.5 UI Component Library
- shadcn/ui primitives under components/ui
4.6 Styling & Assets
- Tailwind CSS configured via tailwind.config.js, postcss.config.js
- globals.css for base styles
- public/ and src/images/ for static images and logos
4.7 Deployment/Infrastructure
- Local dev: yarn dev → Next.js dev server
- Docker: Dockerfile + docker-compose.yaml build/run container
- Hosting: Vercel (automatic builds using next.config.js)

##### Architectural patterns & design principles
- Monorepo with clear separation of concerns (app router, API, data, UI)
- Component-based architecture (atomic design for UI primitives)
- API-driven data fetching via GraphQL
- SSR/SSG for performance and SEO
- Containerization for environment parity

##### Final checklist
- Callouts for key files (e.g., route.ts, type-defs.ts, resume-data.tsx)
- Deployment path (Docker or Vercel) clearly shown

## Diagram (Mermaid)

```mermaid
flowchart TD
    classDef frontend fill:#D0E8FF,stroke:#333,stroke-width:1px
    classDef backend fill:#D0FFD0,stroke:#333,stroke-width:1px
    classDef data fill:#FFE8D0,stroke:#333,stroke-width:1px
    classDef infra fill:#DDDDDD,stroke:#333,stroke-width:1px

    Client["Client (Browser)"]:::frontend
    SSR["Next.js Server\n(App Router + API Routes)"]:::backend
    GraphQL["GraphQL Service\n(Apollo Server)"]:::backend
    Data["Resume Data"]:::data
    UILib["UI Component Library"]:::frontend
    Styling["Styling Engine\n(Tailwind CSS + globals.css)"]:::frontend
    Assets["Static Asset Store"]:::data
    Deploy["Deployment\n(Docker / Vercel)"]:::infra

    Client -->|"HTTP GET page"| SSR
    SSR -->|"GraphQL query"| GraphQL
    GraphQL -->|"read resume-data.tsx"| Data
    SSR -->|"render HTML/CSS/JS bundle"| Client
    SSR -->|"uses UI components"| UILib
    SSR -->|"applies styles"| Styling
    SSR -->|"serves static assets"| Assets
    Deploy --> SSR

    subgraph "App Router"
        Page["page.tsx"]:::backend
        Layout["layout.tsx"]:::backend
        Route["graphql/route.ts"]:::backend
    end
    SSR --> App_Router
    Route --> GraphQL

    subgraph "Apollo Service"
        TypeDefs["type-defs.ts"]:::backend
        Resolvers["resolvers.ts"]:::backend
    end
    GraphQL --> Apollo_Service

    subgraph "UI Library"
        UI_Prim["shadcn/ui primitives"]:::frontend
        CommandMenu["command-menu.tsx"]:::frontend
        PrintDrawer["print-drawer.tsx"]:::frontend
        ProjectCard["project-card.tsx"]:::frontend
        Icons["icons/"]:::frontend
    end
    UILib --> UI_Library

    subgraph "Styling Config"
        TWConfig["tailwind.config.js"]:::infra
        PostCSS["postcss.config.js"]:::infra
        GlobalsCSS["globals.css"]:::frontend
    end
    Styling --> Styling_Config

    subgraph "Assets"
        Public["public/"]:::data
        Logos["src/images/logos/index.ts"]:::data
    end
    Assets --> Assets

    subgraph "Deployment Config"
        Dockerfile["Dockerfile"]:::infra
        Compose["docker-compose.yaml"]:::infra
        NextConfig["next.config.js"]:::infra
        PackageJSON["package.json"]:::infra
        TSConfig["tsconfig.json"]:::infra
        ESLint[".eslintrc.json"]:::infra
        Prettier[".prettierrc"]:::infra
    end
    Deployment_Config --> Deploy

    click Page "https://github.com/sujiththirumalaisamy/cv/blob/main/src/app/page.tsx"
    click Layout "https://github.com/sujiththirumalaisamy/cv/blob/main/src/app/layout.tsx"
    click Route "https://github.com/sujiththirumalaisamy/cv/blob/main/src/app/graphql/route.ts"
    click TypeDefs "https://github.com/sujiththirumalaisamy/cv/blob/main/src/apollo/type-defs.ts"
    click Resolvers "https://github.com/sujiththirumalaisamy/cv/blob/main/src/apollo/resolvers.ts"
    click Data "https://github.com/sujiththirumalaisamy/cv/blob/main/src/data/resume-data.tsx"
    click UI_Prim "https://github.com/sujiththirumalaisamy/cv/tree/main/src/components/ui/"
    click CommandMenu "https://github.com/sujiththirumalaisamy/cv/blob/main/src/components/command-menu.tsx"
    click PrintDrawer "https://github.com/sujiththirumalaisamy/cv/blob/main/src/components/print-drawer.tsx"
    click ProjectCard "https://github.com/sujiththirumalaisamy/cv/blob/main/src/components/project-card.tsx"
    click Icons "https://github.com/sujiththirumalaisamy/cv/tree/main/src/components/icons/"
    click TWConfig "https://github.com/sujiththirumalaisamy/cv/blob/main/tailwind.config.js"
    click PostCSS "https://github.com/sujiththirumalaisamy/cv/blob/main/postcss.config.js"
    click GlobalsCSS "https://github.com/sujiththirumalaisamy/cv/blob/main/src/app/globals.css"
    click Public "https://github.com/sujiththirumalaisamy/cv/tree/main/public/"
    click Logos "https://github.com/sujiththirumalaisamy/cv/blob/main/src/images/logos/index.ts"
    click Dockerfile "https://github.com/sujiththirumalaisamy/cv/tree/main/Dockerfile"
    click Compose "https://github.com/sujiththirumalaisamy/cv/blob/main/docker-compose.yaml"
    click NextConfig "https://github.com/sujiththirumalaisamy/cv/blob/main/next.config.js"
    click PackageJSON "https://github.com/sujiththirumalaisamy/cv/blob/main/package.json"
    click TSConfig "https://github.com/sujiththirumalaisamy/cv/blob/main/tsconfig.json"
    click ESLint "https://github.com/sujiththirumalaisamy/cv/blob/main/.eslintrc.json"
    click Prettier "https://github.com/sujiththirumalaisamy/cv/blob/main/.prettierrc"
```
