Self-hosting walkthrough — launch your shop's app step by step
This walkthrough takes you from nothing to a live booking app for your dive shop. You do not need to be a programmer. Most of it is creating accounts and clicking buttons on websites; a couple of steps ask you to copy-paste a few commands into a terminal, and each one is spelled out exactly. Budget an afternoon the first time.
What it costs: the free tiers of GitHub, Supabase, and Cloudflare comfortably run a small shop — you can launch for $0. You'll only pay later if you outgrow the free limits or add a paid custom domain.
Accounts you'll create (all free to start):
| Service | What it does for you |
|---|---|
| GitHub | Stores your shop's own small repository and runs its deploy buttons |
| Supabase | Your database + logins (where bookings and diver accounts live) |
| Cloudflare | Hosts the actual website your divers visit |
| A Gmail account | Sends booking-confirmation emails |
On your own computer, one time: install Node.js (pick the "LTS" button) and Git. These let you run the copy-paste commands below. You do not need Docker.
How it fits together: FunDive itself stays where it is, on GitHub. Your shop gets its own small repository holding only what is yours: your settings, your logo and photos, and the names of your servers. Your repository points at the FunDive version it runs, and the npx fundive commands build and deploy the app from the two together.
Part 1 · Create your shop's repository
Open a terminal and run these (
my-shopcan be any folder name):shnpx github:fundive/fundive init my-shop cd my-shop npm install cp .env.example .env.localmy-shopnow holds your settings file (fundive.config.ts), an emptypublic/folder for your images, your private credentials file (.env.local, which never leaves your computer), and two deploy buttons for GitHub.Put it on GitHub: New repository → name it (say
my-shop) → Create repository, without adding a README. Then, in the terminal (replace<your-username>):shgit init -b main git add -A git commit -m "my shop" git remote add origin https://github.com/<your-username>/my-shop.git git push -u origin main
Part 2 · Create your database (Supabase)
In Supabase, click New project. Give it a name, pick a region near your divers, and write down the database password it generates.
Wait ~2 minutes for it to finish, then open
.env.localin any text editor and fill in the Supabase lines:Line in .env.localWhere to find it VITE_SUPABASE_URLProject Settings → API → Project URL VITE_SUPABASE_ANON_KEYProject Settings → API → the anonpublickeySUPABASE_PROJECT_REFProject Settings → General → Reference ID (a short code like abcdefghij)SUPABASE_DB_PASSWORDthe password from step 1 SUPABASE_POOLER_HOSTthe Connect button at the top of the project → Session pooler: the host part of that connection string, like aws-0-ap-east-1.pooler.supabase.comSUPABASE_ACCESS_TOKENyour account menu → Access Tokens → Generate new token Keep the
service_rolekey from Project Settings → API handy too; you'll need it in Part 7 if you turn on push notifications. Save the file.Build the database's tables:
shnpx fundive db pushAnswer
Ywhen it asks. When it finishes without red errors, your database is ready.npx fundive db verifylists every migration as applied.
Part 3 · Make it your shop
fundive.config.ts— your shop's name, website, timezone, currency, language, gear list and prices, and which of the two designs you want. Every field is explained in configuration.md.- Images in
public/— your logo and icons, at the paths listed underassetsinfundive.config.ts(for examplepublic/imgs/fd_logo.pngfor the logo). Anything you leave out shows FunDive's placeholder. The list is in configuration.md § 2. - Terms of Use — written inside the app, not in a file. Once you are running, sign in as an admin and open Manage → Terms of Use, then click Load starter template and fill in every
TODO. Have someone check the legal side before you go live.
Save your changes to GitHub whenever you like: git add -A && git commit -m "shop settings" && git push.
Part 4 · Get an anti-spam key (Cloudflare Turnstile)
The sign-up form uses a free "are you human?" check.
- In the Cloudflare dashboard, open Turnstile → Add widget. Enter your site's domain (you can use the temporary one from Part 5 and update it later).
- Put the Site Key in
.env.localasVITE_TURNSTILE_SITE_KEY, and keep the Secret Key for Part 6.
Part 5 · Put the website online (Cloudflare)
Get two Cloudflare values and put them in
.env.local: the Account ID (on the right of the Workers & Pages page) asCLOUDFLARE_ACCOUNT_ID, and an API token (My Profile → API Tokens → Create Token → "Edit Cloudflare Workers" template) asCLOUDFLARE_API_TOKEN.Publish:
shnpx fundive build npx fundive deployYour app is live at a
https://fundive-app.<your-subdomain>.workers.devaddress (shown in the Cloudflare dashboard under Workers & Pages). To give the server your shop's name instead, changenameinwrangler.tomlbefore this first deploy. Your own domain can be added later inwrangler.toml(see deployment.md § The app worker).
Rather click a button than run commands? Your repository has a Deploy button: in GitHub, Settings → Secrets and variables → Actions → New repository secret, add the values from your .env.local (the list is in deployment.md § GitHub Actions), then Actions → Deploy → Run workflow. Useful when more than one person ships, or when you would rather not keep the credentials on a laptop.
Part 6 · Turn on booking emails
Registration confirmations are sent from your Gmail.
In your Google account, turn on 2-Step Verification, then create an App Password (a 16-character code just for this app).
In your terminal (still in your shop's folder), run:
shnpx fundive functions deploy npx supabase secrets set --project-ref <your-Reference-ID> \ GMAIL_USER=<your-gmail-address> \ GMAIL_APP_PASSWORD=<the-app-password> \ TURNSTILE_SECRET=<the-Turnstile-Secret-Key>The first command uploads the app's server functions along with your shop's settings, so emails carry your shop's name. The second gives them your Gmail and the Turnstile Secret Key from Part 4. Emails now send on every registration.
Part 7 · (Optional) Push notifications
Booking reminders and admin broadcasts are optional. If you want them, follow push-notifications.md — it walks through generating the notification keys, setting the push worker's secrets, and deploying it with npx fundive deploy push. You can skip this and add it any time; the app works fine without it.
Part 8 · Make yourself the admin
Open your live app and sign up like a normal diver would, with your own email.
In Supabase, open SQL Editor → New query, paste this (with your email), and click Run — it promotes your account to administrator:
sqlupdate public.profiles set role = 'admin' where id = (select id from auth.users where email = 'you@yourshop.com');Refresh the app — you now have the admin menu (create dives, manage divers, logistics, and so on).
Part 9 · Go-live checklist
- [ ] Your logo, design, and shop details look right (
fundive.config.ts+ images). - [ ] A test booking works end-to-end and you received the confirmation email.
- [ ] Terms of Use reviewed for your jurisdiction.
- [ ] (Optional) Your own domain on the app worker (
wrangler.toml). - [ ] A visible link to your source code is present in the app — this is required by the license (see License). Your app is FunDive plus your repository's settings, run over the network, so AGPL §13 obliges you to offer users that source; a public shop repository that names the FunDive version it pins does it.
Closing down one day? shutdown.md is this walkthrough in reverse: what to settle first, how to take your records with you, and the order to switch things off in.
Keeping up to date: new FunDive versions arrive when you move the version your package.json points at; deployment.md § Upgrading is the four steps.
Stuck? Open an issue on the FunDive repo, or read the deeper docs — deployment.md maps every key to where it goes, and configuration.md covers the config fields in detail.