How sujiththirumalaisamy/cv works
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