A full-stack GIS tool: upload aerial/satellite imagery, get automatic object detection where a free pretrained model can do it, manually annotate where it can't, and see class-wise cost/area/ count analytics plus a KDE hotspot heatmap on a satellite map.
No demo/seed data. Every project starts empty. Everything on the dashboard comes from images you actually upload and objects that are actually detected or annotated.
- Automatic detection for "Vessel": a pretrained YOLOv8n model (ONNX, CPU-only, no CUDA/GPU needed) runs on upload. COCO's 80 classes include "boat", so vessel detection is genuinely automatic — no training required. This was verified end-to-end during development: upload → detect → geo-referenced polygon → dashboard, all live, no mocking.
- Manual annotation canvas for everything else (Dock, Seawall, Ramp, or any custom class): drag to draw a box on the uploaded image, pick a class, save. Also verified working end-to-end.
- Geo-referencing: when you upload an image you can set its corner lat/lon coordinates. Every detection/annotation on that image gets converted from pixel coordinates to a real GeoJSON polygon (centroid + area in sq ft) using that bounding box. Images without bounds can still be annotated but won't appear on the map or in dashboard totals — the UI tells you this.
- Dashboard: cost bar chart, area distribution chart, count donut chart, all reading live aggregated data from the backend, filterable by All/Residential/Commercial.
- Hotspot map: Leaflet + a real KDE heatmap (
leaflet.heat) with working Blur/Radius sliders. - Multi-project support: create, switch between, and manage multiple projects. New projects auto-create a starter class set (Dock, Vessel, Seawall, Ramp) so there's no blank-page problem.
cd backend
python3 -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
uvicorn app.main:app --reload --port 8000Runs at http://localhost:8000. Interactive API docs at http://localhost:8000/docs. First run
downloads nothing extra — the YOLOv8n ONNX model (app/ml_models/yolov8n.onnx, ~12MB) is already
included in this repo.
cd frontend
npm install
npm run devRuns at http://localhost:5173, proxying /api/* to the backend on :8000 (see
vite.config.ts). Open it, create a project, and go.
./deploy.sh
# or directly:
docker compose up --buildFrontend at http://localhost:8080, backend at http://localhost:8000. Data persists in named
Docker volumes (backend_uploads, backend_db) across restarts.
Backend → Render:
- Push this repo to GitHub.
- In Render, "New Web Service" → connect the repo → it should pick up
render.yamlautomatically (Blueprint deploy), or manually set: Docker runtime, root./backend, Dockerfile./backend/Dockerfile. - Add a persistent disk if you want uploaded images/DB to survive restarts (see
render.yaml— free tier may not support this; check Render's current pricing). - Note the resulting URL, e.g.
https://coastalpulse-api.onrender.com.
Frontend → Vercel:
- Import the repo, set root directory to
frontend. - Build command
npm run build, output directorydist(already invercel.json). - Add an environment variable
VITE_API_BASE= your Render backend URL from above. - Deploy.
Backend CORS: once you have a real frontend domain, tighten allow_origins=["*"] in
backend/app/main.py to your actual Vercel domain.
backend/
Dockerfile
requirements.txt
app/
main.py FastAPI app + all routes (projects, classes, images, annotations, detect, dashboard)
models.py SQLAlchemy models
schemas.py Pydantic request/response schemas
detection.py YOLOv8n ONNX inference (real, CPU-only)
geo_utils.py Pixel<->geo conversion, polygon centroid/area
database.py DB engine setup (env-configurable DATABASE_URL)
ml_models/yolov8n.onnx Pretrained COCO weights (~12MB, included)
frontend/
Dockerfile, nginx.conf, vercel.json
src/
api.ts API client (env-configurable API base)
types.ts Shared TS types
components/
CostBarChart.tsx, AreaDistributionChart.tsx, CountDonutChart.tsx
MapView.tsx, HeatmapLayer.tsx, HotspotWidget.tsx
AnnotationCanvas.tsx Real interactive drag-to-draw annotation tool
TopNav.tsx, PropertyTypeFilter.tsx
pages/
DashboardPage.tsx
SetupWizard.tsx Classes / Images (geo bounds) / Annotation / Parameters
docker-compose.yml
render.yaml
deploy.sh




