Booki Documentation

Local Development

Local dev URL patterns for each Booki app, *.localhost subdomain setup, and branch slug routing.

Each Booki app runs on a separate port. One app requires a subdomain in the local URL to simulate the multi-tenant pattern used in production.

Quick Reference

AppLocal URL PatternExample
cms-booki-web-apphttp://localhost:3000/http://localhost:3000/
owner-booki-web-apphttp://localhost:3001/http://localhost:3001/
customer-booki-web-apphttp://{slug}.localhost:3002/{branchSlug}http://janesbeautysalon.localhost:3002/pampanga
admin-booki-web-apphttp://localhost:3003/http://localhost:3003/

CMS, Owner & Admin Apps

These apps have no tenant context in the URL. Access them directly on their port — no subdomain required.

http://localhost:3000/   # cms-booki-web-app
http://localhost:3001/   # owner-booki-web-app
http://localhost:3003/   # admin-booki-web-app

Owner App

The owner app runs directly on its port — no subdomain required. The organization context is derived entirely from the authenticated user's JWT (req.user.organizationId) after login.

http://localhost:3001/

Customer App — Subdomain + Branch Slug

The customer app requires both a subdomain (organization slug) and a URL path segment (branch slug).

http://{slug}.localhost:3002/{branchSlug}

# Example
http://janesbeautysalon.localhost:3002/pampanga

What each part does:

PartExampleInjected as
Subdomainjanesbeautysalonx-tenant-slug header
Path segment/pampangax-branch-slug header

The branch slug comes from the [branchSlug] dynamic route parameter. A client plugin syncs it to state on every navigation and injects it into all API requests via a $fetch interceptor.

Default branch redirect

Visiting http://{slug}.localhost:3002/ (no branch slug) triggers an automatic redirect. The app calls GET /api/v1/tenant/{slug}/default-branch and navigates to /{defaultBranchSlug}.


*.localhost Subdomain Support

Chrome and Edge resolve *.localhost natively — no /etc/hosts changes are needed. Just start the app and open the subdomain URL directly.

Firefox does not resolve *.localhost by default. Enable it in about:config:

  1. Open about:config and accept the warning.
  2. Search for network.dns.localDomains.
  3. Set its value to localhost.
  4. Restart Firefox.

BASE_DOMAIN for Local Development

When running locally, set BASE_DOMAIN=.localhost in each app's .env so that auth cookies are scoped correctly across *.localhost subdomains. Using .booki.app locally will prevent cookies set on janesbeautysalon.localhost from being sent to other subdomains.

# Local development
BASE_DOMAIN=.localhost

# Production
BASE_DOMAIN=.booki.app