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