Development Notes
Key Decisions
- Payment model: Host connects own Stripe. TravelBed invoices commission monthly (5% of completed bookings).
- No marketplace in Phase 1. Direct booking only via host URLs.
- Single property per host in v1. Multi-property is v1.5+.
- iCal sync every 15 minutes to prevent double-bookings.
- Domain registration via Cloudflare Registrar โ at-cost pricing, host pays ยฃ15-25/year.
Architecture Notes
- Multi-tenant: single Next.js codebase, domain routing determines host context
- Row-level security in PostgreSQL (Neon) for host data isolation
- Middleware resolves custom domains โ host slug
- All host sites served from same deployment
Environment
- Dev DB: Neon dev branch (free tier)
- Prod DB: Neon main branch
- Hosting: Vercel (auto-deploy from main branch)
- DNS: Cloudflare (free, unlimited zones)
- Email: Resend
- Auth: NextAuth.js (Google SSO, email magic link)
TODO / Open Questions
- [ ] Finalise commission percentage (currently 5%)
- [ ] Root domain support testing with Vercel
- [ ] Apple SSO implementation (deferred)
- [ ] Two-way iCal sync (Phase 2)
- [ ] Marketplace discovery portal (Phase 2)