Functional Requirement Document (FRD)
This Functional Requirement Document specifies what PubCrawl does from a behavioral perspective: its modules, pages, features, customer/host/admin/influencer flows, validation, and the business rules that govern them. It complements the Business Requirement Document by translating goals into concrete, testable functionality across the storefront, the customer, host and influencer portals, and the admin CMS — all served from one Next.js 16 application.
Module Overview
PubCrawl groups functionality into nine functional areas. Crawl listing and booking are part of the free core; premium integration providers unlock via CreativeCape add-on licensing.
| # | Module | Purpose |
|---|---|---|
| 1 | Catalogue | Public crawl/host browsing with search, filters, and reviews |
| 2 | Booking & Checkout | Departure selection, spot reservation, extras, coupons/gift cards, and payment |
| 3 | Payments | PayPal online gateway + offline methods (Bank Transfer); pluggable driver registry |
| 4 | Departures & Spots | Scheduled departures with fixed spots, atomic spot claiming, availability |
| 5 | Customer Portal | The /customer area — bookings, payments, wishlist, reviews, messaging, support |
| 6 | Host (Guide) | The /host portal — crawl listings, calendar/departures, reservations, earnings, payouts |
| 7 | Admin / CMS | The /admin panel — listings, bookings, guides, customers, marketing, content, settings |
| 8 | Add-ons & Licensing | 53 channel integration providers, license/purchase-code activation |
| 9 | Auth | Customer, host and admin sessions, OTP/email verification, social sign-in, RBAC |
Catalogue
Public storefront under / (the (site) route group).
| Route | Page |
|---|---|
/ |
Homepage (hero, sections, featured content) |
/listings |
Crawl catalogue with search, theme, pace, price, and sort filters |
/listings/[slug] |
Crawl detail — departures, what's included, reviews, pricing |
/booking/checkout, /booking/confirmed |
Spot checkout and booking confirmation |
/blogs, /blogs/[slug] |
Marketing blog listing and post |
/become-a-host, /how-it-works |
Host onboarding and marketing pages |
/gallery, /about, /contact, /faq, /enquiry |
CMS / marketing pages |
Capabilities:
- Published-crawl catalogue with faceted filtering (theme, pace, format, price, location) and sorting; results are cached for hot public pages.
- Crawl detail renders the description, what's included (amenity groups), scheduled departures with per-departure availability, ratings (
rating_avg/rating_count), approved reviews, and nearby places. - Crawl categorisation via
listing_master_items(theme / format / focus tags); host profiles aggregate crawl count and rating. - Paid extras (e.g. a photo package) surface on the crawl page and are selectable at checkout.
Booking & Checkout
APIs under /api/v1/bookings and /api/v1/listings.
- Availability —
GET /api/v1/listings/[slug]/availabilityreturns eachexperience_sessionsrow withseats_total/seats_bookedso the client can render bookable departures and remaining spots. - Quote —
POST /api/v1/listings/[slug]/quotere-prices a proposed booking server-side (departure, spot count,booking_modeper_person|private, extras) and returns the deposit and full amounts without creating a booking. - Coupons & gift cards — coupons support
PERCENTorAMOUNTdiscounts, a minimum total, a max-discount cap, redemption limits, a validity window, and scoping; gift cards are validated forACTIVEstatus, currency, and balance. - Payment methods —
GET /api/v1/bookings/payment-methodslists the active gateways for the method picker. - Booking creation —
POST /api/v1/bookings/checkoutre-prices server-side, re-validates the coupon, and claims spots atomically (seats_total - seats_booked >= seats), creating abookingsrow keyed to thesession_idwith the chosenseatsandbooking_mode. The customer pays deposit or full; online gateways return a redirect/approval, offline methods return apendingbooking. - Verification —
POST /api/v1/bookings/payand the verify/return routes confirm payment with the driver and finalise the booking (recording abooking_paymentsrow).
Payments
- Built-in online gateway: PayPal (Orders v2, redirect flow) using client-id/secret with
test/live/sandboxmodes. - Offline method: Bank Transfer — creates a
pendingbooking fulfilled by admin "Mark as Paid". - Deposit or full. The customer may choose to pay a deposit or the full amount; the split is computed server-side from the crawl/departure pricing — never trusted from the client.
- Pluggable driver registry: premium gateways (e.g. Stripe, Razorpay, and more) ship as self-contained add-on drivers, configured in admin settings.
- Active gateway configuration is read from the
integration_connectionstable (channelPAYMENTS), with secrets decrypted server-side only.
Departures & Spots
Booking statuses: pending, confirmed, cancelled, refunded.
- Departures. Each crawl (
listings) runs on scheduledexperience_sessions(departures) with a fixedseats_total;seats_bookedtracks claimed spots. A departure is bookable while spots remain and its date/time is in the future. - Atomic spot claiming. On checkout the requested spot count is claimed in a single guarded update (
seats_total - seats_booked >= n) so two customers cannot oversell the same departure. - Booking modes.
per_personbooks individual spots at the per-spot price;privatebooks the whole departure for a party. - Cancellations & refunds. Tiered cancellation policies (flexible / moderate / firm / strict / non-refundable) determine the refund amount from the policy and lead time. Both customer-initiated and host-initiated cancellations are supported; spots are released on cancellation and the request enters the admin refund approval queue (
booking_refunds). Email/WhatsApp/SMS notifications are sent. - Extras & notes —
booking_extrasrecords paid add-ons on a booking;booking_notesandbooking_emailscapture internal notes and the message trail.
Customer Portal
Portal under /customer (customer session, dynamically rendered to reflect live theming).
| Route | Purpose |
|---|---|
/customer/dashboard |
Overview: upcoming bookings, spend, recent activity |
/customer/bookings |
All bookings with status; open a booking for full detail |
/customer/bookings/[public_id] |
A single booking — departure, spots, payments, cancel/refund |
/customer/payments |
Payment history and invoices |
/customer/wishlist |
Saved crawls |
/customer/reviews |
Reviews you've written on crawls you've joined |
/customer/messages |
Messaging with hosts |
/customer/notifications |
In-app notifications |
/customer/support |
Support tickets |
/customer/settings |
Profile, addresses, password, preferences |
Host (Guide)
Portal under /host (host session).
| Route | Purpose |
|---|---|
/host/dashboard |
Hosting overview |
/host/listings |
Author crawls (details, what's included, departures) |
/host/calendar |
Departures calendar — schedule departures and spots |
/host/reservations |
Incoming bookings and their status |
/host/inbox |
Messaging with customers |
/host/insights |
Occupancy and revenue analytics |
/host/payouts |
Earnings and payout requests |
/host/billing |
Host subscription plan to list crawls |
/host/reviews |
Customer reviews with host replies |
/host/settings |
Host profile and settings |
Admin / CMS
Panel under /admin/(panel) (admin session, permission-gated).
- catalogue — listings (crawls), departures, master-data (themes / formats / focus), extras, amenities.
- bookings (with per-booking detail and Mark as Paid), refunds (approval queue), customers, guides, dashboard (revenue/analytics).
- marketing — coupons, gift-cards, partners, testimonials, leads. subscription — host subscription plans.
- Content/CMS — pages, blogs (+ categories), hero-slider, gallery, faqs, reviews, about, menus, theme builder, builder-pages.
- influencers — affiliate accounts, commissions, payouts.
- settings sections include: channels/integrations, notifications (email/sms/whatsapp/in-app/push/webhook) + notification-log, languages, currencies, countries, locations, invoice, theme, roles, permissions, users, api-tokens, webhooks, license, master-data, advanced, activity.
Add-ons & Licensing
- PubCrawl ships 53 channel integration providers across categories — Payments, Email, Storage, Analytics, Calendar, CAPTCHA, Realtime Chat, AI Chatbot, Live Chat, SMS, Social Auth, WhatsApp.
- Free defaults include SMTP (email), PayPal + Bank Transfer (payments), Cloudflare R2 (storage), and GA4 (analytics); other providers are premium.
- Gating. A premium provider serves only when unlocked. Activation is per-add-on via an Envato-style purchase code entered in admin → Add-ons, exchanged once for an RS256 JWT bound to
{ addon, domain }and then verified offline on every check; the domain license can also grant entitlements ("*", a channel id, or"channel:provider"). Localhost/dev hosts are unlocked. - Toggling. Server-side gates (
premiumBlock/featureBlock) and the clientuseFeatureActive()hook check installation and entitlement before exposing a feature.
Auth & Permissions
| Aspect | Customer / Host / Influencer | Admin |
|---|---|---|
| Session cookie | portal session (HS256 JWT, 30 days) | admin_token (HS256 JWT, 7 days default) |
| Routing | portal by account role (customer / host / influencer) | Direct admin login |
| Verification | Email/OTP via email, SMS, or WhatsApp | — |
| Social sign-in | OAuth providers (e.g. Google, Facebook) when configured | — |
| Authorization | Role-based portal access, owner-scoped queries | Fine-grained resource:action matrix |
- Auth routes (
/(auth)):login,register,forgot-password,reset-password,verify-email. - OTP/verification delivery channel is admin-configurable; a QA test-contact/test-code bypass exists for staging.
- Admin RBAC —
permissions-catalog.tsdefines resources × CRUD actions;requirePermission(action, resource)enforces per route and returns 403 when denied, emitting an audit event on mutations. System/super roles bypass the matrix.
Validation & Business Rules
- Server-side re-pricing: booking totals, deposits, coupons, and gift-card balances are recomputed on the server at booking time — never trusted from the client.
- File uploads pass through the server to R2/S3; images are processed (resize/convert) with sharp before storage.
- BR-A Spots are claimed atomically; a booking is created only if
seats_total - seats_booked >= seats. - BR-B A booking is confirmed only when payment (deposit or full) succeeds; offline bookings require admin Mark as Paid.
- BR-C Cancellations release spots and compute a tiered refund routed through the admin approval queue.
- BR-D Premium add-ons require a valid entitlement or purchase code (dev/localhost unlocked).
- BR-E Integration secrets are stored AES-256-GCM encrypted and never returned to clients.
- BR-F Admin mutations are permission-checked and audited.
For functional questions or feature requests, contact support at creative-cape.com.
© CreativeCape Solutions · creative-cape.com · support@creative-cape.com