A modern, real-time web application for tracking community fridge and pantry status, built with Next.js, TypeScript, Tailwind CSS, and Supabase.
- π Interactive Map & List View - View all community fridges with real-time status
- π΄ Live Status Updates - Color-coded markers (Open, Stocked, Needs Items, Closed)
- π¦ Inventory Tracking - See what's available (produce, canned goods, dairy, etc.)
- πΈ Photo Timeline - View recent photos and status updates
- π Item Requests - See what items are needed
- βοΈ Post Updates - Add status updates with photos and notes
- π· Photo Upload - Upload photos with automatic EXIF stripping
- π Update Inventory - Toggle availability of 7 item categories
- π― Request Items - Submit requests for needed items
- β Fulfill Requests - Mark item requests as fulfilled
- πΊοΈ Route Management - View and claim volunteer routes
- π Schedule Routes - Pick dates to complete route checks
- β Route Checklist - Step-through interface for checking each fridge
- π Condition Reports - Record fridge condition and notes
- π Complete Routes - Mark routes as completed
- πͺ Fridge Management - Create and manage fridge locations
- π£οΈ Route Creation - Build routes with multiple fridge stops
- π Reports & Analytics - View weekly activity and high-need fridges
- π₯ User Management - Manage user roles and permissions
- Frontend: Next.js 14+ (App Router), TypeScript, Tailwind CSS
- UI Components: shadcn/ui (Radix UI primitives)
- Forms: React Hook Form + Zod validation
- Database & Auth: Supabase (PostgreSQL + Row Level Security)
- Storage: Supabase Storage (photo uploads)
- Maps: Leaflet (React Leaflet)
- Deployment: Vercel
- Node.js 18+ and npm
- A Supabase account and project
- Git
```bash git clone cd wefrigerator ```
```bash npm install ```
- Create a new project at supabase.com
- Go to SQL Editor in your Supabase dashboard
- Run the migration files in order:
- `supabase/migrations/001_initial_schema.sql`
- `supabase/migrations/002_rls_policies.sql`
- `supabase/migrations/003_storage_buckets.sql`
- (Optional) Run `supabase/seed.sql` for sample data
Copy `.env.example` to `.env.local`:
```bash cp .env.example .env.local ```
Update with your Supabase credentials:
```env NEXT_PUBLIC_SUPABASE_URL=your_supabase_project_url NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key ```
Find these in your Supabase project settings under API.
```bash npm run dev ```
Open http://localhost:3000 in your browser.
- Sign in using the magic link authentication
- Go to your Supabase dashboard β Table Editor β `profile`
- Find your user and update the `role` column to `'admin'`
- `profile` - User profiles with roles (visitor, contributor, volunteer, admin)
- `fridge` - Community fridge locations with coordinates
- `fridge_status` - Append-only status log with photos
- `fridge_inventory` - Current inventory snapshot (boolean toggles)
- `item_request` - Community item requests
- `pickup_window` - Scheduled pickup/dropoff times
- `route` - Volunteer routes
- `route_fridge` - Routes β Fridges mapping
- `route_assignment` - Volunteer route claims
- `route_check` - Per-fridge checks during routes
All tables have RLS enabled with policies for:
- Public read access for most data
- Authenticated-only writes
- Role-based permissions for admin actions
- Owner-based permissions for updates
``` app/ βββ page.tsx # Home page (map + list) βββ fridge/[id]/page.tsx # Fridge detail page βββ update/[fridgeId]/page.tsx # Status update form βββ requests/[fridgeId]/new/ # Item request form βββ volunteer/routes/ # Volunteer routes βββ admin/ # Admin pages βββ auth/login/ # Authentication βββ profile/ # User profile βββ actions/ # Server actions components/ βββ ui/ # shadcn/ui components βββ FridgeMap.tsx # Map component βββ FridgeCard.tsx # Fridge list card βββ StatusTimeline.tsx # Status history βββ UpdateForm.tsx # Status update form βββ RouteClaimCard.tsx # Route claiming βββ RouteStepper.tsx # Route completion lib/ βββ supabase/ # Supabase clients βββ validators.ts # Zod schemas βββ types.ts # TypeScript types βββ utils/ # Utility functions supabase/ βββ migrations/ # SQL migrations βββ seed.sql # Sample data ```
- Push your code to GitHub
- Import your repository in Vercel
- Add environment variables in Vercel dashboard
- Deploy!
Make sure to set these in your Vercel project settings:
- `NEXT_PUBLIC_SUPABASE_URL`
- `NEXT_PUBLIC_SUPABASE_ANON_KEY`
- Sign in with your email (magic link)
- Find a fridge on the map or list
- Post an update with current status, photo, and inventory
- Request items that are needed
- Mark requests as fulfilled when donated
- Become a volunteer - Contact an admin to change your role
- View routes in the Volunteer section
- Claim a route by selecting a date
- Complete the route by checking each fridge
- Submit condition reports for each stop
- Add fridges with name, location, and accessibility info
- Create routes grouping fridges by area
- View reports to see weekly activity
- Manage fridges - activate/deactivate locations
- π’ Green (Open) - Fridge is accessible
- π΅ Blue (Stocked) - Recently restocked
- π Amber (Needs) - Low on supplies
- β« Gray (Closed) - Currently unavailable
- Semantic HTML structure
- ARIA labels and roles
- Keyboard navigation support
- Color-blind friendly design (icons + labels, not color alone)
- Alt text for all images
- Row Level Security (RLS) on all tables
- EXIF GPS data stripped from photos
- File size and type validation
- Rate limiting on uploads
- Role-based access control
- Offline-first PWA for volunteers
- SMS/Email notifications for high-priority needs
- Multi-language support (Spanish, etc.)
- Photo ML for automatic condition detection
- CSV import for bulk fridge additions
- Weekly impact reports (PDF export)
- Mobile apps (React Native)
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
MIT License - feel free to use this for your community!
For issues or questions:
- Open an issue on GitHub
- Check existing issues for solutions
- Review the Supabase documentation
wefrigerator is built with β€οΈ for communities working to reduce food insecurity.
Special thanks to:
- Community fridge organizers and volunteers
- Open source contributors
- The Next.js and Supabase teams