Prerequisites
Before you begin, make sure you have the following installed:- Node.js 18 or higher — nodejs.org
- npm, yarn, or pnpm — npm ships with Node.js
- Git — git-scm.com
Getting started
Install dependencies
Install all project dependencies. Choose your preferred package manager:
The
npm install step also runs husky via the prepare lifecycle script, which sets up the pre-commit hook automatically.Open the app
Open http://localhost:5173 in your browser. Vite’s dev server supports Hot Module Replacement (HMR), so changes you make to source files are reflected instantly without a full page reload.
npm scripts
All available scripts are defined inpackage.json.
| Script | Command | Description |
|---|---|---|
dev | vite | Start the Vite development server with HMR at http://localhost:5173 |
build | vite build | Compile and bundle the app for production into dist/ |
preview | vite preview | Serve the production build locally for testing before deployment |
lint | eslint . | Run ESLint across all .js and .jsx files |
format | prettier . --write | Format all files in place using Prettier |
format:check | prettier . --check | Check formatting without writing changes (useful in CI) |
host | vite --host | Start the dev server exposed on your local network (useful for testing on mobile devices) |
Running scripts
Pre-commit hooks
The project uses Husky and lint-staged to enforce code quality automatically before every commit. Husky is installed via theprepare lifecycle script in package.json, so the hook is set up automatically when you run npm install:
package.json
- lint-staged runs linting and formatting checks only on files that are staged for commit, keeping the feedback loop fast.
- If any check fails, the commit is aborted so that broken or poorly formatted code never enters the repository.