Documentation
Staybnb
A production-grade short-stay rental marketplace. Three apps — guest storefront, admin dashboard, and a REST API — in one Turborepo with shared Postgres, auth, payments, and design tokens. Thank you for your purchase.
Stack
Live demos
Features
✦Listings, categories, amenities & galleries
✦Map search, destinations & wishlists
✦Guest bookings with host accept / decline
✦Experiences & services
✦Stripe payments, wallet & refunds
✦Host applications & co-hosts
✦Reviews, chat, notifications & reports
✦Admin: users, listings, bookings, content
✦JWT + Firebase OAuth
✦i18n storefront
✦ImageKit / Cloudinary uploads
✦Docker Postgres, Postman, Swagger
Requirements
- Node.js ≥ 18 (v22 LTS recommended) and pnpm 9
- PostgreSQL 14+ — Docker (port 5434) or managed
- Docker Desktop (optional, for local Postgres)
- Stripe account (test keys to start)
- Optional: Firebase, ImageKit/Cloudinary, SMTP
Quick start
Get a fully seeded marketplace running locally.
# 1. Install
pnpm install
# 2. Env files
cp apps/api/.env.example apps/api/.env
cp apps/admin/.env.example apps/admin/.env
cp apps/web/.env.example apps/web/.env.local
# 3. Local Postgres (host port 5434)
pnpm db:up
# DATABASE_URL=postgresql://staybnb:staybnb@localhost:5434/staybnb?schema=public
# 4. Migrate + seed
pnpm setup
pnpm seed
# 5. Run all apps
pnpm devDefault accounts
Admin — admin@staybnb.com / Admin1234!
Host — host1@staybnb.test / Password1!
Guest — guest1@staybnb.test / Password1!
Change all passwords before any public deploy.
Installation
- 1Unzip & install. At the monorepo root run
pnpm install. Always use pnpm. - 2Environment. Copy each app’s
.env.example. API needsDATABASE_URLandJWT_SECRETat minimum. - 3Database.
pnpm db:upstarts Docker Postgres on 5434, or pointDATABASE_URLat managed Postgres. - 4Migrate & seed.
pnpm setupthenpnpm seed. - 5Run.
pnpm devorpnpm dev:web/dev:admin/dev:api/dev:site.
Configuration
Key environment variables (see each app’s .env.example):
| Variable | Purpose |
|---|---|
| DATABASE_URL | Postgres connection (required) |
| JWT_SECRET | Signs tokens (required) |
| CLIENT_URL | Web origin — https://staybnb.reactbd.com |
| ADMIN_URL | Admin origin — https://admin.staybnb.reactbd.com |
| STRIPE_SECRET_KEY | Stripe secret |
| STRIPE_WEBHOOK_SECRET | whsec_… webhook signing |
| IMAGEKIT_* / CLOUDINARY_* | Media uploads |
| FIREBASE_* | Social OAuth (optional) |
| SMTP_* | Transactional email (optional) |
Third-party services
Stripe
- Create keys at dashboard.stripe.com → set
STRIPE_SECRET_KEY. - Webhook → API payments route →
STRIPE_WEBHOOK_SECRET. - Match test/live mode between keys and webhook secret.
Firebase OAuth (optional)
- Create a Firebase web app; copy public config into web/admin env.
- Enable providers (Google, GitHub, etc.).
- API needs the Admin service account for token verification.
Media & email
ImageKit (primary) or Cloudinary in apps/api. SMTP enables verification and booking mail.
Project structure
apps/
web/ Guest storefront (Next.js 16, i18n, maps)
admin/ Admin dashboard (Vite + React + shadcn)
api/ REST API (Express 5 + Prisma 7)
site/ Product marketing + /docs (this app)
packages/
ui/
eslint-config/
typescript-config/Docker: apps/api/docker-compose.yml → staybnb-postgres on host 5434.
Development
| pnpm dev | All apps via Turborepo |
| pnpm dev:web / :admin / :api / :site | Single app |
| pnpm build | Build all |
| pnpm db:up / db:down | Docker Postgres |
| pnpm db:migrate / db:studio | Prisma |
| pnpm seed | Demo data |
Roles
Guest
Default on register. Browse, wishlist, book, review.
Host
Listings & booking management. Via hosting application approval, seed user, or admin role change.
Admin
Full dashboard. Seeded as admin@staybnb.com, or promote in Prisma Studio / DB.
Admin guide
- •Sign in at admin.staybnb.reactbd.com (or localhost:5173).
- •Listings — approve, edit, feature, reject.
- •Bookings — stays, payments, cancellations.
- •Users — search, roles, flags.
- •Hosting applications — approve new hosts.
- •Content — banners, blogs, categories, amenities.
Customization
Brand
Primary is #FF385C. Tokens: apps/web/src/app/globals.css and apps/admin/src/index.css. Logos under each app’s public/.
Content
Managed in admin or via apps/api/scripts seed scripts.
i18n
Locales under apps/web/src/i18n.
Deployment
Production demos: staybnb.reactbd.com (client) and admin.staybnb.reactbd.com (admin).
Client
https://staybnb.reactbd.com
Set as CLIENT_URL
Admin
https://admin.staybnb.reactbd.com
Set as ADMIN_URL
Typical split: web on Vercel/Cloudflare, admin as static Vite build, API on Node host, Postgres on Neon. Marketing + docs: deploy apps/site (this app).
pnpm --filter api build
pnpm --filter web build
pnpm --filter admin build
pnpm --filter site build
pnpm --filter api db:deploy # production DATABASE_URLGo-live security checklist
- ☐Strong unique
JWT_SECRET - ☐Live Stripe keys + verified webhook
- ☐Change seeded passwords; remove demo users
- ☐Real
CLIENT_URL/ADMIN_URLfor CORS - ☐Postgres SSL; not public
- ☐Replace demo media
- ☐HTTPS + rate limits on API
- ☐Disable dummy payment flags in production
Troubleshooting
Ports already in use
Stop whatever holds 3000 / 5173 / 8000 / 5432. Local Postgres uses 5434 on purpose.
Database connection refused
Start Docker, run pnpm db:up, fix DATABASE_URL, then pnpm db:deploy.
CORS / API blocked
Origins must match CLIENT_URL / ADMIN_URL and apps/api/config/appOrigins.ts.
Stripe payments don’t confirm
Missing or wrong-mode STRIPE_WEBHOOK_SECRET. Recreate the webhook and match test/live keys.
Cannot open admin
User role must be admin. Use seed credentials or promote via Prisma Studio.
Support & license
Purchase support follows your checkout terms. Include OS, Node version, exact command, and error output when asking for help.
Contact: www.reactbd.com/contact
One license = one end product. See LICENSE. Thank you for choosing Staybnb.