Portfolio Website to visually show off my work in my career and free time.
https://nickhs.dev/
View Website
·
Report Bug
·
Request Feature
- About The Project
- Getting Started
- Usage
- Available Scripts
- Testing
- Project Maintenance
- Contributing
- Releases
- Deployment
- License
- Node.js version 22 or higher
- Yarn package manager (version 4 or higher)
- (Optional) nvm for Node version management
- Clone the repo
git clone https://github.com/CampAsAChamp/portfolio.git
- Navigate into the repo
cd portfolio - (Optional) If using nvm, install and use the correct Node version
This will automatically use the Node version specified in
nvm install nvm use
.nvmrc - Install dependencies
Or simply:
yarn install
yarn
- Start the development server
yarn start
- Open your web browser to
localhost:5173
- View the site live at https://nickhs.dev/
yarn startoryarn dev- Start development server onlocalhost:5173yarn build- Create production build inbuild/directoryyarn preview- Preview production build locally onlocalhost:4173
yarn test- Run unit tests onceyarn test:watch- Run unit tests in watch modeyarn test:ui- Open interactive Vitest UIyarn test:coverage- Generate test coverage reportyarn test:e2e- Run Playwright E2E testsyarn test:e2e:ui- Open interactive Playwright UIyarn test:e2e:headed- Run E2E tests with visible browseryarn test:lighthouse- Run Lighthouse CI audits (builds and audits production site)yarn test:all- Run all tests (unit + Lighthouse + E2E)
yarn lint- Run all linters (ESLint, TypeScript, Stylelint, Prettier)yarn lint:fix- Auto-fix linting issues and format codeyarn lint:eslint- Run ESLint onlyyarn lint:eslint:fix- Auto-fix ESLint issuesyarn lint:types- Run TypeScript type checkingyarn lint:css- Run Stylelint on CSS filesyarn lint:css:fix- Auto-fix CSS linting issues
yarn analyze- Analyze bundle size with source-map-explorer
This project includes comprehensive automated testing to catch regressions and ensure quality.
Unit tests verify component rendering and behavior using Vitest and React Testing Library.
Run all unit tests once:
yarn testRun tests in watch mode (useful during development):
yarn test:watchOpen the Vitest UI for an interactive testing experience:
yarn test:uiGenerate test coverage report:
yarn test:coverageEnd-to-end tests verify the application works correctly in real browsers using Playwright.
Run all E2E tests:
yarn test:e2eRun E2E tests with interactive UI:
yarn test:e2e:uiRun E2E tests with browser visible (headed mode):
yarn test:e2e:headedTest Coverage:
- Functional tests verify user interactions and navigation
- Visual regression tests catch unintended UI changes
- Tests run against 5 browser configurations:
- Desktop: Chrome, Firefox, Safari
- Mobile: Chrome (Pixel 5), Safari (iPhone 12)
Lighthouse CI verifies the portfolio maintains high performance, accessibility, best practices, and SEO standards using Google's official Lighthouse tooling.
Run Lighthouse audits locally:
yarn test:lighthouse # Runs desktop tests (default)
yarn test:lighthouse:desktop # Explicitly run desktop tests
yarn test:lighthouse:mobile # Run mobile tests with device emulation
yarn test:lighthouse:both # Run both desktop and mobile testsThis command builds the production site and runs a Lighthouse audit to verify performance and quality standards.
Monitored Metrics:
- Performance (threshold: 85+): Load times, Core Web Vitals (LCP, CLS, FID), bundle optimization
- Accessibility (threshold: 90+): ARIA labels, keyboard navigation, color contrast, semantic HTML
- Best Practices (threshold: 90+): HTTPS, console errors, deprecated APIs, security
- SEO (threshold: 90+): Meta tags, mobile-friendliness, structured data
Configuration: Lighthouse settings are defined in:
.lighthouserc.desktop.json- Desktop preset (no throttling).lighthouserc.mobile.json- Mobile preset (375x667, 4G throttling, 4x CPU slowdown)
GitHub Integration: Lighthouse CI is configured with a GitHub token to provide:
- ✅ Status checks on commits showing pass/fail for each category
- 💬 PR comments with score comparisons when changes affect performance
- 📊 Integration with GitHub's checks interface
Local Development: To run Lighthouse locally without token warnings:
- Copy
.env.exampleto.env.local:cp .env.example .env.local - Add your GitHub token to
.env.local - The token will be automatically loaded when running
yarn test:lighthouse
Run unit tests, Lighthouse audits, and E2E tests:
yarn test:allThis command runs all three test suites in sequence: unit tests with Vitest, Lighthouse performance audits, and E2E tests with Playwright. Tests are ordered from fastest to slowest for quicker feedback.
The CI pipeline runs automatically on every push and pull request via GitHub Actions (.github/workflows/test.yml):
Test Job:
- Setup: Install Node.js 22 and dependencies
- Lint: Run ESLint, Stylelint, and TypeScript type checking
- Test: Run unit tests with Vitest
- Build: Create production build
- Analyze: Check bundle sizes
Lighthouse Job (runs after Test job passes):
- Build: Create production build
- Audit: Run desktop Lighthouse audits for performance, accessibility, best practices, and SEO
- Upload: Save reports to temporary public storage and GitHub artifacts
- Status: Post GitHub status check with pass/fail results
You can view interactive Lighthouse reports directly from the GitHub Actions run output via the temporary public storage link.
Note: E2E visual regression and functional tests run locally via the pre-push hook but are not part of the CI pipeline to keep build times fast. Pull requests must pass all CI checks before merging.
Tests are located in the tests/ directory, mirroring the structure of src/:
tests/unit/- Unit tests with VitestApp.test.tsx- Main app componentcomponents/- Component tests organized by featurehooks/- Custom hook testsutils/- Utility function tests
tests/e2e/- End-to-end tests with Playwrightfunctional/- User interaction and navigation testsvisual-regression/- Screenshot comparison tests
.lighthouserc.desktop.json/.lighthouserc.mobile.json- Lighthouse CI configurations for performance audits- All tests use TypeScript for type safety
- Focus on catching regressions when updating content or refactoring
This project uses Dependabot to automatically keep dependencies up to date:
- Runs weekly on Mondays at 9:00 AM PST
- Creates grouped pull requests for related dependencies:
- React ecosystem packages
- Testing libraries (Vitest, Playwright, Testing Library)
- Linting tools (ESLint, TypeScript, Prettier, Stylelint)
- Build tools (Vite, Rollup)
- Also updates GitHub Actions weekly
- Maximum of 5 open dependency PRs at a time
- All PRs follow conventional commit format
Configuration can be found in .github/dependabot.yml.
For information about reporting security vulnerabilities, see SECURITY.md.
All notable changes are automatically documented in CHANGELOG.md by semantic-release. The changelog is generated from conventional commit messages and should not be manually edited. See Releases for more information.
This project follows conventional commit standards to maintain a clean and readable git history.
All commit messages must follow the Conventional Commits specification:
<type>(<optional-scope>): <subject>
Example commits:
feat: add dark mode toggle
fix: resolve mobile navigation bug
docs: update README with setup instructions
chore: update dependencies
refactor(auth): simplify login logic
test: add unit tests for utils
style: format code with prettier
perf: optimize image loading- feat: A new feature
- fix: A bug fix
- docs: Documentation changes
- style: Code style changes (formatting, missing semicolons, etc.)
- refactor: Code changes that neither fix bugs nor add features
- perf: Performance improvements
- test: Adding or updating tests
- build: Changes to build system or dependencies
- ci: Changes to CI configuration files and scripts
- chore: Other changes that don't modify src or test files
- revert: Reverts a previous commit
Commit messages are automatically validated using commitlint:
- The commit-msg hook runs on every commit
- Invalid commit messages will be rejected
- You'll see an error message explaining what's wrong
To manually validate a commit message:
echo "feat: your message" | yarn commitlintThis project uses Husky to enforce quality standards:
- pre-commit: Runs
lint-stagedwhich formats and lints only staged files:- ESLint auto-fixes JavaScript/TypeScript issues
- Prettier formats code
- Stylelint fixes CSS issues
- commit-msg: Validates commit message format with
commitlint(rejects invalid commits) - pre-push: Runs
yarn test:all(unit tests, Lighthouse audits, and E2E tests) before pushing
Note: If tests fail during pre-push, the push will be blocked. Ensure all tests pass locally before pushing.
Node Version: All tests require Node.js version 22 or higher (specified in .nvmrc). If you use nvm, run nvm use to switch to the correct version.
This project automatically deploys to Cloudflare Pages.
Cloudflare Pages automatically deploys your site whenever you push to the repository:
-
Make your changes and commit them (following conventional commit format):
git add . git commit -m "feat: your feature description"
-
Push to the main branch:
git push origin main
-
Cloudflare Pages will automatically:
- Detect the changes
- Install dependencies
- Build the project with
yarn build - Deploy to production
-
View deployment status and logs in your Cloudflare Pages dashboard
-
Your site will be live at
https://nickhs.dev(or your configured domain)
Your Cloudflare Pages project should be configured with:
- Build command:
yarn build - Build output directory:
build - Root directory:
/(default) - Node version: 22 or higher
The custom domain nickhs.dev is configured in Cloudflare:
- DNS is managed through Cloudflare
- SSL/TLS is automatically handled
- CDN caching and optimization are enabled
To update the domain or DNS settings, visit your Cloudflare dashboard.
To create a production build locally without deploying:
yarn buildThis creates an optimized build in the build folder. To preview the production build locally:
yarn previewThis will serve the production build at localhost:4173.
- Follow conventional commit format for all commits
- Pre-commit hooks automatically format code and validate commits
- Pre-push hook runs all tests (unit + Lighthouse + E2E) before pushing to remote
- Cloudflare Pages deployments typically complete in 1-2 minutes
- Preview deployments are automatically created for pull requests
- Cloudflare provides automatic HTTPS, CDN, and DDoS protection
This project uses semantic-release for automated version management and changelog generation.
Releases are fully automated based on your commit messages:
- Commit with conventional format (following the Contributing guidelines)
- Push to main branch - triggers the CI pipeline
- After tests pass - the Release workflow automatically:
- Analyzes commits since the last release
- Determines the next version number based on commit types
- Generates release notes from commit messages
- Updates
CHANGELOG.md - Creates a GitHub release with notes
- Tags the release in git
The version number is automatically determined by commit types:
- Major release (1.0.0 → 2.0.0): Commits with
BREAKING CHANGE:in the footer - Minor release (1.0.0 → 1.1.0):
feat:commits - Patch release (1.0.0 → 1.0.1):
fix:,perf:, orrevert:commits - No release:
docs:,style:,chore:,refactor:,test:,build:,ci:commits (but they still appear in the changelog)
# Make changes
git add .
# Commit with conventional format - will trigger patch release
git commit -m "fix: resolve mobile navigation bug"
# Push to main
git push origin main
# GitHub Actions will:
# 1. Run tests (test.yml workflow)
# 2. If tests pass, run release (release.yml workflow)
# 3. Create version 1.0.1 with generated changelog
# 4. Create GitHub release with notes- DO NOT manually edit
CHANGELOG.md- it's automatically generated by semantic-release - Releases only happen on the
mainbranch after successful test runs - The release workflow can be viewed at
.github/workflows/release.yml - Release configuration is in
.releaserc.json
Distributed under the MIT License. See LICENSE for more information.
