A web application for mapping and visualizing data using Supabase and React.
- Add github action backup for Supabase database https://supabase.com/docs/guides/deployment/ci/backups
- 🗺️ Interactive mapping with Leaflet
- ✏️ Draw and edit geometric features (polygons, lines, points)
- 👥 Multi-user project management
- 🔐 Authentication with Supabase Auth
- 📊 GeoJSON data storage and visualization
- Schema Overview
- Quick Start
- Backend Mode: Local vs Online
- GitHub Pages Deployment
- Database Management
- Development Commands
- Dev Tips
| Table | Purpose | Key Fields | Relationships |
|---|---|---|---|
projects |
Main project workspace | id (UUID), name, description, project_meta (boundaries/config), created_at |
Referenced by project_members and geo_features |
project_members |
User access control | project_id (UUID), user_id (UUID), role (default: 'editor') |
Links projects ↔ users |
geo_features |
Map drawings/shapes | id (UUID), project_id, name, description, submission_id, geom (GeoJSON), created_at |
Belongs to a project |
spatial_ref_sys |
PostGIS coordinate systems | srid, auth_name, srtext, proj4text |
System table for map projections |
- Users can be members of multiple Projects (many-to-many via project_members)
- Each Project can have many Geographic Features (one-to-many)
- Project Members have roles:
owneroreditor(default: 'editor')- Both roles can create, update, delete, and view geometries
- All geographic data is stored as GeoJSON in the
geomfield
- Node.js (v18 or higher)
- Docker (for local mode)
- Supabase CLI (for local mode)
-
Clone the repository
git clone <repository-url> cd nur-colab-map
-
Install dependencies
npm install
-
Choose your backend mode (see Backend Mode below)
-
Run the development server
npm run dev
The app will be available at
http://localhost:5173
The application can run with either a local Supabase instance (for development) or an online Supabase project (for production/staging).
Best for: Production, staging, or if you don't want to run Docker locally.
- Create a project at supabase.com
- Get your project URL and anon key from Settings → API
- Copy
.env.exampleto.envand fill in your credentials
If connecting to an existing database, you're done - the schema and data are already there.
If setting up a new database, continue with:
-
Reset the database schema:
- Go to SQL Editor in your Supabase dashboard
- Copy and run the contents of
supabase/nuclear_reset.sql - This will drop all existing tables and recreate the schema from migrations
-
Seed test data (optional):
- Go to Authentication → Users → Add User
- Create a user with your own email and a strong password
- In
supabase/seed_data.sql, settarget_emailto that email - Go to SQL Editor and run the contents of
supabase/seed_data.sql - The script creates:
- Testimony project
- Pink Line project
- Memorial Sites project
- Adds your selected user as an editor to all projects
Best for: Development, testing, or when you want full control over your database.
Local mode runs Supabase services in Docker containers on your machine.
-
Install Supabase CLI (if not already installed)
npm install -g supabase
-
Start Docker Desktop
Make sure Docker is running on your machine.
-
Start local Supabase services
supabase start
-
Copy environment variables
Copy
.env.exampleto.envand use the local credentials shown in the terminal output. -
Reset database (applies migrations + seed data)
supabase db reset
This creates a local-only test user and project automatically.
This repo includes a GitHub Pages workflow at .github/workflows/deploy-pages.yml.
Set these in Settings -> Secrets and variables -> Actions:
VITE_SUPABASE_URLVITE_SUPABASE_ANON_KEY
supabase/seed.sql creates a local development test user:
| Field | Value |
|---|---|
test@gmail.com |
|
| Password | password |
Local mode only: This user is automatically added as owner of a "Test Project" when you run supabase db reset.
Cloud mode: Do not use shared demo credentials. Create a user with your own email and strong password, set target_email in supabase/seed_data.sql, then run it.
If you need to completely reset your cloud database:
- Go to SQL Editor in your Supabase dashboard
- Run
supabase/nuclear_reset.sqlto drop everything and recreate the schema - Create a real user in Auth (your email + strong password)
- Set
target_emailinsupabase/seed_data.sql - Run
supabase/seed_data.sqlto add project data and memberships
- Local mode: Run
supabase db resetto apply all migrations - Online mode: Run migrations manually in the Supabase SQL Editor
# Start app locally (alias of dev)
npm start
# Start development server
npm run dev
# Build for production
npm run build
# Preview production build
npm run preview
# Lint code
npm run lint
# Format code
npm run format
# Check code formatting
npm run format:checkThis project uses Prettier for code formatting and ESLint for code quality checks.
The .git-blame-ignore-revs file is configured to ignore formatting-only commits in git blame. To enable it, run:
git config blame.ignoreRevsFile .git-blame-ignore-revsWhen you make a commit that only reformats code (e.g., running npm run format), add the commit SHA to .git-blame-ignore-revs to keep blame history clean.
