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
- Deployment
- License
Additional Tools:
- Playwright - E2E testing
- Vitest - Unit testing
- ESLint - Code linting
- Stylelint - CSS linting
- Commitlint - Commit message validation
- Husky - Git hooks
- 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:all- Run all tests (unit + E2E)
yarn lint- Run all linters (ESLint + Stylelint + TypeScript)yarn lint:fix- Auto-fix linting issuesyarn 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 issuesyarn format- Format code with Prettier
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)
Run both unit and E2E tests:
yarn test:allThe CI pipeline runs automatically on every push and pull request via GitHub Actions (.github/workflows/test.yml):
- 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
Note: E2E 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
- 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 documented in CHANGELOG.md following the Keep a Changelog format.
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(both unit 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 + 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
Distributed under the MIT License. See LICENSE for more information.
