Source code for my online CV: React, TypeScript, and GraphQL
This codebase contains the source for my online CV: cv.mattcalthrop.com.
The application follows a modern React/Next.js architecture with a content-driven approach:
- Frontend Framework: Built with Next.js using React Server Components for optimal performance
- Content Management: Contentful CMS serves as a headless CMS, allowing changes to content without redeploying the application
- Data Layer: Apollo Client handles data fetching and caching via Contentful's GraphQL API
- Component Structure: Modular component architecture using the Chakra UI component library
- Data Flow: Server-side data fetching via
fetchCvData()function that queries Contentful's GraphQL API - Type Safety: Full TypeScript integration with generated GraphQL types for end-to-end type safety
- Styling: Chakra UI component library provides responsive design and theming capabilities
- Testing: Unit tests with Vitest and React Testing Library
- Linting & Formatting: oxlint and Prettier for code quality and consistency
- Dead Code Analysis: knip identifies unused dependencies, exports, and files to maintain a clean codebase
- Dependency Management: Renovate automatically manages dependency updates with intelligent grouping and scheduling
- CI/CD: GitHub Actions workflow for linting, testing, and deploying the application
- Deployment: Statically generated site deployed on Vercel with automated deployments via GitHub
You can fork this repo, and run it locally yourself. Following are instructions for setting it up and running it.
Follow instructions here:
Then download and install the correct version of node:
nvm installFollow the instructions here:
Install the NodeJS packages:
pnpm installpnpm start:devThis will open a web browser at this URL:
To run all tests:
pnpm testCheck
eslint.config.jsfor the eslint rules.
To run the linter:
pnpm lintAnd to auto-correct any errors that can be corrected:
pnpm lint:fixCheck
.prettierrc.jsonfor the Prettier rules.
To check the TypeScript formatting:
pnpm formatAnd to auto-correct any errors that can be corrected:
pnpm format:fixTo build the app:
pnpm buildWith bundle analysis:
ANALYZE=true pnpm buildTo check the TypeScript compilation:
pnpm compile