A full-stack PWA for managing and sharing household chores among roommates, built with Cloudflare Workers, D1 Database, and React.
- 🏠 Multiple Homes: Create homes and share join codes (6-character codes) with roommates
- ✅ Chore Management: Create recurring or one-time chores with default effort estimates
- 📅 Calendar View: See who completed what chores on each day
- 📊 Statistics: Track effort by member, chore completion rates, and activity timelines
- 📱 Progressive Web App: Installable on mobile with offline support via service worker
- 🚀 Cloudflare Powered: Runs entirely on Cloudflare Workers and D1 SQLite database
clean-share/
├── src/ # Cloudflare Workers backend
│ ├── index.ts # Main API router
│ ├── routes.ts # Homes and members endpoints
│ ├── chores.ts # Chores, completions, and schedules endpoints
│ ├── utils.ts # Helper functions
│ └── types.ts # TypeScript types
├── frontend/ # React + Vite frontend
│ ├── src/
│ │ ├── api.ts # API client
│ │ ├── AppContext.tsx # Global app state
│ │ ├── App.jsx # Main app component
│ │ └── components/ # React components
│ │ ├── HomeScreen.tsx # Join/create home screen
│ │ ├── Dashboard.tsx # Main dashboard with tabs
│ │ ├── ChoreList.tsx # Chore list and completion
│ │ ├── CalendarView.tsx # Calendar with activity
│ │ └── Statistics.tsx # Charts and stats
│ └── public/
│ ├── manifest.json # PWA manifest
│ └── sw.js # Service worker
├── migrations/ # Database migrations
│ └── 0001_init_schema.sql # Initial schema
└── wrangler.jsonc # Cloudflare configuration
- Node.js 18+
- Cloudflare account
- Wrangler CLI (installed via npm)
-
Install dependencies:
npm install cd frontend && npm install && cd ..
-
Create D1 database (first time):
wrangler d1 create clean-share --remote wrangler d1 execute clean-share --remote --file migrations/0001_init_schema.sql
-
Update database ID in
wrangler.jsonc: -
Run locally:
npm run dev
- Backend: http://localhost:8787
- Frontend (separate):
cd frontend && npm run dev(http://localhost:5173)
-
Build and deploy:
npm run deploy
This builds the frontend and deploys both backend and frontend to Cloudflare.
-
Access your app:
- Visit
https://clean-share.your-account.workers.dev
- Visit
POST /api/homes- Create home (returns: home data with join code)GET /api/homes/:homeId- Get home details with membersPOST /api/homes/join- Join home with code (body: join_code, member_name)
GET /api/homes/:homeId/members- List membersGET /api/homes/:homeId/members/:id- Get memberPUT /api/homes/:homeId/members/:id- Update member
GET /api/homes/:homeId/chores- List choresGET /api/homes/:homeId/chores/:id- Get chorePOST /api/homes/:homeId/chores- Create chorePUT /api/homes/:homeId/chores/:id- Update chore
GET /api/homes/:homeId/completions- List completions (query: member_id, chore_id, from, to)POST /api/homes/:homeId/completions- Log completion (body: chore_id, completed_by_member_id, effort_minutes, notes)
GET /api/homes/:homeId/schedules- List upcoming schedules (query: from, to)
6-character alphanumeric codes for inviting roommates to homes. Generated on home creation.
- one_time: Single chore (creates one schedule entry)
- daily: Every day
- weekly: Every 7 days
- biweekly: Every 14 days
- monthly: Every 30 days
On completion, the next schedule is automatically generated based on repetition type.
- Each chore has a default effort in minutes
- When completing a chore, you can override the effort
- Statistics aggregate total effort per member and per chore
- Install as app on mobile/desktop
- Offline functionality via service worker
- Network-first caching for API calls with 5-second timeout fallback
- Cache-first for static assets
- Backend: Add endpoints in
src/(routes.ts, chores.ts, or new file) - Frontend: Add React components in
frontend/src/components/ - Database: Add migrations in
migrations/following the naming convention - Update types: Keep
src/types.tsand component interfaces in sync
The D1 database includes:
homes: Home records with join codesmembers: Members of each homechores: Chore templates with repetition settingschore_completions: Logged completions with actual effortchore_schedules: Upcoming chore occurrences
Main theme color is #667eea. Update in:
frontend/src/components/*.csswrangler.jsonc(theme_color)frontend/public/manifest.json
Set REACT_APP_API_URL environment variable or update in frontend/src/api.ts
Replace database ID in wrangler.jsonc to use different D1 database
Frontend not loading: Ensure npm run build:frontend completed successfully and dist/ exists
API errors: Check Network tab in DevTools, verify API endpoints match src/index.ts
Database errors: Ensure D1 database ID is set correctly in wrangler.jsonc
Service worker issues: Clear cache/storage in DevTools, or access in private/incognito window
MIT