# Set up and deploy - [Run it locally](#run-it-locally) to try the app with fictional data and simulated integrations. You can complete this path without cloud accounts. - [Deploy to the cloud](#deploy-to-the-cloud) to host your own installation and connect the services you choose. ## Run it locally 1. Install Node 24, npm, and a Docker-compatible container runtime. Start the container runtime. Clone this GitHub repository and enter its root. 2. Run `npm ci`, then `node scripts/local.mjs`. It starts local Supabase, seeds synthetic records, and writes the ignored `.env.local` without displaying keys. If you run several project stacks on one machine, stop the previous stack with `npm exec supabase -- stop` before starting this one. Each standalone demo uses ports 3000 and 54320–54324. 3. Run `npm run dev -- --hostname 127.0.0.1`. Visit `http://127.0.0.1:3000`, open the workspace, and sign in as `owner@example.test` with `LocalDemo-2026!`. These are local-only synthetic credentials. The sample vendor account is `vendor@example.test` with the same demo password. 4. Run `npm run check`, `npm run test:db`, and `PLAYWRIGHT_CHROME=1 npm run test:e2e` with desktop Chrome installed. For Playwright Chromium instead, install it with `npx playwright install chromium` and use `npm run test:e2e`. The tests exercise real local Supabase and simulated providers. 5. To reset a disposable local demo, run `npm run db:reset` and then `npm run demo:seed`. This resets the selected local application's database. Back up any demo edits you want first. The demo uses a local mail viewer, local database, synthetic accounts, and simulated provider events. You'll see when a queued message is simulated and when a test checkout completes. ## Deploy to the cloud Use this path when you want an online installation. Set up the cloud accounts, configure the app, then verify the workflow with test data before enabling live integrations. ### Accounts for a hosted installation Set up Supabase and Vercel first. The owner setup sends an invitation through Supabase Auth. This guide uses Resend SMTP for that email and for later invitations and sign-in links. The separate Resend API key is for app email, such as updates and reminders. | Account | When you need it | What to prepare | | --- | --- | --- | | GitHub | **Required** for GitHub access and the Vercel Git import | Access to the source repository. To deploy through the CLI without a Git connection, see the Hobby instructions below. | | Vercel | **Required** for hosting with this guide | An account and project for this installation. Use Pro or Enterprise to deploy the configured five-minute cron schedule for messages and reminders. | | Supabase | **Required** for data and sign-in | A separate project per installation with Postgres, Auth, and Storage. Use a PostgreSQL 17 project or a supported later major version. Set the Auth site URL and callback before inviting users. | | Resend and a domain you control | **Required for the documented email setup** | Verify a sending domain. Configure Resend SMTP in Supabase Auth to deliver owner and team invitations and sign-in links. Add a Resend API key for live app email and notifications. | | Twilio | **Optional** for SMS or call forwarding | A business number with the capabilities you use. For SMS, prepare a registered sender where required and a Messaging Service with Advanced Opt-Out. | | Google Cloud | **Optional** for Google sign-in | A Google OAuth client for this installation if you enable Google sign-in. Configure Google's authorized redirect URI exactly as shown in Supabase. | | Stripe | **Optional** for online payments | One Stripe account per installation. Start with test keys and a test webhook. An operator connects the account and explicitly enables live payments after verification. | An agent may be able to guide setup while you create accounts, verify a domain, approve OAuth, or enter credentials yourself. Enter secrets directly in the appropriate dashboard or ignored environment file. #### Hosted plan limits For a small hosted installation, you can start with [Supabase Free](https://supabase.com/pricing) and use [Resend Free](https://resend.com/pricing?product=transactional) for eligible email volume. See the [README’s cloud dependency table](../README.md#deploy-it-to-the-cloud) for current quota links and the test options for optional integrations. Free Supabase projects can pause after a week of low activity. Keep domain registration separate from the Resend subscription. #### Daily scheduling on Vercel Hobby The background worker publishes rolling departures, queues pre-departure reminders, offers waitlist spots, processes expired holds, and sends queued emails and texts. A daily run can delay offers and reminders past the departure they concern. Vercel Hobby permits personal, noncommercial use and runs each cron job at most once a day, sometime within the selected UTC hour. Use Pro or Enterprise for commercial use on Vercel and the checked-in five-minute schedule. [Hobby plan](https://vercel.com/docs/plans/hobby) · [Cron limits](https://vercel.com/docs/schedules/cron-jobs/usage-and-pricing) For a personal evaluation, follow the hosted environment setup below. In your own checkout, change only the cron schedule in `vercel.json` from `*/5 * * * *` to `0 18 * * *` or another once-daily UTC time. Keep its endpoint and configure `CRON_SECRET`. Keep `INTEGRATIONS_MODE=disabled` while reviewing setup with test data. For a full simulated workflow, use the local demo. Import a repository owned by your personal account, or deploy a source copy without the `.git` directory using the Vercel CLI. In the source copy, keep the daily cron edit, link your personal Hobby project, and configure its environment variables before running `vercel deploy --prod`. [Git integration limits](https://vercel.com/docs/git) · [CLI deploy](https://vercel.com/docs/cli/deploy) ### Deploy For a first install, create a new Supabase project. The migration files in `supabase/migrations/` set up the app schema, private file storage, and access policies. Use a separate project for any preview with persistent data. 1. From the repository root, run `npm ci` to install the pinned Supabase CLI. Authenticate with `npm exec supabase -- login`. For unattended setup, supply `SUPABASE_ACCESS_TOKEN` through the operator's secret store instead. Use the exact project reference from the Supabase dashboard and disable user self-signup in that project's Auth settings. ```sh npm exec supabase -- link --project-ref YOUR_PROJECT_REF npm exec supabase -- migration list --remote npm exec supabase -- db push --remote ``` Review the linked project and migration list before pushing. If the CLI asks for the database password, enter it directly. Back up an existing installation before applying new migrations. [Supabase CLI setup](https://supabase.com/docs/guides/local-development/cli-workflows) 2. Import the repository in Vercel as a Next.js project with Node 24 and `npm run build`. Use a separate Supabase project for previews that need persistent or writable data. In Vercel, set the URL and publishable key plus the server-side variables from `.env.example` for the intended environment. Set `APP_URL` to the site's HTTPS origin and `APP_TIMEZONE` to your business's default IANA time zone. Each location can specify its own. Generate independent random 32-byte values for `APP_LINK_SECRET` and `CRON_SECRET`. Keep the Supabase service-role key and provider credentials server-only. Vercel sends `CRON_SECRET` as a bearer token to `/api/cron`. 3. In Supabase Auth, set both the site URL and `https://YOUR_APP_HOST/auth/callback` in redirect allowlists. Configure custom SMTP. In the invite email template use a link such as `{{ .RedirectTo }}?token_hash={{ .TokenHash }}&type=invite`. In the magic-link template use `{{ .RedirectTo }}?token_hash={{ .TokenHash }}&type=magiclink`. For Google, enable the provider in Supabase, follow the provider's console prompts, set `GOOGLE_SIGN_IN_ENABLED=true`, and test an invited user. Staff and customer access are provisioned through application profiles. 4. For the first owner, confirm that `APP_URL`, `NEXT_PUBLIC_SUPABASE_URL`, `NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY`, and `SUPABASE_SERVICE_ROLE_KEY` point to the reviewed hosted installation. The invite script reads these values from your shell or ignored `.env.local`. Keep the local demo in a separate checkout or environment file. Run `npm run owner:invite -- owner@your-company.example` with the actual owner address, then test the invitation and sign-in. Owners can invite staff, vendors, and linked customer accounts from Team access. 5. Keep integrations disabled while verifying the setup. To use your own providers set `INTEGRATIONS_MODE=live` and supply keys for the features you want. For Stripe sandbox use a test secret and webhook signing secret. Register `https://YOUR_APP_HOST/api/webhooks/stripe` for Checkout completed, asynchronous success, expired sessions and charge refunds. Follow the Twilio setup below to enable texting or call forwarding. 6. Confirm a staff login, an unrelated user's denied access, the main public-to-workspace workflow, and storage access before go-live. Use a test recipient you control, a Stripe test card, and a test phone number with consent to verify your own provider accounts. A successful local test does not establish live provider delivery. Confirm Vercel logs for cron and use the record's Customer tools tab to see accepted or failed notifications. 7. Follow the [recovery guide](RECOVERY.md) to back up the database and private attachments and rehearse a restore before upgrading. Rotate server secrets in the provider dashboards and the deployed environment. Keep preview and production keys separate. #### Configure Twilio 1. Use a number you control in the Twilio account for this installation. Set the E.164 number in `TWILIO_PHONE_NUMBER` and its owning account SID in `TWILIO_ACCOUNT_SID`. For business texts, complete the applicable sender registration. For U.S. 10DLC, associate the number with the Messaging Service for the approved campaign. [Twilio sender registration](https://www.twilio.com/docs/messaging/compliance/a2p-10dlc) 2. Set the owning account's `TWILIO_AUTH_TOKEN` as a server-side secret for signed webhooks. For SMS, also set `TWILIO_API_KEY` to the API key SID and `TWILIO_API_SECRET` to its secret. The key needs permission to create messages and read a message by SID. The app uses the receive time from Twilio to order consent changes. [Twilio Message resource](https://www.twilio.com/docs/messaging/api/message-resource) 3. Set `APP_URL` to the exact public HTTPS origin Twilio will call. On the number's Messaging Service, enable Advanced Opt-Out. Set incoming messages to HTTP POST at `https://YOUR_APP_HOST/api/webhooks/twilio/sms`, or defer to the number with that same POST URL. Keep the webhook and delivery status endpoints reachable from Twilio without browser sign-in. The app supplies the delivery callback URL on each send. [Twilio Advanced Opt-Out](https://www.twilio.com/docs/messaging/tutorials/advanced-opt-out) 4. For optional voice forwarding, set `TWILIO_VOICE_FORWARD_TO` to the separate business phone that should ring. Configure the voice-capable Twilio number's incoming voice webhook to POST to `https://YOUR_APP_HOST/api/webhooks/twilio/voice`. Leave the forwarding value blank to disable forwarding. 5. Enable `INTEGRATIONS_MODE=live` when you are ready to test the configured account. Use numbers you control with recorded app consent. Send a text and inspect its delivery status, reply from the receiving phone, then send STOP and verify that the app blocks a new text. Send START and verify that an eligible text can be queued again. Call the Twilio number if you enable forwarding. The local demo simulates these flows. [Twilio test credential limits](https://www.twilio.com/docs/iam/test-credentials) The app requires recorded contact consent at queueing and delivery. STOP blocks future texts even when the sender has no matching record. A signed Advanced Opt-Out `START` event with a newer verified Twilio receive time lifts the carrier-related block. The contact's own consent setting still applies. If Twilio reports STOP and START in the same second, STOP wins. If the app cannot verify a START, the block stays active. Confirm message read access and check the webhook delivery in the Twilio Console before retrying. Enable retries for temporary server errors on the incoming SMS webhook. If you configure retry behavior in the webhook URL, append `#rc=2&rp=ct,rt,5xx` there. Keep `APP_URL` set to the HTTPS origin. [Twilio webhook retries](https://www.twilio.com/docs/usage/webhooks/webhooks-connection-overrides#retry-policy) Keep SMS within 1,600 characters including the link and opt-out text. Twilio acceptance is shown as **Sent**. Signed callbacks update that entry to **Delivered** or **Failed** when available. If acceptance is unconfirmed, check the Twilio Messaging logs before sending again. Replies attach to the most recent record that texted the number. First-contact texts without a prior outbound record are visible in Twilio's message logs. #### Initial setup links [Vercel plans](https://vercel.com/legal/terms) · [Supabase local development](https://supabase.com/docs/guides/local-development) · [Supabase Auth SMTP](https://supabase.com/docs/guides/auth/auth-smtp) · [Google sign-in](https://supabase.com/docs/guides/auth/social-sign-in/auth-google) · [Resend verified domains](https://resend.com/docs/dashboard/domains/introduction) · [Twilio SMS](https://www.twilio.com/docs/messaging) · [Twilio Voice](https://www.twilio.com/docs/voice) · [Twilio messaging registration](https://www.twilio.com/docs/messaging/compliance/a2p-10dlc) · [Stripe testing](https://docs.stripe.com/testing) ### Tour deposits and automatic balances After verifying hosted checkout with Stripe test credentials, add the `payment_intent.succeeded` event to this installation’s Stripe webhook. Set `TOUR_AUTO_CHARGE_ENABLED=true` to let the operator enable automatic balances on an activity. Set a deposit and a payment deadline before departure. The customer can authorize one payment up to the displayed limit when they start deposit checkout. Cron claims the charge in the application ledger and uses one provider idempotency key for it. If the card needs customer action after a failed charge, the protected booking page offers hosted checkout. A booking with an unresolved provider response remains in review until a manager reconciles it. Confirm the signed webhook and the unsettled balance before testing with a live key. [Stripe payment status](https://docs.stripe.com/payments/payment-intents/verifying-status) · [Stripe idempotent requests](https://docs.stripe.com/api/idempotent_requests)