This project is an incentives visualizer designed to estimate electrification incentives for users based on their location on a map.
Follow the instructions below to set up, install, and launch the application.
- Node.js (latest LTS or v16+)
- Yarn (v1.22+)
-
Clone the repository:
git clone https://github.com/rewiringamerica/incentives-visualizer.git cd incentives-visualizer -
Set up the environment:
- Create a
.envfile in the root directory and add your API keys:
MAPTILER_API_KEY=your_maptiler_api_key API_URL=http://localhost:3000 # Production railway instance API_URL=https://apirewiringamericaorg-production.up.railway.app/ - Create a
-
Install dependencies:
yarn install
-
Start the development server:
yarn start
-
The application will be available at
http://localhost:1234by default.
yarn start- Start the development serveryarn build- Build the application for productionyarn generate-types- Generate TypeScript types from the API specyarn test- Run Vitest testsyarn test:playwright- Run Playwright end-to-end testsyarn format- Check formatting with Prettieryarn lint- Lint the code with ESLint
src/- Main source code directorycomponents/- React components (Map, States, Counties, etc.)data/- Static data files and geojson resourceslib/- Utility functions and API helpersstyles/- Tailwind CSS stylestypes/- TypeScript type definitionsmocks/- Mock data for development and testingassets/- Static assets like images and icons
test/- Test filese2e/- Playwright end-to-end tests
- React 19
- TypeScript
- Tailwind CSS
- Parcel bundler
- MapLibre GL for map rendering
- Material UI components
- Vitest and Playwright for testing