Prerequisites
Before you begin, make sure you have Bun installed on your system. Bun is a fast all-in-one JavaScript runtime that we use for package management and running scripts.Installation
Install dependencies
Install all required dependencies using Bun:This will install all packages defined in
package.json, including:- Svelte 5 and SvelteKit
- TypeScript
- Vite
- Development tools (ESLint, Prettier, Vitest)
Available Scripts
The project includes several useful npm scripts defined inpackage.json:
| Script | Command | Description |
|---|---|---|
dev | bun run dev | Start the Vite development server |
build | bun run build | Build the production-ready static site |
preview | bun run preview | Preview the production build locally |
check | bun run check | Run Svelte and TypeScript type checking |
check:watch | bun run check:watch | Run type checking in watch mode |
test | bun run test | Run the test suite with Vitest |
lint | bun run lint | Lint the codebase with ESLint |
format | bun run format | Format code with Prettier and fix linting issues |
Development Workflow
- Start the dev server: Run
bun run devto start developing - Make changes: Edit files in
src/- changes will hot-reload automatically - Check types: Run
bun run checkto verify TypeScript types - Format code: Run
bun run formatbefore committing - Test changes: Run
bun run testto ensure tests pass - Build: Run
bun run buildto create a production build inbuild/
Troubleshooting
Port already in use
If port 5173 is already in use, Vite will automatically try the next available port. Check the terminal output for the actual URL.Dependency issues
If you encounter dependency problems, try removingnode_modules and reinstalling: