Crowd-sourced pothole map made with react.js, FastAPI, and TypeScript. Custom API authenticates admin users via login credentials to allow deletion of points, while everyone else can add/report new points. Geolocation integration allows for making points at current location. Fully functional mobile website.
- Python 3 (3.10+ recommended)
- Node.js (current LTS is fine; the app uses Next.js 16)
From the repository root:
python -m venv .venv
source .venv/Scripts/activate # Windows: .venv\Scripts\activate
pip install -r API/requirements.txt
python API/main_api.py- API: http://127.0.0.1:8000
- Swagger UI: http://127.0.0.1:8000/docs
- Database:
potholes.dbis created next tomain_api.pywhen the server runs.
Leave this process running while you work on the frontend.
In a second terminal, from the repo root:
cd potholemap
npm install
npm run devOpen the URL Next prints (usually http://localhost:3000).
The app talks to the API at http://127.0.0.1:8000 by default (see potholemap/lib/api.ts). CORS in main_api.py allows localhost / 127.0.0.1 on any port, so a different dev port is fine.
If the API is not at 127.0.0.1:8000, set this before npm run dev:
export NEXT_PUBLIC_API_URL=http://127.0.0.1:8000(Windows CMD: set NEXT_PUBLIC_API_URL=http://127.0.0.1:8000.)
| Step | What to run |
|---|---|
| Python deps | pip install -r requirements.txt (inside a venv) |
| API | python main_api.py → port 8000 |
| JS deps | cd potholemap && npm install |
| Web app | npm run dev → usually port 3000 |
API.md— HTTP routes, curl examples, and request/response shapes for the FastAPI server.backend/app.py— separate minimal Flask sample (different API shape and SQLite file). The map app usesmain_api.py, not this Flask app, unless you wire it up yourself.