Skip to main content

Prerequisites

Before you begin, make sure you have the following installed:

Getting started

1

Clone the repository

Clone the project from GitHub:
git clone https://github.com/MateoKania/crypto.git
cd crypto
2

Install dependencies

Install all project dependencies. Choose your preferred package manager:
npm install
The npm install step also runs husky via the prepare lifecycle script, which sets up the pre-commit hook automatically.
3

Start the development server

Start the Vite dev server:
npm run dev
4

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 in package.json.
ScriptCommandDescription
devviteStart the Vite development server with HMR at http://localhost:5173
buildvite buildCompile and bundle the app for production into dist/
previewvite previewServe the production build locally for testing before deployment
linteslint .Run ESLint across all .js and .jsx files
formatprettier . --writeFormat all files in place using Prettier
format:checkprettier . --checkCheck formatting without writing changes (useful in CI)
hostvite --hostStart the dev server exposed on your local network (useful for testing on mobile devices)

Running scripts

npm run dev
npm run build
npm run lint
npm run format

Pre-commit hooks

The project uses Husky and lint-staged to enforce code quality automatically before every commit. Husky is installed via the prepare lifecycle script in package.json, so the hook is set up automatically when you run npm install:
package.json
"scripts": {
  "prepare": "husky"
}
What the pre-commit hook does:
  • 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.
If you need to skip the pre-commit hook in an emergency (not recommended), you can use git commit --no-verify. Use this sparingly.

Build docs developers (and LLMs) love