Prerequisites
Before you begin, ensure you have the following installed:- Node.js (v18 or higher)
- pnpm (v10.30.3 or higher)
Installation
- Clone the repository:
- Install dependencies:
- Set up environment variables:
.env and add your Mapbox API key:
You can obtain a free Mapbox API key from mapbox.com
Available Scripts
The project includes several npm scripts for development:Development Server
Start the development server with hot module replacement:http://localhost:5173. The --host flag allows access from other devices on your network.
Build
Create a production build:- Runs TypeScript type checking (
tsc --noEmit) - Builds the application with Vite
- Outputs to the
dist/directory
Preview
Preview the production build locally:http://localhost:4173.
Linting
Check code quality with oxlint:Formatting
Check code formatting with Prettier:Project Structure
The project uses Vite with the following configuration:- Source root:
./src - Build output:
../dist - Environment variables:
../.env
Tech Stack
- Framework: React 19
- Build Tool: Vite 7
- State Management: Jotai
- Styling: Tailwind CSS 4
- Maps: Mapbox GL JS via react-map-gl
- TypeScript: Strict configuration
Development Workflow
- Start the development server:
- Make your changes
- Run tests:
- Check linting and formatting:
- Build to verify production build works:
Troubleshooting
Port already in use
If port 5173 is already in use, Vite will automatically try the next available port.Module resolution errors
Try clearing the node_modules and reinstalling:Mapbox not loading
Ensure yourVITE_API_KEY_MAPBOX environment variable is set correctly in .env. Environment variables must be prefixed with VITE_ to be accessible in the browser.