Project Info
Inspiration
Our inspiration came from the idea of doing something fun and silly. We wanted to create something that could create an impact in our school, and as we talked, the topic of what bathrooms people should use compared to others came up, and we thought, why not rate them?
What it does
Our project lets users add bathroom locations and leave reviews that other users can see. The added bathrooms can then receive multiple reviews from anonymous users, who can voice their complaints or praise a particular bathroom.
How we built it
We built it using GitHub and other technologies listed below. We split up the work, made a list, checked off the boxes of what each of us got done, and added newer ones when new problems or ideas arose.
Challenges we ran into
The big challenge we ran into was getting a project api keys for Google Maps. As we had to search through many documents and read the fine print, we dont want to spend any money on API calls. For the Google Maps API specifically, a billing method must have been added. Even if we had only used the free version, we closely monitored API calls to ensure we didn't exceed the free limit during testing.
Accomplishments we're proud of
An accomplishment we are proud of is how far we have come. As we worked on this project, many new ideas kept popping into our heads, and as more and more problems arose, we were able to fix them and create a project we are proud of.
What we learned
We learned how UX design can significantly affect users' interactions with the app. We also learned how to really collaborate on the same project with others: we didn't want to mess with each other's code, but we also needed to code on the same file.
What's next
We came up with a lot of ideas on how we could continue to expand and work on this project to even maybe other UC campuses, or even have a full application version on users' phones.
UCSC Restroom Radar
A web app for UCSC students to find, rate, and add bathroomsβwith a focus on cleanliness, privacy, and accessibilityβall anonymously.
π Quick Start (3 Steps)
1. Install Dependencies
npm install
2. Set Up Environment Variables
Copy .env.local.example to .env.local and fill in:
cp .env.local.example .env.local
You need:
- Supabase URL & Key: Create a free project at supabase.com
- Google Maps API Key: Get one at Google Cloud Console
3. Set Up Database
- Go to your Supabase project β SQL Editor
- Copy and paste everything from
supabase-schema.sql - Click "Run" to create tables
4. Run the App
npm run dev
Open http://localhost:3000 π
π Project Structure
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
πΊοΈ Tech Stack
| 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) |
π Pages & User Flows
1. Home Page (/)
- 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
2. Bathroom Detail (/bathroom/[id])
- Name, building, features (tags)
- Average ratings (cleanliness, accessibility, privacy)
- All reviews with comments
- "Add Review" button
3. Add Review (/bathroom/[id]/review)
- 3 sliders (1-5) for cleanliness, accessibility, privacy
- Optional comment
- Anonymous (uses device hash)
4. Add Bathroom (/add)
- Name and building fields
- Click map to place pin (or uses your location)
- Accessibility checkboxes
- Submit β appears on map immediately
ποΈ Database Tables
bathrooms
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 TIMESTAMP
reviews
id 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
π Key Features
β
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)
π’ Deployment
Deploy to Vercel (Easiest)
- 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.
π οΈ How It Works
Anonymous Anti-Spam
- 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
Distance Calculation
- Uses browser's
navigator.geolocation.getCurrentPosition() - Calculates distance with Haversine formula (client-side)
- No server-side geo queries needed for MVP
Google Maps Integration
@googlemaps/react-wrapperhandles API loading- Click map β place marker β get lat/lng
- Bathroom pins are clickable β navigate to detail page
π Environment Variables
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
π Troubleshooting
Map not showing?
- Check your Google Maps API key is correct
- Make sure you enabled "Maps JavaScript API" in Google Cloud Console
- Check browser console for errors
Can't add bathroom/review?
- Check Supabase URL and anon key are correct
- Make sure you ran
supabase-schema.sqlin Supabase SQL Editor - Check browser console for errors
"Module not found" errors?
rm -rf node_modules package-lock.json
npm install
π¦ What's Included
- β 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
π― MVP Scope
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
π Learn More
Built with β€οΈ for UCSC students
Analysis
View
Metric
- 10
- 5
Figures cover GitHub contributors during the hackathon window. A co-authored commit counts in full for each author, so per-member totals add up to more than the whole-team figures.
Technology
- CSSIn code
- JavaScriptIn code
- Next.jsIn code
- ReactIn code
- SQLIn code
- SupabaseIn code
- Tailwind CSSIn code
7 of 7 appear in the indexed code.
AI coding agents
No AI coding agent signals were found in this repository.
Detected from committed agent config files and commit authorship. Absence of a signal is not proof an agent was unused.
Codebase size
Source size
48 KB
Source files
16
Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.
Repository
AntPad27/Brathroom_app
21 files Β· 362 KB Β· @ cbf8ae4
Structure
Interface
7 files Β· 33%Screens, components and styles rendered to the user.
Application logic
2 files Β· 10%Domain rules, services and shared utilities.
Data & schema
1 file Β· 5%Schema definitions, migrations and data access.
Supporting
Layers are inferred from where files sit in the tree, not from reading the code. A project that names its directories unconventionally will read oddly here β open the file browser to check anything the diagram implies.
Languages
- JavaScript56%
- Markdown40%
- SQL4%
- CSS0%
Share of indexed source by file size. Binary and vendored files are excluded.
Dependencies
package.json
npm Β· 9- @googlemaps/react-wrapper
- @supabase/supabase-js
- @tailwindcss/postcss
- autoprefixer
- next
- postcss
- react
- react-dom
- tailwindcss
Declared in the repositoryβs manifests at the indexed commit. A declared package is not proof it is used, and runtime dependencies are listed first.
This projectβs features have not been analysed yet.
Export this project's context (description, README, evidence, key source files) to chat with an AI agent elsewhere.