A web app for UCSC students to find, rate, and add bathroomsβwith a focus on cleanliness, privacy, and accessibilityβall anonymously.
npm installCopy .env.local.example to .env.local and fill in:
cp .env.local.example .env.localYou need:
- Supabase URL & Key: Create a free project at supabase.com
- Google Maps API Key: Get one at Google Cloud Console
- Go to your Supabase project β SQL Editor
- Copy and paste everything from
supabase-schema.sql - Click "Run" to create tables
npm run devOpen http://localhost:3000 π
Brathroom_app/
βββ app/ # Next.js App Router pages
β βββ layout.js # Root layout (wraps all pages)
β βββ globals.css # Global styles with Tailwind
β βββ page.js # Home page (map + bathroom list)
β βββ add/page.js # Add new bathroom
β βββ bathroom/[id]/
β βββ page.js # Bathroom detail page
β βββ review/page.js # Add review form
βββ components/
β βββ Map.js # Google Maps component
βββ lib/
β βββ supabase.js # Supabase client setup
β βββ utils.js # Helper functions (device ID, distance calc)
βββ supabase-schema.sql # Database schema (run in Supabase)
βββ .env.local.example # Environment variables template
βββ README.md
| Purpose | Technology |
|---|---|
| Frontend Framework | Next.js 16 (React with App Router) |
| Styling | Tailwind CSS |
| Database | Supabase (PostgreSQL) |
| Maps | Google Maps JavaScript API |
| Deployment | Vercel (recommended) |
- Map with bathroom pins
- List of bathrooms (sorted by distance if location enabled)
- Search by name/building
- Filters (wheelchair accessible, single stall, gender neutral)
- Click bathroom β go to detail page
- Click pin on map β go to detail page
- Name, building, features (tags)
- Average ratings (cleanliness, accessibility, privacy)
- All reviews with comments
- "Add Review" button
- 3 sliders (1-5) for cleanliness, accessibility, privacy
- Optional comment
- Anonymous (uses device hash)
- Name and building fields
- Click map to place pin (or uses your location)
- Accessibility checkboxes
- Submit β appears on map immediately
id UUID (primary key)
name TEXT
building TEXT
lat FLOAT8
lng FLOAT8
wheelchair_accessible BOOLEAN
single_stall BOOLEAN
gender_neutral BOOLEAN
grab_bars BOOLEAN
automatic_door BOOLEAN
created_at TIMESTAMPid UUID (primary key)
bathroom_id UUID (foreign key β bathrooms)
cleanliness INTEGER (1-5)
accessibility INTEGER (1-5)
privacy INTEGER (1-5)
comment TEXT (optional)
device_hash TEXT (for spam control)
created_at TIMESTAMPβ
Anonymous usage - No login required
β
Browse bathrooms - Map + list view
β
Filter & search - By accessibility, building, etc.
β
Distance sorting - "Near me" using geolocation
β
Rate bathrooms - 3 categories (cleanliness, accessibility, privacy)
β
Add bathrooms - Click map to place pin
β
Anti-spam - Device-based hashing (can't spam reviews)
- Push your code to GitHub
- Go to vercel.com β Import Project
- Add environment variables:
NEXT_PUBLIC_SUPABASE_URLNEXT_PUBLIC_SUPABASE_ANON_KEYNEXT_PUBLIC_GOOGLE_MAPS_API_KEY
- Deploy! β¨
Your Supabase database stays hosted on Supabase automatically.
- On first visit, app generates a random
deviceId(UUID) - Stored in
localStorage(stays on your browser) - Before submitting review, deviceId is hashed using SHA-256
- Only the hash is stored in the database (privacy-friendly)
- Prevents multiple reviews from same device
- Uses browser's
navigator.geolocation.getCurrentPosition() - Calculates distance with Haversine formula (client-side)
- No server-side geo queries needed for MVP
@googlemaps/react-wrapperhandles API loading- Click map β place marker β get lat/lng
- Bathroom pins are clickable β navigate to detail page
Create .env.local in the root:
# Supabase (get from supabase.com β Project Settings β API)
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key-here
# Google Maps (get from console.cloud.google.com)
NEXT_PUBLIC_GOOGLE_MAPS_API_KEY=your-maps-api-key-here- Check your Google Maps API key is correct
- Make sure you enabled "Maps JavaScript API" in Google Cloud Console
- Check browser console for errors
- Check Supabase URL and anon key are correct
- Make sure you ran
supabase-schema.sqlin Supabase SQL Editor - Check browser console for errors
rm -rf node_modules package-lock.json
npm install- β All core pages (home, detail, review, add)
- β Google Maps with clickable pins
- β Supabase integration (database + queries)
- β Anonymous reviews with spam protection
- β Distance sorting
- β Accessibility filters
- β Mobile-responsive design
- β Ready for Vercel deployment
Included:
- Browse bathrooms (map + list)
- View details and ratings
- Add reviews anonymously
- Add new bathrooms
- Filter by accessibility
Not included (can add later):
- User accounts/login
- Photo uploads
- Hours of operation
- Reporting system
- Server-side geo queries
Built with β€οΈ for UCSC students