Install it, invite your team, take bookings
Chairwise is a booking system for a salon, barbershop or spa that you run as your own business. Clients book a service, a stylist and a time in the client app. The team runs its day in the staff app. The owner, branch managers and the front desk run the calendar, the counter and the business from the admin website.
This guide is written for first-time installers. Every command is shown in full and every setting says where to find it. Read Part 01 to get the server running, Part 02 to connect payments, email and push, and Part 03 to build your two apps.
Get started
Welcome
Thank you for choosing Chairwise. This guide takes you from the download to a running booking system for your salon, barbershop or spa, with your team signed in and your two apps on real phones.
What you get
- The client app (Flutter, Android and iOS): clients pick a branch, one or more services, a stylist or "anyone available" and a time that is really free. They pay a deposit, pay in full or pay at the salon, then manage their visits: add to calendar, directions, reschedule, cancel, review, rebook. Loyalty points, packages and a notification inbox are built in.
- The staff app (Flutter, Android and iOS, from the same code): each stylist's day as a timeline, check in, start and finish, no-shows, walk-ins, the week, their hours, time-off requests and their earnings.
- The admin website for the owner, branch managers and the front desk: the live calendar, bookings, the counter checkout, payments and refunds, clients, staff, time off, services, packages, branches, loyalty, reviews, reminders, reports, the team, settings and a setup check that tests every outside service.
- A public booking website: your menu, your team, your branches, online booking (the same rules as the app, with or without an account), a "manage my booking" link in every confirmation email, the client's own bookings and your legal pages.
- An install wizard and a sample business you can load with one command to try everything.
- One-command self-hosting with Docker: the server (one compiled Rust program that also serves the website), PostgreSQL, MinIO file storage and optional automatic HTTPS with Caddy.
Main features
- Only real free times. A time is offered only when a stylist who can do every chosen service works then, the branch is open, and no break, time off, block or other booking (with its clean-up time) is in the way (chapter 24).
- Never two clients in one chair. Every booking locks the stylist in the database and checks the time again before it saves; the database itself refuses an overlap.
- Each branch on its own clock. Every time is shown in the branch's time zone, on every phone, in every email, across daylight-saving changes.
- Deposits your way. Per service: no deposit, a percentage or a fixed amount. Clients pay the deposit, pay in full or pay at the salon, by your rules (chapter 25).
- Fair cancel and change rules. Free cancellation until a deadline, a limited number of moves, and the fee shown before the client presses the button.
- Reminders 24 hours and 2 hours before, by push and email, each sent exactly once.
- A real counter checkout: extra services, tips, discounts, points, package sessions, cash, card at the desk or a card link.
- Loyalty points and packages ("5 blow-dries for the price of 4"), staff commission and tips, reviews with replies, and reports by day, staff and service.
- A live calendar: a booking made in the app appears on the front desk's screen at once.
- Light and dark themes in both apps.
What it does not do
Chairwise is for one business with one or more branches. It is not a marketplace of many salons. It has no gift cards, no retail stock, no chat between clients and staff (notes on the booking instead), no SMS messages, no waiting list, no video consultations and no AI features. The apps and the website are in English.
What is in the download
| Path | What it is |
|---|---|
apps/backend/ | The server, written in Rust (Axum): the /api/v1 API for the website and the two Flutter apps, the availability engine, the Stripe webhook, the background work and the built website, compiled into one program called chairwise. apps/backend/README.md maps every module. |
apps/frontend/ | The website: React 19, React Router 7, Vite, Tailwind CSS 4 and shadcn/ui. The admin website, the public booking website, sign-in and the install wizard. |
chairwise_mobile_flutter/ | The Flutter project. One codebase that builds two apps by flavour: client and staff. |
migrations/ | The PostgreSQL database schema. The server applies it by itself when it starts. |
docker/, compose.yaml | The Dockerfile, the Docker Compose stack and the Caddy HTTPS config. |
.env.example | Every server setting, explained. Copy it to .env. The apps have their own, chairwise_mobile_flutter/.env.example. |
tools/rename.mjs | One command that gives the apps and the website your name, ids, colour and icons (chapter 17). |
docs/ | This documentation as one HTML file and as a PDF, plus the list of third-party licences. |
README.md, CHANGELOG.md, LICENSE.txt | A one-page quick start, the version history and the licence notes. |
AI disclosure
AI tools used to create this item: Yes
- Source code: Yes. Written with Claude by Anthropic as an AI coding assistant, then reviewed, tested (server tests against a real PostgreSQL, website tests and Flutter widget tests) and integrated by us.
- Documentation: Yes. Written with Claude by Anthropic and checked against the code.
- Graphics: Yes. The two app icons, the chair logo and the screen designs were made with AI help (Claude by Anthropic, working in a design tool and in code). The photos in the live demo and in these screenshots are Pixabay photos by the photographers named in Credits; they are used for the demo only and are not in the download.
- Demo text: Yes. The sample business, its people, its reviews and the starter legal texts were written with Claude by Anthropic. The starter legal texts are a starting point, not legal advice.
AI-powered features in the product: No. Chairwise has no AI features and calls no AI service.
Chairwise works with your own accounts at Stripe, Google (Firebase), Apple and your email and storage providers. It is not made, endorsed or sponsored by any of them.
Screenshots
The main screens, filled with the sample business (chapter 30). Website screens are 1920 × 1080; phone screens are portrait.
Admin website
Booking website
Client app
Staff app
How the parts fit
Three front ends, one server, one database. Everything outside your server is an account of your own.
The parts
- The two apps and the website talk to the same JSON API at
/api/v1over HTTPS. The website is built into the server program, so one address serves both. - The server is one Rust program,
chairwise. It checks every request's role, finds free times, prices and saves bookings, takes Stripe's webhook, sends emails and push messages, and runs the background work below. - PostgreSQL keeps every record, the job queue, the rate limits and the locks that stop double bookings. Times are stored in UTC and money in whole cents.
- File storage keeps the photos of services, staff, branches, packages and categories, profile pictures and your logo: the bundled MinIO, any S3-compatible bucket, or a folder (chapter 12).
Background work
The server does its time-based work itself, in every running copy. Each part is safe to run on several servers at once (chapter 37).
| When | What happens |
|---|---|
| Every 2 seconds | Unpaid card payments whose hold ran out end: the Stripe page is closed, the booking is cancelled by the system, the time is free again (points and a package session go back) and the client is told nothing was charged. |
| Every 30 seconds | Reminders (24 hours and 2 hours before) and review requests that are due go out, each once. |
| Hourly | Loyalty points past their expiry date are removed. Housekeeping clears expired sessions, reset links, old invitations and old job rows. |
| Daily | Accounts deleted more than 30 days ago are purged (chapter 29). |
| Demo only | Once a minute the sample salon's day moves on; at 03:00 in the business's time zone the sample data is rebuilt (chapter 31). |
Work that may need another try, such as a refund Stripe could not take at that moment, waits in a job queue in PostgreSQL. It is retried with a growing wait: 10 seconds, then doubling, at most an hour. JOB_WORKERS (default 4) sets how many jobs each server copy runs at once.
Live updates
Every change (a booking made in the app, a check-in, a payment) is published through PostgreSQL. Each server copy passes it on to its open screens over a Server-Sent Events stream (/api/v1/events). The admin calendar, the bookings list, the checkout queue and the sidebar counts change by themselves. The apps reload when a push arrives and when they come back to the front; the staff app's day also reloads every minute. A proxy in front must not buffer this stream (chapter 7).
Requirements
To run the server (recommended: Docker)
- A 64-bit Linux server (Intel/AMD or ARM) with Docker Engine 24 or newer and Docker Compose 2.20 or newer (the stack uses Compose's
includefeature). Docker Desktop or Colima on macOS, or Docker Desktop on Windows, works for trying it on your own computer. - For the first build (Docker compiles the Rust server and the web app from source): 2 processor cores and 4 GB of memory (or 2 GB plus swap), and about 6 GB of free disk for Docker's build cache. The first build compiles everything and takes the longest; later builds reuse the cache (a rebuild after a small change took about 70 seconds on a cloud server).
docker builder prunegives the cache space back once the app runs. - To run it the server needs far less: the finished app image is about 110 MB, and the app itself uses only a few megabytes of memory when idle. PostgreSQL and MinIO run beside it, so plan at least 1 GB of memory for a small business. You can also build on another computer and run the result on a smaller server; see Put it online.
- A domain name and HTTPS for a public launch. The apps, Stripe and the browsers need a public
https://address with a valid certificate; the bundled Caddy gets one for you for free. - A current version of Chrome, Edge, Firefox or Safari for you and the team.
To build the mobile apps
Flutter on your own computer, Android Studio for the Android apps and a Mac with Xcode for the iOS apps. What you need in Part 03 lists the versions.
To build or change the server without Docker
- Rust 1.90 or newer (stable) from rustup.rs.
- Node.js 24 (22.12 or newer also works) and pnpm 11 (
corepack enableinstalls the pnpm version the project asks for). - PostgreSQL 15 or newer (the Docker stack ships PostgreSQL 17).
- Optional: any S3-compatible storage (MinIO, AWS S3, Cloudflare R2, Backblaze B2…). Without it, files are kept in a local folder.
Accounts you need
| Account | What it is for | Needed |
|---|---|---|
| Stripe | Card payments from clients (deposits, paying in full, packages, card links from the desk) and card refunds. Without it, clients pay at the salon. | To take card payments |
| An SMTP email provider | Booking confirmations, changes, cancellations, reminders, receipts, review requests, password resets and team invitations. Without it, each email is written to the app's log with its link. | For a public launch |
| Firebase (Google, free) | Push notifications to locked phones: booking changes and reminders. Without it, the apps still update live while they are open. | Strongly advised |
| Apple Developer Program and Google Play Console | Publishing the two apps under your own name. | To publish the apps |
| S3-compatible storage | Service and staff photos, profile pictures and your logo. The bundled MinIO does this on the same server. | Optional |
Third-party services and costs
Chairwise has no monthly fee of its own. The outside services it works with belong to other companies. You open the accounts in your own name, and each company bills you directly.
| Service | What Chairwise uses it for | Needed | What you pay for |
|---|---|---|---|
| Stripe | Card payments on Stripe's own Checkout page: deposits, paying in full, packages and the card links the desk sends; refunds back to the card (chapter 10). | Optional: without it, clients pay at the salon | A fee on every successful card payment; Stripe keeps its fee when you refund. |
| An SMTP email provider (Amazon SES, Postmark, Brevo, Mailgun, your own mail server…) | Booking confirmations, changes, cancellations, reminders, receipts, review requests, password resets and team invitations (chapter 11). | For a public launch | Per message or a monthly plan. |
| Firebase Cloud Messaging (Google) | Push notifications to locked phones in both apps (chapter 13). | Strongly advised | Cloud Messaging has no charge per message; other Firebase products you turn on may be billed. |
| Apple Developer Program and Google Play Console | Publishing the client app and the staff app under your own name (chapter 19). | To publish the apps | A yearly fee (Apple) and a one-time registration fee (Google). |
| Apple Maps and Google Maps | "Directions" opens the maps app on the client's phone (Apple Maps on iPhone, Google Maps or any maps app on Android) with the branch's position; the website opens Google Maps' directions page. No account and no key. | Nothing to set up | Nothing for Chairwise's use; the map services have their own terms. |
| Your server and domain (any VPS provider and domain registrar) | Running Chairwise with Docker at your own https address (chapter 7). | Yes | A monthly server fee and a yearly domain fee. |
| S3-compatible storage (AWS S3, Cloudflare R2, Backblaze B2…) | Photos and the logo, when you don't use the bundled MinIO or a folder on the server; needed to run several server copies (chapter 12). | Optional | Space used, and sometimes downloads. |
| HTTPS certificate (Let's Encrypt, through the bundled Caddy) | The https address the apps, Stripe and browsers need. | Yes, on a server | Nothing. |
Every service above is run by another company with its own pricing tiers, and you are responsible for any costs they charge. Prices change: check each company's pricing page before you go live. Each service's own setup chapter says the same.
Install in 10 minutes with Docker
This runs Chairwise on your own computer or on a server. The first build compiles the server from source, so it takes longer than later starts.
- Unzip the download and open a terminal in the
chairwise/folder (the one withcompose.yamlin it). - Create your settings file:
cp .env.example .env - Open
.envin any text editor and fill in these four values:
Change both passwords: the example values are public. KeepAPP_URL=http://localhost:8080 # your public https:// address on a server APP_SECRET=paste-a-random-string-here # make one with: openssl rand -hex 32 POSTGRES_PASSWORD=pick-a-long-password # letters and digits only S3_SECRET_ACCESS_KEY=pick-another-password # at least 8 charactersAPP_SECRETsafe and never change it after the install, because it encrypts the keys you save in Settings. LeaveDATABASE_URLempty: Docker builds the database address from the values above, and that key is only for running the server without Docker. - Build and start everything:
Docker compiles the web app and the Rust server, then starts PostgreSQL and MinIO (file storage), creates the storage bucket and starts the app, which applies the database migrations by itself. Later builds reuse Docker's cache and are much quicker (about a minute after a small change).docker compose up -d --build - Find the install token in the app's log (if the app has restarted, use the last one):
The line readsdocker compose logs app | grep -i "install token"Install token: cw-install-… (open /install and paste it). - Open http://localhost:8080. The install wizard opens: paste the token, check the server, name your business and create the owner's account.
- Optional: load the sample business to see everything with data in it (chapter 30):
docker compose exec app chairwise seed-demo --confirm
See what the app is doing with docker compose logs -f app. Stop it with docker compose down; your data stays in Docker volumes. Use another port by setting APP_PORT=8090 in .env, changing APP_URL to the same port (http://localhost:8090; links in emails and the setup check use it) and running docker compose up -d. The app port is open on this computer only (APP_BIND=127.0.0.1); on a server, visitors come in through HTTPS as the next chapter shows.
A phone cannot reach localhost on your computer. The Android emulator reaches it as http://10.0.2.2:8080; the iOS simulator as http://localhost:8080. A real phone needs the server's https address, so put it online first (next chapter).
If the build stops with "signal: 9" or "killed", the server ran out of memory while compiling. Add swap (for example 4 GB) and run the same command again, or build on a bigger computer and copy the result, as the next chapter explains.
Put it online
For real bookings, Chairwise must be reachable at a public https:// address: the two apps talk to it, Stripe sends its payment webhook to it and clients come back to it after paying.
1. Pick a server (VPS)
| Size | Good for |
|---|---|
| 2 cores, 4 GB memory, 40 GB disk | Building on the server and running a business with several branches, a large team and many bookings a day. |
| 1 to 2 cores, 1 to 2 GB memory | Running a build made on another computer (see "Build on another computer" below), or building with swap added. |
| 4+ cores, 8+ GB memory | Several busy cities on one install. |
Any provider that sells Linux servers with Docker works. Disk use grows mainly with photos, so move files to outside storage once it grows (see File storage).
2. DNS
At your domain registrar, add an A record for the address you want (for example shop for book.yourbrand.com) pointing at your server's IP address. Wait until ping book.yourbrand.com shows that IP.
3. Settings
In .env:
APP_URL=https://book.yourbrand.com
APP_DOMAIN=book.yourbrand.com
TRUSTED_PROXY_HOPS=1
4. Start with HTTPS (Caddy)
When nothing else on the server uses ports 80 and 443, the bundled Caddy does it all. Open both ports in your server's firewall, then:
docker compose --profile https up -d --build
The https profile adds Caddy, a web server that gets and renews a free certificate for APP_DOMAIN by itself. Open https://book.yourbrand.com; the first visit takes a few seconds while the certificate is issued. Caddy passes the live update stream through unbuffered, so the calendar and the apps update at once.
Caddy needs ports 80 and 443 for itself. If Traefik, Nginx Proxy Manager, an Nginx or Apache already owns them, leave out --profile https, start with docker compose up -d --build and let your proxy pass visitors on to Chairwise, as the next part shows.
Behind a proxy you already run
Where the proxy runs decides how it reaches the app:
- Installed on the server itself (Nginx or Apache from the system's packages): point it at
http://127.0.0.1:8080(APP_PORT), the port the app opens on this server only. - In a Docker container (Traefik, Nginx Proxy Manager, an Nginx container): it cannot use
127.0.0.1:8080, because inside a container that address is the container itself. Put the app on the proxy's Docker network instead, with acompose.override.yamlfile next tocompose.yaml. Docker Compose reads it by itself on everydocker composecommand.docker network lsshows the proxy's network name; the examples call itproxy.
Traefik: the labels tell Traefik the address, the entrypoint and the certificate resolver. Use the entrypoint and resolver names from your own Traefik setup (websecure and letsencrypt are common).
# compose.override.yaml: Chairwise behind a Traefik that runs in Docker
services:
app:
networks: [default, proxy] # default: the app's own database and storage
labels:
- traefik.enable=true
- traefik.docker.network=proxy # the same network name
- traefik.http.routers.chairwise.rule=Host(`book.yourbrand.com`)
- traefik.http.routers.chairwise.entrypoints=websecure
- traefik.http.routers.chairwise.tls.certresolver=letsencrypt
- traefik.http.services.chairwise.loadbalancer.server.port=8080
networks:
proxy:
external: true
name: proxy # your proxy's network, as docker network ls shows it
Nginx in a container, or Nginx Proxy Manager: join the network the same way and give the app a name there that no other container uses.
# compose.override.yaml: Chairwise on the network of an Nginx container
services:
app:
networks:
default:
proxy:
aliases: [chairwise]
networks:
proxy:
external: true
name: proxy # your proxy's network, as docker network ls shows it
Then send the traffic to http://chairwise:8080. In Nginx:
location / {
proxy_pass http://chairwise:8080;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_buffering off; # the live updates are a stream
client_max_body_size 21m; # PDF documents and CSV lists go up to 20 MB
}
In Nginx Proxy Manager, add a Proxy Host with scheme http, forward hostname chairwise and port 8080, request its SSL certificate, and paste the last two lines above into the Advanced tab. Keep TRUSTED_PROXY_HOPS=1: Traefik, Nginx and Nginx Proxy Manager each add one address, as the next section explains.
5. Visitor addresses and rate limits
Chairwise limits sign-ins, sign-ups and password resets per visitor address, so nobody can guess passwords at speed. It reads the visitor's address from the X-Forwarded-For header only behind the number of proxies you trust, set with TRUSTED_PROXY_HOPS. A visitor can type any X-Forwarded-For they like, so trusting it without a proxy would let them make up a new address for every try.
| Your setup | Setting |
|---|---|
The bundled Caddy (--profile https) | TRUSTED_PROXY_HOPS=1 (the Docker default). The app port is published on 127.0.0.1 only, so Caddy is the only way in, and Caddy replaces any X-Forwarded-For a visitor sends with the real address. |
| Your own Nginx, Apache or Traefik on the same server, on the host or in Docker (above) | TRUSTED_PROXY_HOPS=1 and keep APP_BIND=127.0.0.1. Turn off response buffering (Nginx: proxy_buffering off;) so the live updates work. |
| A load balancer or CDN in front of your proxy (for example Cloudflare, then Caddy) | TRUSTED_PROXY_HOPS=2: one hop for each proxy that adds an address. Never set a higher number than the proxies really in front of the app. |
| No proxy at all (app port open to the internet) | TRUSTED_PROXY_HOPS=0 and APP_BIND=0.0.0.0. No header is trusted, the per-address limits are off and only the per-account limits apply. The apps and Stripe need HTTPS, so this suits only testing. |
the admin website → Setup check shows the current setting in its "Visitor addresses" row. The full list of limits is in Security notes.
Build on another computer
If your server is small, build the program on a bigger computer with Docker and copy it over. The packed program is one file that already holds the web app.
# on the bigger computer, in the chairwise folder (use --platform linux/arm64 for an ARM server)
docker build -f docker/Dockerfile --target pack -t chairwise-pack --platform linux/amd64 .
docker create --name chairwise-pack-copy chairwise-pack
mkdir -p prebuilt
docker cp chairwise-pack-copy:/chairwise prebuilt/chairwise
docker rm chairwise-pack-copy
# copy prebuilt/chairwise into the same folder on the server, then on the server:
BUILD_TARGET=prebuilt docker compose --profile https up -d --build
Set BUILD_TARGET=prebuilt in .env to keep it for later starts. The program must match the server's processor type (Intel/AMD = linux/amd64, ARM = linux/arm64).
Without Docker
Build the web app, then the server, and run the server behind your own HTTPS proxy:
cd apps/frontend && corepack enable && pnpm install && pnpm build && cd ../..
cargo build --release -p chairwise-server
./target/release/chairwise pack apps/frontend/dist/client ./chairwise
# .env next to where you start it: DATABASE_URL, APP_URL, APP_SECRET; STORAGE_DRIVER=local or your S3 bucket
BIND=127.0.0.1:8080 ./chairwise serve
Keep it running with a service manager such as systemd. The server applies the migrations when it starts; ./chairwise migrate applies them on their own. To load the sample business outside Docker, run ./chairwise seed-demo --confirm from the apps/backend folder, or set DEMO_SEED_DIR=apps/backend/seed.
Other hosts
- Platforms that run a Docker image (most cloud container services): build the image with
docker build -f docker/Dockerfile -t chairwise ., give it a PostgreSQL 15+ database throughDATABASE_URL, an S3 bucket through theS3_*keys (orSTORAGE_DRIVER=localwith a persistent volume at/app/storage), and setAPP_URL,APP_SECRETandTRUSTED_PROXY_HOPSfor the platform's own proxy. The app listens on port 8080. - Managed PostgreSQL works through
DATABASE_URL. - Shared web hosting (cPanel, PHP hosting) cannot run Chairwise: it needs a server that runs Docker or a Linux program.
Two copies on one server
To run a staging copy next to the live one, unzip Chairwise into a second folder and give each copy its own .env:
# .env of the live copy
COMPOSE_PROJECT_NAME=chairwise
APP_PORT=8080
APP_URL=https://book.yourbrand.com
# .env of the staging copy
COMPOSE_PROJECT_NAME=chairwise-staging
APP_PORT=8081
APP_URL=https://staging.yourbrand.com
SEARCH_INDEXING=off
COMPOSE_PROJECT_NAME keeps each copy's containers, database, files, network, image and build cache apart. Left empty, it is the folder's name, so two folders with the same name would share everything: always set it when you run two copies. Give each copy its own passwords and its own APP_SECRET. Only one copy can run the bundled Caddy, so put both behind one proxy you run yourself with a different router name or network alias for each. SEARCH_INDEXING=off keeps search engines away from the staging copy.
Install wizard
The first visit to a new install opens the wizard at /install. It has seven steps and runs once; afterwards the page is locked so nobody else can take the server over. Reloaded the page after making the owner's account? Sign in with it and open /install again within two hours: the wizard carries on where you left it.
- Server checks. Paste the setup token from the app's log (
docker compose logs app | grep -i "install token") and press Check the server. The app prints a new token at every start until the install is finished, so use the last line. Lost it? SetINSTALL_TOKENin.envto a value of your choice and restart the app withdocker compose up -d. The wizard then lists the database, file storage, the app address, email, Stripe, push and the other settings, each marked ready or later. A red line blocks the next step until you fix it. - Your business. The name everyone sees, the support email clients write to, the currency and the time zone.
- First branch. Where clients book: the branch's name, street address, city and phone (both optional), its time zone, its opening hours (each day open or closed, with an optional break such as lunch) and whether clients can book it online. Skip for now leaves it for Admin → Branches; until a branch has opening hours, nobody can book.
- The owner's account. Your name, email and a password of at least 10 characters. The owner can do everything, settings and keys included.
- Payments (Stripe). Your publishable key, secret key and webhook signing secret, with the webhook address to paste into Stripe (chapter 10). Optional now.
- Email (SMTP). The mail server, port, user name, password and the sender. Optional now: until it is set, emails are written to the app's log.
- Finish. You are signed in as the owner and the wizard is locked. It lists what is set up and what is left for later, with the place in Settings where each one is done.
Before the first client books: add your services (Admin → Services), your staff with their skills and weekly hours (Admin → Staff), and any other branches. The setup check tells you what is still missing.
Setup check
Admin website → Setup check (the owner) lists everything a running business depends on, with a plain-words status and what to do about it. Run again checks everything again and then tests every service that can be tested for real; the results replace the rows they test.
| Row | What it shows, and what the test does |
|---|---|
| Database | PostgreSQL is reachable and how many migrations are applied. The test reads the PostgreSQL version. |
| File storage | The S3 bucket, or a warning that files are on this server's disk. The test writes, reads and deletes a small test file. |
| Email (SMTP) | The sender and mail server. The test connects and signs in. Settings → Email sends a real test email to any address you type. |
| Stripe | Whether the secret key is set (test or live mode) and whether the webhook signing secret is there. The test reads your Stripe balance. |
| Push messages | Whether a Firebase service account is saved. Without it, the apps show updates only while they are open. |
| App address | Whether APP_URL is https. The test calls APP_URL/api/health from the server itself. |
| Visitor addresses | The TRUSTED_PROXY_HOPS setting (chapter 7). |
| Branches with opening hours | Red when there is no branch yet, amber when a branch has no opening hours: clients can't book there. |
| Staff with shifts | Red when there is no staff member, amber when someone has no weekly hours: they are never offered. |
| Services with staff | Red when there is no service, amber when nobody can do a service: it can't be booked. |
| Background jobs | Jobs that failed in the last 24 hours or wait too long (refunds, purges, the demo reset). |
| Install | Whether the install wizard has finished. |
Connect services
Card payments (Stripe)
Clients pay by card on Stripe's own Checkout page, into the business's own Stripe account. A payment counts only when Stripe's signed webhook confirms it, so set up the webhook as well as the keys.
Stripe is a third-party payment service with its own pricing, and you pay its fees on every successful card payment. Stripe keeps its fee when you refund. Each country, card and currency has its own rate on Stripe's pricing page.
1. Keys
- Create a Stripe account at stripe.com and switch the Dashboard to Test mode (a sandbox) first.
- Open Developers → API keys and copy the Publishable key (
pk_test_…) and the Secret key (sk_test_…). - Paste them into the admin website → Settings → Payments (Stripe), or into
STRIPE_PUBLISHABLE_KEYandSTRIPE_SECRET_KEYin.env. Use both test keys or both live keys, never one of each.
2. The webhook
- In Stripe, open Developers → Webhooks and add an endpoint (Stripe's newer dashboard calls it Add destination: choose events from Your account, then Webhook endpoint).
- Endpoint URL: your
APP_URLfollowed by/api/v1/webhooks/stripe, for examplehttps://book.yourbrand.com/api/v1/webhooks/stripe. The Payments settings page shows the exact address to copy. - Select these four events:
checkout.session.completed: a payment went through (the booking is confirmed, the package is active).checkout.session.async_payment_succeeded: a slower payment method went through later.checkout.session.expired: the Checkout page closed unpaid.checkout.session.async_payment_failed: a slower payment method failed.
- Copy the endpoint's Signing secret (
whsec_…) into Settings → Payments (Stripe), orSTRIPE_WEBHOOK_SECRETin.env. Without it no payment would ever be confirmed, and the setup check says so.
3. Payment methods
Checkout shows the payment methods you turn on in Stripe → Settings → Payment methods. Prefer instant ones: cards, Apple Pay, Google Pay and Link. A time picked online is held for only 15 minutes while the client pays (Admin → Policies), and Stripe's page itself closes after about 30 minutes. A payment that is confirmed later still lands safely: it confirms the booking again when the time is still free, and is refunded at once when someone else took it (chapter 25).
4. Test, then go live
- Press Test on the Stripe row of the setup check.
- Book a visit with a deposit in the client app or on the website and pay with Stripe's test card
4242 4242 4242 4242(any future date, any CVC). The booking turns from "pending payment" to "confirmed" when the webhook arrives; Developers → Webhooks shows the delivery and the server's answer. - Repeat the steps above in live mode with your live keys and a live webhook endpoint, and save them.
If a webhook was missed
Stripe tries a delivery again by itself when your server did not answer with success (for example while it was down or restarting). You can also open the event in Developers → Webhooks (or Events) and press Resend. Each event is applied once, so a resend never confirms, charges or refunds twice. A payment that arrives after the hold ran out confirms the booking when its time is still free; otherwise it is refunded to the card at once and the client is told.
DEMO_PAYMENTS="true" in .env lets card payments finish on a built-in test page instead of Stripe: 4242 4242 4242 4242 pays, 4000 0000 0000 0002 is declined. Such payments are labelled DEMO and never counted as money. It is "false" in the shipped file. Use it only on a private test copy, never on a live site.
Card details are typed on Stripe's page and never reach your server. Each Stripe event is applied once, so Stripe's retries never double anything. When applying an event fails, or Stripe can't be reached for a step of it, the webhook answers so that Stripe tries again later. Refunds are recorded first and then sent to Stripe with a key that stops a second refund.
Taking bookings and payments from clients through Chairwise requires the Envato Extended Licence. The Regular Licence covers a single product whose end users are not charged.
Email (SMTP)
Chairwise sends these emails. Each one uses the branch's local time and your brand name and colour.
| When | |
|---|---|
| Booking confirmed | A booking is confirmed (at once, or when the card payment lands). A guest (no account) gets the link to manage the booking in this and every later email. |
| Booking moved | The client or the salon gives a booking a new time. |
| Booking cancelled | A booking is cancelled, with what is refunded or kept. |
| Refund sent | The desk refunds a payment and ticks "Email a refund receipt"; the booking itself stays as it is. |
| Hold ended | A card payment was not finished before its hold ran out: the time is let go and nothing was charged. |
| Reminder | The day before and on the day (24 and 2 hours before by default), when the reminder settings ask for email (chapter 24). |
| Receipt | After the counter checkout, when the desk ticks "email the receipt", or sent again from the receipt. |
| Review request | 2 hours after a visit is paid (Admin → Reminders), once. |
| Password reset | Someone asks for a new password. The link works for one hour. |
| Team invitation | Someone is invited to the team, or added in Admin → Staff. The link works for 7 days. |
- Get SMTP details from any email provider (Amazon SES, Postmark, Brevo, Mailgun, your own mail server…): host, port, user name, password and a sender address on a domain you have verified with that provider.
- Enter them in the admin website → Settings → Email (SMTP), or the
SMTP_*keys in.env. Usestarttlson port 587,tlson port 465. - Press Send a test email on that page, or Test on the Email row of the setup check.
Without SMTP, each email is written to the app's log with its link (docker compose logs app), which is enough for testing. The same page lets you reword each email, with placeholders filled in when it is sent, such as {{name}}, {{services}}, {{staff}}, {{when}}, {{branch}}, {{money}}, {{freeUntil}} and {{brand}}.
Email providers are third-party services with their own pricing tiers, and you are responsible for their costs: most charge per message or sell monthly plans. Check your provider's pricing page.
File storage
The photos of services, staff, branches, packages and categories, profile pictures and your logo are stored in an S3-compatible bucket. The Docker stack includes MinIO with a private bucket on the same server, so this works out of the box.
- Another bucket (AWS S3, Cloudflare R2, Backblaze B2, Wasabi, DigitalOcean Spaces…): set
S3_ENDPOINT,S3_REGION,S3_BUCKET,S3_ACCESS_KEY_IDandS3_SECRET_ACCESS_KEYin.env, or enter them in the admin website → Settings → Storage. Keep the bucket private. For AWS S3 leaveS3_ENDPOINTempty; for R2 use your account's S3 address and regionauto. - A local folder:
STORAGE_DRIVER=localkeeps files in theapp-storageDocker volume. Fine for one server; with several server copies use a bucket, so every copy sees the same files (chapter 37).
The Storage page also sets how much room the business gets (default: no limit) and each person (default 50 MB), 0 for no limit, shows what is stored and has a Test storage button. Uploads are checked by their content, not their name: photos are JPG, PNG or WebP of at most 5 MB, documents are PDF and lists are CSV of at most 20 MB.
The bundled MinIO and the server's own disk cost nothing extra. Outside storage providers are third-party services with their own pricing tiers, and you are responsible for their costs: they charge for space and sometimes for downloads. Check your provider's pricing page.
Push notifications (your own Firebase project)
Push notifications reach a locked phone: a client hears when a booking is confirmed, moved or cancelled, before the visit, when points arrive and when a review is asked for; a stylist hears about a new, moved or cancelled booking of theirs and about their time-off requests. They go through Firebase Cloud Messaging in your own Firebase project. Without it, the apps still show every update while they are open, and the in-app notification list still fills.
There are two halves: the apps need your project's ids (so each phone can get a push token), and the server needs a service account key (so it can send). One Firebase project serves both apps.
Firebase is a third-party service run by Google with its own pricing, and you are responsible for any Firebase costs. Cloud Messaging has no charge per message; other Firebase products you turn on yourself may be billed under Google's plans.
The download contains no Firebase project of ours: the four config files shipped in android/app/src/client/, android/app/src/staff/, ios/config/client/ and ios/config/staff/ are placeholders that read REPLACE_WITH_PROJECT_ID, there is no firebase_options_*.dart file and no service account key. Push stays off until you add your own, as below; everything else works without it.
1. Create the Firebase project
- Open the Firebase console, choose Create a project, name it after your business and finish (Google Analytics is not needed).
- For iOS: in Firebase → Project settings → Cloud Messaging → Apple app configuration, upload an APNs authentication key (
.p8). Make it in your Apple Developer account under Certificates, Identifiers & Profiles → Keys with "Apple Push Notifications service" ticked, and note its Key ID and your Team ID. One key serves both apps.
2. Register the two apps with flutterfire configure
Install the tools once: the Firebase CLI (npm install -g firebase-tools, then firebase login) and the FlutterFire CLI (dart pub global activate flutterfire_cli). Then, in chairwise_mobile_flutter/, run it once per app, with your own project id and the ids your apps use (chapter 17):
flutterfire configure --project=your-firebase-project --platforms=android,ios \
--android-package-name=com.chairwise.client --ios-bundle-id=com.chairwise.client \
--android-out=android/app/src/client/google-services.json \
--ios-out=ios/config/client/GoogleService-Info.plist \
--out=lib/firebase_options_client.dart --yes
# the same for the staff app (com.chairwise.staff, folders staff/)
Each run registers the Android and iOS app in your project, writes the two config files into that flavour's own folder (the placeholders shipped there are replaced) and writes a lib/firebase_options_<app>.dart file with the values for the next step. You can also add the apps by hand in Firebase → Project settings → Add app and download the two files into the same folders.
3. Put the ids in each app's .env
The apps start Firebase from the FIREBASE_* keys of the .env they are built with. Each of the two apps has its own Firebase app ids, so keep one settings file per app, for example .env.client and .env.staff (copies of .env.example), and copy the values from that app's firebase_options_<app>.dart:
| Key in the app .env | Where the value is |
|---|---|
FIREBASE_API_KEY | apiKey of the android options (current_key in google-services.json). The iOS options' key also works for an iOS-only build. |
FIREBASE_PROJECT_ID | projectId |
FIREBASE_MESSAGING_SENDER_ID | messagingSenderId |
FIREBASE_ANDROID_APP_ID | appId of the android options (1:…:android:…) |
FIREBASE_IOS_APP_ID | appId of the ios options (1:…:ios:…) |
FIREBASE_IOS_BUNDLE_ID | iosBundleId |
FIREBASE_STORAGE_BUCKET | storageBucket (optional) |
Then build each app with its own file, for example flutter run --flavor staff --dart-define-from-file=.env.staff. The generated firebase_options_*.dart files are not used by the app; delete them once the values are copied, or keep them for reference. Push stays off until the keys are there.
4. The service account for the server
- In Firebase → Project settings → Service accounts, choose Generate new private key. A JSON file downloads. Anyone with it can send pushes as your project, so keep it safe.
- In the admin website → Settings → Push (FCM), paste the file's text or press Upload the JSON file, then save. The page shows the project id it read; the key is stored encrypted and never shown again. (In
.envinstead:FCM_PROJECT_IDandFCM_SERVICE_ACCOUNT_JSONas one line of JSON.) - The Push row of the setup check turns green.
5. Test it
Install an app on a real phone (the iOS simulator does not get pushes), sign in, allow notifications and lock the phone. (Settings → Push → Send a test push only checks the service account with Google; it sends no message.) Device tokens that Firebase reports as gone are removed by themselves.
The mobile apps
What you need
- Flutter 3.35 or newer on the stable channel (Dart 3.9 or newer), from docs.flutter.dev. The apps are built and tested with Flutter 3.44.
flutter doctortells you what is still missing. - For Android: Android Studio with the Android SDK (the apps compile against API 36) and Java 17. The apps run on Android 7.0 (API 24) and newer.
- For iOS: a Mac with a current Xcode from the Mac App Store and CocoaPods (
brew install cocoapods). The apps run on iOS 15 and newer. - Your Chairwise server online at an
https://address (chapter 7), or a test copy on your computer for the emulator. - A real phone for the things a simulator cannot do, such as push notifications.
Two apps from one codebase
chairwise_mobile_flutter/ builds two apps. Each is a flavour with its own name, app id, icon and link scheme:
| Flavour | App name | App id | Link scheme | Who uses it |
|---|---|---|---|---|
client | Chairwise | com.chairwise.client | chairwise:// | Clients: book, pay and see their visits. |
staff | Chairwise Staff | com.chairwise.staff | chairwise-staff:// | The team: the owner, managers, the front desk and staff. |
Every run and build names the flavour and the settings file:
flutter run --flavor client --dart-define-from-file=.env
flutter run --flavor staff --dart-define-from-file=.env
Each app opens only for its own people: a client signing in to the staff app (or a team member to the client app) is told which app to use. Clients may create an account in the client app while sign-ups are open (Settings → Sign-ups); the team joins by invitation only.
| App | Tabs |
|---|---|
| Client | Home, Services, Bookings, Account |
| Staff | Today, Week, Earnings, Profile |
The screens behind each tab are described in chapter 26 (client app) and chapter 28 (staff app). Both apps follow the phone's light or dark setting, or the one chosen in their settings.
Every key in the app .env
These settings are built into each app with --dart-define-from-file. An empty value means "not set up": the feature turns itself off instead of failing. Never put a server secret here; everything in this file can be read out of the published app.
| Key | What it does |
|---|---|
API_BASE_URL | Your Chairwise server, without /api/v1, for example https://book.yourbrand.com. Required. |
FIREBASE_API_KEY, FIREBASE_PROJECT_ID, FIREBASE_MESSAGING_SENDER_ID, FIREBASE_ANDROID_APP_ID, FIREBASE_IOS_APP_ID, FIREBASE_IOS_BUNDLE_ID, FIREBASE_STORAGE_BUCKET | Your Firebase project, for push notifications (chapter 13). The app ids differ per app, so keep one .env file per app. Empty: the app runs without push and shows "Push: not set up". |
DEMO_LOGINS | true shows the one-click demo sign-ins on the sign-in page, but only when the server is in demo mode too. Keep false for every build you publish. |
SUPPORT_EMAIL | The email address shown in Help. Empty hides it. |
APP_ROLE | Only for builds without --flavor (tests, the web preview): client or staff. |
SAMPLE_DATA | Not in the file, for development only: --dart-define=SAMPLE_DATA=true makes the app answer itself from a built-in sample salon, with no server. Never in a build you publish. |
One-click demo sign-ins off for a live business
The demo sign-in cards need two switches: DEMO_MODE=true on the server and DEMO_LOGINS=true in the app. A live business has both off, so its sign-in page shows only email and password. Keep a separate .env for a demo build if you want one; never publish it.
Make the apps yours
One command gives both apps and the web app your name, app ids, link scheme, colour and icons. Run it from the folder that holds compose.yaml, on a copy you have committed or backed up, with --dry first to see what it would change:
node tools/rename.mjs --name "Shearly" --id com.acme.shearly --color "#2563EB" --dry
node tools/rename.mjs --name "Shearly" --id com.acme.shearly --color "#2563EB" --icon icon.png --icon-bg "#2563EB"
| Option | What it changes |
|---|---|
--name | The name people see: the apps become "Shearly" and "Shearly Staff", and every "Chairwise" in emails, legal pages and the web's default name changes too. Folder, package and database names stay: nobody sees them. |
--id | The app ids for Google Play and the App Store: com.acme.shearly.client and com.acme.shearly.staff. Set it before your first upload: a published app's id can never change. |
--scheme | The link scheme (shearly:// and shearly-staff://). Defaults to the name in lower case. |
--color | The brand colour of both apps and the web app's default, with its darker and lighter tints. The owner can still change the web colour later in Settings → Branding. |
--icon, --staff-icon, --icon-bg | A square PNG of at least 1024 px, no transparency, for both apps (or the client app when --staff-icon is given too), and the colour behind it on Android 8 and newer. The command runs dart run flutter_launcher_icons for you. |
Fonts and colours
The apps use Albert Sans for everything and Bodoni Moda for a few display titles, bundled in assets/fonts (SIL Open Font License, see OFL.txt). Every colour lives in lib/core/theme/app_theme.dart, in a light and a dark palette.
Register the new app ids in your Firebase project and add their keys to the app .env (chapter 13), then rebuild both apps.
Build release files
Use one settings file per app (for example .env.client) with API_BASE_URL on your live server and DEMO_LOGINS=false. The version shown in the stores is version: 1.0.0+1 in pubspec.yaml: the part after + is the build number, which must go up with every upload (or pass --build-number=2).
Android: sign, then build
- Make an upload key once (keep the file and its passwords safe and backed up; one key can sign both apps):
keytool -genkey -v -keystore ~/upload-keystore.jks -keyalg RSA -keysize 2048 -validity 10000 -alias upload - Create
chairwise_mobile_flutter/android/key.properties(it is ignored by Git and never shipped):
Without this file, release builds are signed with the debug key, which the stores refuse.storePassword=the-store-password keyPassword=the-key-password keyAlias=upload storeFile=/full/path/to/upload-keystore.jks - Build an App Bundle for Google Play, or an APK to install by hand:
The files land influtter build appbundle --flavor client --dart-define-from-file=.env.client flutter build apk --flavor client --dart-define-from-file=.env.clientbuild/app/outputs/bundle/clientRelease/app-client-release.aabandbuild/app/outputs/flutter-apk/app-client-release.apk. Repeat withstaff.
iOS: archive and upload
- In your Apple Developer account, under Certificates, Identifiers & Profiles → Identifiers, register the two bundle ids with the Push Notifications capability. Xcode can do this for you with automatic signing.
- In App Store Connect, create the two apps (My Apps → + → New App) with those bundle ids.
- Choose your own team: open
ios/Runner.xcworkspacein Xcode, select the Runner target, open Signing & Capabilities, keep Automatically manage signing on and pick your team in Team for every configuration (Debug, Release and Profile of both flavours). The project ships with no team and no provisioning profiles, so nothing of ours is in it. - Build the archive and the IPA:
The IPA lands influtter build ipa --flavor client --dart-define-from-file=.env.clientbuild/ios/ipa/. Upload it with Apple's Transporter app, or openbuild/ios/archive/Runner.xcarchivein Xcode and choose Distribute App. Repeat withstaff.
Publish the two apps
Each app is published separately, under your own developer accounts and your own brand. Chairwise's demo names, ids and screenshots are not yours to publish.
Google Play
- In the Play Console, choose Create app twice (one per app).
- Fill in the store listing (name, descriptions, icon, screenshots), the content rating questionnaire, the target audience and the Data safety form. The apps use photos the person chooses; name, email and phone for the account; and, when the client allows it, the phone's location to put the nearest branch first (it stays on the phone).
- Upload the
.aabto Internal testing first, then a closed test. New personal developer accounts must run a closed test with at least 12 testers for 14 days before Google lets them publish to production. - Let Google Play sign the release (Play App Signing, the default).
App Store
- In App Store Connect, fill in each app's description, keywords, screenshots, support URL, privacy policy URL (your legal page
https://book.yourbrand.com/legal/privacy) and the App Privacy answers. - The staff app has no sign-up: Apple's review needs a working account. Invite a test team member and give the sign-in under App Review Information. Explain in the review notes that the two apps serve two different people (clients and the salon team) of one business.
- Apple requires apps with sign-up to let people delete their account: the client app does it in Account → Edit profile → Delete my account (chapter 29).
- Submit each build for review.
Links to your apps
Once an app is live, paste its store addresses in the admin website → Settings → App links: the App Store address (https://apps.apple.com/app/id…) and the Google Play address (https://play.google.com/store/apps/details?id=…) of each app. The website then shows the badges of both apps.
Run the business
Who does what
Everyone signs in with an email and a password. Each person has one role. The server checks the role on every request; the screens only hide what a role can't use.
| Role | Where they work | What they do | What they can't do |
|---|---|---|---|
| Owner | Admin website; the staff app when they also take bookings | Everything: all the manager's pages plus Team and roles, Settings (keys, email, push, storage, legal pages, branding) and the setup check. | Delete their own account while they are the only owner. |
| Manager | Admin website; the staff app when they also take bookings | The front desk's work plus: any refund, fees, client points and data exports, staff (add, skills, hours, commission), time-off approval, services, categories, packages, loyalty, review replies, reminders, branches, policies and reports. | Open Team and roles, Settings or the setup check. |
| Front desk | Admin website | The calendar, bookings (book, move, block time, check in, cancel), the counter checkout, payments, refunds of deposits, clients (add, import, notes). | Refund more than a deposit, give a discount above the limit (20% by default), change points, export a client's data, approve time off, change the menu, staff, branches, policies, reminders, loyalty or settings, see reports and fees. Staff, time off, services, packages and reviews are read-only for them. |
| Staff | Staff app | Stylists, barbers and therapists: their own day and bookings (check in, start, finish, no-show), walk-ins with themselves, their week, hours, time-off requests and earnings. | See other stylists' bookings, cancel or move bookings, take payments, open the admin website. |
| Client | Client app, booking website | Book and pay for their own visits; reschedule and cancel within the salon's rules; review; points, packages, notifications; delete their account. | See anyone else's bookings; book a branch whose online booking is off; change a booking once its window has closed. |
| Guest | Booking website or client app, without an account | Book with a name, email and phone; manage that booking from the link in the confirmation email. | Use points, buy packages or see past visits until they create an account with the same email (their bookings move into it). |
The staff app shows a person's own day, so it needs a staff profile: anyone who takes bookings (a stylist, or an owner or manager who also cuts hair) is added in Admin → Staff. A client signing in to the staff app, or a team member to the client app, is told which app to use.
The admin website
The front desk, managers and the owner sign in at /signin on your APP_URL. The Overview opens first; the sidebar shows only the pages the person's role may open. On a phone the admin website has a tab bar: Calendar, Bookings, Checkout, Clients and More. The role tags below say who may open each page; where others only read it, the text says so.
Today
- Overview front desk +
- Today across all branches or one: bookings, takings so far, no-shows, chair time booked and deposits held; the next two hours; each branch's day; time off to approve and recent reviews. It refreshes when the calendar changes.
- Calendar front desk +
- One branch's day with a column per stylist, or one person's week, on the branch's own clock; the week shows each day's opening hours, early closes and holidays. Click a free gap to book it, click a booking to open it, drag a booking to another time or person (a clash turns red and offers the nearest free starts; a drop asks to confirm and whether to tell the client). Block time takes someone off the book (a meeting, training), once or every week for a few weeks. Walk-in books the first free time from now. Changes from the apps appear at once.
- Booking sheet front desk +
- One booking: status and code, the time, the client (visits, no-shows, points, last visit, note), the money (lines, deposit, what is due, points it earns) and its history. The footer moves the visit along: check in → start → finish → checkout. Also move, no-show (from 15 minutes after the start), refund the deposit and cancel.
- New booking front desk +
- Five steps: the client (search, or add one with a name and a phone or email; a walk-in needs only a name), the services, the stylist and a free time (no lead time at the desk), how to pay (at the salon, a Stripe card link that holds the time for 15 minutes, or a package session) and a note, with a switch for telling the client.
Front desk
- Bookings front desk +
- Every booking across the branches, in tabs: Today, Upcoming, Past, No-shows, Cancelled. Filter by branch, staff, status and day; search by code, client or phone; export to CSV. A row opens the booking sheet.
- Checkout front desk +
- Today's visits waiting to pay. The till adds extra services, a tip for the stylist (none, 10, 15 or 20% of the services, or an amount), a discount, points and a package session, takes off the deposit already paid, and takes the rest in cash (with change), by card at the desk or by a Stripe card link. Then the receipt: print it or email it (chapter 25).
- Payments front desk +
- Deposits, full payments, balances, package sales and refunds, with the day's takings on top. A row refunds all or part of a payment (the front desk refunds deposits only) or opens its booking. Demo payments are labelled and never counted.
- Fees manager +
- No-show and late-cancel fees the policy kept, the no-show rate, and what was missed on visits without a deposit. Waiving a fee refunds it to the client.
People
- Clients front desk +
- Everyone who has booked, with visits, last visit, spend, no-shows, points and packages; tabs All, New this month, Regulars, With no-shows and Have a package; search; import and export CSV; New client. The client sheet has Overview, Visits, Payments and Notes: the team's note, "card required to book", a points adjustment and the personal data export (both for managers and the owner). See chapter 29.
- Staff front desk reads · manager + edits
- Everyone who takes bookings, with how much of their shift time this week is booked. The staff sheet: name, title, the email they sign in to the staff app with, main branch, the services they can do, commission, whether they are on (bookable), and weekly hours per branch with breaks; Earnings and Reviews tabs. Add staff emails the new person an invitation to set up the staff app. New hours count from now on; booked visits never move by themselves.
- Time off front desk reads · manager + decides
- Requests from the staff app: approve or decline. When bookings sit inside the time, approving asks again; the bookings stay and the desk moves them. Managers can also add time off directly. Requests to change weekly hours, sent from the staff app, wait here until marked done.
Menu
- Services front desk reads · manager + edits
- The menu by category: length, clean-up time after (the buffer), price, deposit (none, a percentage or a fixed amount), who can do it, the branches that offer it and whether it is on. Changes count for new bookings; booked visits keep their price.
- Categories front desk reads · manager + edits
- The menu's sections in the order clients see them (drag to reorder), each with a name, words, an icon and a photo. Switch one off to hide it and its services.
- Packages front desk reads · manager + edits
- Prepaid sessions of one service: sessions, price, what they save, how many days they last after payment, on sale or not; with the numbers sold, holders and sessions left.
Growth
- Loyalty manager +
- The points rules (points per $1, how many points make one step and what a step is worth, months until points expire), the words clients read, and the ledger of every points move.
- Reviews front desk reads · manager + replies
- What clients wrote after a paid visit: tabs New, All, Answered and Hidden. A reply shows under the review in the app and on the website; hiding a review takes it out of the stylist's rating.
- Reminders manager +
- The day-before and the same-day reminder (when, by push and/or email, an extra line of your own), the review request after a paid visit, and a log of what was sent through which channel.
Business
- Branches manager +
- A card per branch, with today's bookings and how much chair time is booked. The branch sheet: name, phone, address, time zone, photo, opening hours with an optional break per day, closed days (a whole day, or "closes early at" a time), and online booking on or off. New hours count for new bookings; booked visits stay.
- Policies manager +
- The booking rules: cancel and change windows, deposits and fees, when clients can book (chapter 24 lists each one).
- Reports manager +
- For a period and one or all branches: money taken, booked ahead, visits, no-show rate and tips; revenue by day; each person's visits, commission and tips; the top services; fees kept and refunds. Demo payments are never counted.
- Team and roles owner
- The team and its invitations (chapter 22).
- Settings owner
- Everything that is not a daily task (chapter 23).
- Setup check owner
- What the business still needs, with a live test of each service (chapter 9).
- Profile everyone
- Your own name, picture and password.
Team and invitations
Admin website → Team and roles (the owner) lists everyone on the team with their role and whether they used the app in the last five minutes, and the open invitations.
- Invite someone by email as a manager, front desk or staff member. The link works once and for 7 days; Resend sends a new one.
- A new person picks a name and password; an existing client proves the account is theirs with their password and keeps their history. The front desk and managers go on to the admin website; staff are sent to the staff app.
- Change a role, including making someone else an owner. The new role counts at once.
- Remove someone from the team: they become a client and are signed out everywhere at once.
- Suspend someone (with a reason): they are signed out everywhere and can't sign in until restored.
Managers add stylists without this page: Admin → Staff → Add staff with the person's email sends the same invitation, and the new person sets up the staff app with it.
Settings and legal pages
Admin website → Settings (the owner) holds everything that is not a daily task. A value saved here takes precedence over .env; secret keys are stored encrypted and never shown again.
| Section | What it holds |
|---|---|
| General | The business name, support email, currency, time zone and brand colour. The business's time zone is used for reports and the demo's nightly reset; each branch has its own time zone for its bookings (Admin → Branches). Time format: 12-hour (2:30 PM, the default) or 24-hour (14:30); the admin, the booking website and both apps follow it. |
| Branding | The product name, support email and links, the documentation URL, the logo and the brand colour, with a live preview. |
| Sign-ups | Whether clients may create their own account. |
| App links | The App Store and Google Play links of the client and staff apps; the website shows their badges. |
| Payments (Stripe) | Keys and the webhook address (chapter 10). |
| Email (SMTP) | The SMTP server, a test email and the wording of every email (chapter 11). |
| Storage | Where files go and how much room the business and each person get (chapter 12). |
| Push (FCM) | The Firebase service account (chapter 13). |
| Legal pages | Terms, privacy, cookies, and cancellations and refunds, in Markdown with a live preview. A page left empty is hidden from the site. The starter texts are a starting point, not legal advice. |
| Demo mode | Whether the server runs as a public demo (only with DEMO_MODE, chapter 31). |
| Maintenance | The maintenance page switch and its message, removing the demo data, and this server's facts. |
The day-to-day rules live on their own pages: the booking rules in Admin → Policies, points in Admin → Loyalty and reminders in Admin → Reminders.
How a booking works
From the first tap to the finished visit: how free times are found, why two clients never get the same chair, and the rules for cancelling, moving and missing a visit.
The booking, step by step
- Branch and services. The client picks a branch, then one or more services (up to six, done back to back by one person).
- Who. A stylist who can do every chosen service, or Anyone available.
- When. A day, then a start time. Only really free times are shown, grouped by morning, afternoon and evening. A full day says when the next free time is.
- Details. A note for the stylist; a guest also gives a name, email and phone.
- Pay. The deposit now, everything now, or nothing now and pay at the salon, as the salon's rules allow (chapter 25). The cancel and change deadlines are shown before the button.
- Booked. The booking gets a code such as
CW-20318. The client can add it to their calendar, get directions and choose to be reminded 2 hours before. A card payment first shows "pending payment" until Stripe confirms it.
How free times are found
For each day, in the branch's own time zone, the server looks at every staff member who:
- is switched on in Admin → Staff and not suspended,
- has weekly hours at this branch, and
- can do every service of the visit (Admin → Staff → the services they do), each of which is switched on and offered at this branch.
Then, for each of them:
- Working time = their hours that weekday, inside the branch's opening hours. A day the branch "closes early" ends at that time; a closed day or a weekday without opening hours offers nothing.
- Minus the branch's break and their own break.
- Minus their approved time off and any blocked time.
- Minus their other active bookings at any branch, each with its clean-up time.
- A start time fits when all the services, back to back, fit inside one stretch of working time, and the last service's clean-up time is clear of their next booking.
- Start times sit on the slot grid of the branch's clock: every 15 minutes by default (9:00, 9:15, 9:30…).
- Online, a start must be at least the lead time from now (2 hours by default) and at most the days ahead limit away (60 days by default).
Anyone available shows every time at which at least one able person is free. When the client books it, the server gives the visit to the free person with the fewest bookings that day, then in the salon's staff order.
At the desk (front desk, managers, the owner) there is no lead time and no days-ahead limit, the start needn't sit on the grid, and branches whose online booking is off can be booked. Opening hours, shifts and other bookings still count.
Time zones and daylight saving
- Each branch has its own time zone (Admin → Branches). Its opening hours, staff hours, breaks and closed days are local clock times there.
- Every booking is stored as one real moment (in UTC), and the server sends its local date and time with it. Every screen, email and push shows the visit in the branch's time, whatever time zone the phone or computer is set to. A visit booked for the 15th never shows as the 14th.
- Daylight saving is worked out day by day, so 9:00 stays 9:00 on the clock. On the night the clocks go forward, a time that doesn't exist is skipped; on the night they go back, the repeated hour is offered once.
- Changing a branch's time zone keeps the real moment of visits already booked, so their shown time changes. Set the right time zone before you take bookings.
No double booking
Two clients can never take the same chair. Everything that gives a booking a time (an online booking, a reschedule, a desk booking, a drag on the calendar, a walk-in, a late payment that brings a booking back) runs in one database transaction that:
- locks the stylist (a PostgreSQL lock per staff member, always taken in the same order, so two bookings never wait on each other),
- checks the exact time again with the same rules as above, inside the lock, and
- saves the booking.
As a last guard, the database itself refuses two active bookings of one staff member whose times (with clean-up) overlap. The client who comes second sees "Someone just took this time. Pick another one." and picks again; nobody is ever double-booked. While a client pays by card, the time is held for them. A double tap on "Book" in the apps makes one booking: they send a request key, and the same key within 24 hours gets the first answer again. The tests race two clients for one time, a reschedule against a new booking, a calendar drag against a client, and a walk-in against an online booking.
Booking statuses
| Status | What it means | What moves it on |
|---|---|---|
| Pending payment | A card payment is open; the time is held (15 minutes by default). | Stripe's webhook → Confirmed. The hold runs out unpaid → Cancelled by the system, the time is free again. |
| Confirmed | Booked. | Check in (staff or desk, from 60 minutes before the start) → Checked in. Start → In progress. Cancel → Cancelled. From 15 minutes after the start → No-show. |
| Checked in | The client has arrived. | Start → In progress; finish → Completed; no-show is still possible. |
| In progress | In the chair. | Finish (extra services can be added first) → Completed. |
| Completed | Done. If money is still due, the visit waits in Checkout. | The counter checkout takes what is due; the visit is then paid. |
| Cancelled | Cancelled by the client, the salon or the system. The time is free. | A card payment that still arrives may bring it back (chapter 25). |
| No-show | The client didn't come. The time is free. | Final. |
The first four hold the stylist's time. Each booking also has a payment status: unpaid, deposit paid, paid, partially refunded or refunded. Every change is written to the booking's history, updates every open screen at once and tells the client in the app (push and the inbox); a confirmation, a new time and a cancellation are also emailed.
The booking rules (Admin → Policies)
| Rule | Default | Allowed values |
|---|---|---|
| Free cancellation until … before the start | 24 hours | 0 to 720 hours |
| A late cancellation keeps | the deposit | the deposit, or nothing |
| Clients may move a booking until … before the start | 12 hours | 0 to 720 hours |
| … and at most … times | 2 | 0 to 20 |
| Services with a deposit need a card | on | on or off |
| A card is needed after … no-shows | 2 | 0 (never) to 50 |
| A no-show keeps | the deposit | the deposit, or everything paid |
| A no-show can be marked … after the start | 15 minutes | 0 to 240 minutes |
| Online bookings start at least … from now (lead time) | 120 minutes | 0 to 10,080 minutes |
| Online bookings at most … days ahead | 60 days | 1 to 365 days |
| Slot grid | 15 minutes | 5, 10, 15, 20, 30 or 60 minutes |
| A time picked online is held while the client pays | 15 minutes | 5 to 120 minutes; keep it at 30 or less, because Stripe's page closes after about 30 minutes |
| Pay in full online | on | on or off |
| Pay at the salon | on | on or off |
| Check-in opens … before the start | 60 minutes | 0 to 720 minutes |
| The front desk's largest discount | 20% of the services | 0 to 100% |
| A new service's deposit | 20% of its price | 0 to 100% |
The windows and fees are read when a client cancels or moves, so a change counts for bookings already made too. Prices and deposits are fixed when a booking is made. The client sees these rules in plain words before paying, and the booking website and the apps read them from the server.
Cancelling
- The client (app, website or the email link) can cancel a pending or confirmed booking until it starts. The money is shown first: "free, $13.60 back to your card" or "late, the $13.60 deposit is kept".
- Free (before the free-cancellation deadline): every card payment is refunded in full, spent points come back and a package session comes back.
- Late (after the deadline): the deposit is kept as the late-cancel fee, out of what was paid online; anything paid above it is refunded. Spent points still come back; a package session is used up. When the client paid nothing in advance, nothing is kept: Chairwise never charges a card afterwards.
- The salon (calendar or bookings) cancels any active booking. By default the fee is waived: everything is refunded and points and the session come back. The desk can choose to apply the client's late rules instead, and whether the client is told.
- The system cancels a booking whose card payment was not finished within the hold.
Moving a booking
- The client can move a confirmed booking until the change deadline (12 hours before by default), at most the allowed number of times (2 by default). The services stay the same; the stylist can stay, change, or become "anyone available". The new time is checked like a new booking (the booking's own time counts as free while the client picks, so moving it 30 minutes on the same day works), the money moves with the booking and the reminders are set again.
- Too late, the app and the website say "Changes closed" and offer the branch's phone number.
- The salon can move a confirmed or checked-in booking at any time, by dragging it on the calendar or with Move; the window and the count don't apply. The desk chooses whether to tell the client.
No-shows
Staff (in the staff app) or the desk can mark a confirmed or checked-in booking as a no-show from 15 minutes after its start. The no-show keeps the deposit (or everything paid, if the policy says so) out of what was paid online; the rest is refunded. Spent points come back; a package session is used up. The client's no-show count goes up, and after 2 no-shows (by default) they must pay by card online to book again. The desk can also tick "card required to book" for any client.
Reminders
- Two reminders before each visit: the day before (24 hours before by default, 1 to 168 hours) and the same day (2 hours before by default, 1 to 48 hours, always closer to the visit than the first). Admin → Reminders turns each on or off, chooses push, email or both, and adds an extra line of your own. The in-app inbox always gets them.
- Each reminder is sent exactly once per booking. One server copy at a time sends them, and each send is first recorded for the booking and the kind of reminder, so even two copies running at once can't send it twice.
- Only confirmed bookings get reminders, and only ones made or moved before the reminder was due: a visit booked 3 hours ahead gets only the same-day reminder. The day-before reminder is skipped once the same-day one is due. Moving a booking sets its reminders again; cancelling stops them.
- The client can switch "Remind me 2 hours before" off for one booking (in the app, on the website, or from the email link of a guest): that booking then gets no same-day reminder, while the day-before reminder still comes.
- Push needs Firebase (chapter 13) and email needs SMTP (chapter 11). Guests have no app, so they get email only.
- A review request goes out once, 2 hours after a visit is paid (0 to 168 hours), within 7 days and only when the client hasn't reviewed it yet.
- The server looks for due reminders every 30 seconds. Admin → Reminders shows the latest sends and their channels.
Walk-ins, time off and blocks
- A walk-in (staff app or calendar) takes the first free time from now, or a time picked by hand, with no lead time. When the time was just booked online, or nothing is free today, the next free time is offered.
- Staff ask for time off in the staff app; a manager approves or declines it. Approving over existing bookings asks again; the bookings stay booked and the desk moves them. Approved time off is never offered online.
- The desk can block time for a person (training, a meeting), once or weekly for a few weeks. Bookings inside a block stay booked.
- A branch's closed day can be a whole day or "closes early at" a time: no new visit ends after it, and visits already booked past it stay. A branch with online booking off takes bookings only at the desk; clients are told "This branch takes bookings by phone or at the desk."
Money: deposits, payments, fees, points and packages
All prices are in the business's currency, in whole cents. Card money goes straight into your own Stripe account; cash and card-terminal payments at the desk are only recorded.
Ways to pay when booking
| Way | What the client pays now | Offered when |
|---|---|---|
| Deposit | The visit's deposit by card; the rest at the salon. | The visit has a deposit and card payments are set up. |
| In full | Everything by card. | "Pay in full online" is on, something is left to pay and card payments are set up. |
| At the salon | Nothing now. | "Pay at the salon" is on and no card is required, or nothing is left to pay (a package or points cover it all). |
Deposits are set per service: none, a percentage of its price (rounded to the cent) or a fixed amount (never more than the price). A visit's deposit is the sum of its services' deposits; a service paid by a package session has none; the deposit is never more than what is left to pay.
A card is required (and "at the salon" is not offered) when a service of the visit has a deposit and the policy "Services with a deposit need a card" is on, when the client has reached the no-show limit (2 by default), or when the salon ticked "card required to book" for the client.
What is taken off first: a package session pays its service's full price, then points come off in whole steps, then the deposit or the full amount is paid now, and the rest is due at the salon. The quote the client sees is worked out by the server with the same code as the booking, so it always matches to the cent.
A card payment, from booking to receipt
- The client books and chooses to pay the deposit (or everything) by card.
- The server locks the stylist, checks the time again and saves the booking as pending payment. The time is held for the hold minutes (15 by default); nobody else can take it.
- The server opens a Stripe Checkout page for the amount, on your Stripe account.
- The app or the website opens that page.
- The client pays on Stripe's own page. Card details never touch your server.
- Stripe calls
/api/v1/webhooks/stripewith a signedcheckout.session.completedevent. The server checks the signature and its time. - The event is applied once: the payment is marked paid and the booking confirmed. A repeat of the same event changes nothing.
- The client is told (push, email and the inbox) and so is the stylist (push).
- Reminders go out 24 hours and 2 hours before, each once.
- The stylist or the desk checks the client in, starts and finishes the visit.
- The counter checkout adds extras and the tip, takes off the deposit already paid and takes the rest.
- The visit is paid: the receipt can be emailed, the points are earned, and a review request follows 2 hours later.
When something goes wrong:
- The card is declined or the client leaves Stripe's page: nothing is charged and the booking stays pending until the hold ends; the client can try another card or pay at the salon instead (when allowed).
- The hold runs out before Stripe confirms: the server closes the Stripe page, cancels the booking (by the system) and frees the time; spent points and a package session come back. The client gets "Hold ended … Nothing was charged." (push, inbox and email); the stylist, who was never told about the booking, hears nothing.
- The payment still arrives after that: if the time is still free, the booking is confirmed again; if someone else took it, the payment is refunded to the card at once and the client is told. Never two bookings in one chair.
- The webhook doesn't arrive: see If a webhook was missed.
Card links from the desk
A booking made at the desk can ask for its deposit by a Stripe card link: the time is held while the client pays, as above. At the counter, "card link" finishes the visit and sends one link for everything due, the tip included; it stays open for 30 minutes and the visit is paid when the client pays.
Refunds
- Admin → Payments → a payment → Refund: all of what is left or a part, with a reason, and whether to email the client. The front desk may refund deposits only; managers and the owner may refund any payment.
- A card payment goes back to the same card through Stripe. The refund is recorded first, then sent to Stripe with a key that stops a second refund. If Stripe says no, the refund is undone and the sheet shows "The refund didn't go through" with Stripe's reason; if Stripe can't be reached, the server tries again by itself.
- A cash or card-at-the-desk payment is only recorded as refunded: hand the money back yourself.
- Cancellations and no-shows refund by themselves, as their rules say (chapter 24).
Late-cancel and no-show fees
A fee is only ever kept from money the client already paid online, usually the deposit. Chairwise never charges a card after the visit. Admin → Payments → Fees (managers and the owner) lists each fee kept; Waive refunds it.
The counter checkout
- A visit can be checked out once it is checked in, in the chair or finished. It appears in Admin → Checkout.
- The till lists its services; add extra services (up to 10), priced from the menu.
- Add a tip for the stylist: none, 10%, 15% or 20% of the services, or an amount.
- Give a discount if needed: the front desk up to its limit (20% of the services by default), managers and the owner any amount.
- Use the client's points or a package session if they weren't used when booking. The deposit already paid is taken off.
- Take what is due: cash (the till works out the change), card at the desk (your own card terminal; Chairwise only records it) or a Stripe card link. A package that covers everything needs no payment.
- The visit becomes completed and paid. Print the receipt or email it; the client's points are earned.
A visit paid in advance in full can still come to the counter for extras and a tip.
Staff commission and tips
Each staff member has a commission rate (0 to 100% in Admin → Staff). Their commission on a visit is the services minus the salon's discount, times their rate. Tips go 100% to the stylist. The staff app's Earnings shows paid visits week by week; Admin → Reports shows each person's visits, commission and tips for any period. Chairwise works the figures out; paying your team is done outside it.
Loyalty points
- Earn: when a finished visit is fully paid, the client earns points on the service money they paid: 1 point per whole $1 by default, after discounts, points and package sessions. Tips earn nothing. A visit earns once.
- Spend: in whole steps, 100 points = $5 off by default, when booking or at the counter, never more than what is left to pay. The balance can never go below zero: two bookings spending the same points at once can't both win.
- Return: points spent on a booking come back when it is cancelled (free or late) or marked a no-show.
- Expire: points expire 12 months after they were earned (1 to 120 months), oldest first; the client sees what expires in the next 30 days.
- Managers and the owner can add or take points by hand with a reason. Every move is in Admin → Loyalty → the ledger. Switching loyalty off stops earning and spending.
Packages
- A package is a number of sessions of one service for one price, for example "Blow-dry 5-pack: 5 sessions for $200". Clients buy it by card in the client app (Stripe Checkout and the same webhook as above); it is active from payment for the number of days the package lasts. The website shows a signed-in client's packages and sessions left.
- When booking that service, the client can use a session: it pays that service's price. Each booking uses at most one session, and the last session can never be used twice.
- A free cancellation gives the session back; a late cancellation or a no-show uses it up.
- Sessions left when a package expires can no longer be used.
Demo payments
With DEMO_PAYMENTS="true" (a private test copy) or on the public demo, card payments finish on a built-in test page instead of Stripe: 4242 4242 4242 4242 pays and 4000 0000 0000 0002 is declined. They are labelled DEMO and never counted in payments totals or reports.
Client app
Clients sign in with an email and a password, create an account while sign-ups are open (Settings → Sign-ups), or continue as a guest. The tabs are Home, Services, Bookings and Account. "Forgot password?" emails a reset link.
- First run
- Three short slides (book in 30 seconds, pay your way, points and packages) with Try a booking and Sign in; then the branch, nearest first when the client allows their location, A to Z otherwise; then a friendly ask to turn on notifications.
- Home
- The branch, the next appointment with a countdown, Book again for the last visit, categories, popular services, the team, packages and the branch card.
- Services, team and branches
- The menu by category with Add; a service's page (length, price, what's included, who does it and their next free time, the cancel rule); search; the team; a stylist's page (rating, what they do, next free times to tap, reviews); a branch's page (open now, hours, Directions and Call).
- Booking
- Your visit (services added, "Add another service") → choose staff or Anyone available → pick a time (a week strip and the day's free times; a full day offers the next free one; a chosen stylist's day off reads "Maya is off" with their next working day) → your details (a guest gives name, email and phone; a note for the stylist) → pay (deposit, in full or at the salon, points, a package session, the cancel and change rules) → Stripe's page → Your chair is booked, with Add to calendar (the phone's calendar, Google Calendar or an .ics file), Get directions and "Remind me 2 hours before". A declined card and "someone just took this time" each have their own screen. A guest is offered an account to keep the booking in the app.
- Bookings
- Upcoming and Past. A booking's page shows its status, who and where, the money, the cancel and change rule, Add to calendar, Directions in the phone's maps app, Reschedule and Cancel (what happens to the money is shown first) and "Remind me 2 hours before" (on or off; the day-before reminder always comes). A booking whose card payment was not finished shows Finish paying (another card, or pay at the salon when allowed) until its hold ends. A past visit shows the receipt and the points earned, with "Rate your visit" and "Book again".
- Review
- 1 to 5 stars, what stood out (up to 5 tags) and a comment of up to 600 characters, once per finished visit; then a "same again?" suggestion with a time to book in one tap.
- Account
- Points (balance, what it's worth, history, what expires soon), my packages (sessions left) and packages to buy by card, the notifications inbox, settings (light, dark or match the phone; which notifications, review requests included; home branch), edit profile (with notes for your stylist), delete account (upcoming visits are cancelled under the usual cancel rules first), help (call a branch, email support) and the legal pages.
The booking website
Your APP_URL opens the public website. Its pages are ready for search engines and work on phones.
- Home
- A finder for a service and a branch with the next free times, your menu by category, the team with who is free next, the branches, reviews and how booking works.
- Services, Team, Branches
- The full menu (filter by branch, search); everyone by branch with their next free time and rating; each branch with its hours, closed days, Directions, Call, today's free times by person and the house rules in plain words.
- Book online
- Four steps: services → staff and time → details and pay → booked. The same rules and the same free times as the app, with or without an account. Stripe's page comes back to the "booked" page, which waits for the payment to be confirmed. A declined card offers another card or paying at the salon (when allowed); a chosen stylist's day off reads "Maya is off" with the next free day.
- Manage booking
- The link in every confirmation email (a guest's way back): the booking, change the time within the rules, cancel with the money shown first, add to calendar, getting there and "Remind me 2 hours before".
- Sign in and my bookings
- A client's upcoming and past visits, points, packages and details. The salon's team signs in at
/signininstead. - Legal pages
- Terms, privacy, cookies, and cancellations and refunds, from Settings → Legal pages.
Staff app
The team signs in with the email their invitation went to. The tabs are Today, Week, Earnings and Profile. The app shows only the person's own bookings.
- Today
- The day's clients and money booked, the shift and its break, and a timeline with each booking, the free gaps (tap one to add a walk-in) and a line for now. It reloads every minute and on every push. A day off shows the next shift; without a connection it shows the day it saved.
- A booking
- The client (first visit or how many visits, their notes), the services and the money. Check in (from 60 minutes before), Start (a timer and who's next), Finish (add extra services; what's left to pay goes to the desk) and No-show (from 15 minutes after the start, showing what happens to the deposit). Check in, start and finish also work offline: they are saved on the phone and sent in order once it is back online.
- Walk-in
- The service, the first free times with you today, and the client's name. When the time was just booked online, the next free one is offered.
- Week
- The week's bookings, hours and money booked, one row a day (closed, day off, done, today with who's next, free from).
- My hours and time off
- Each weekday's hours and break and the branch's opening hours; Ask for a change sends a note to the manager (it waits in Admin → Time off). Time-off requests: waiting, approved and declined; cancel one that is still waiting; ask for new time off (whole days or part of a day, a reason, and the clients booked then).
- Earnings
- This week or last: services, commission, tips and the total from paid visits, day by day, and what is still booked. Download shares the week as a CSV file.
- Profile
- Photo, title, rating and services; my hours; time off; notifications; call the manager; appearance (light, dark or match the phone); sign out.
Clients: import, export and deletion
Who counts as a client
- Someone who created an account in the app or on the website.
- A guest who booked without an account. When they later sign up with the same email, the account becomes theirs with every booking in it.
- Someone the desk added (New client, a booking at the desk or a CSV import). They have no password yet; signing up with that email makes the account theirs.
Import clients from a CSV file
Admin → Clients → Import CSV (the front desk, managers and the owner). Use a file that:
- is plain text in UTF-8 with commas between the columns (a spreadsheet's "CSV UTF-8" export),
- has a header row, then one client per row.
| Column | Needed | What goes in it |
|---|---|---|
name | Yes | The client's full name, at least 2 characters. The column may also be called full name or client name, or come as two columns first name and last name (joined with a space). |
email | Email or phone | A valid email address. |
phone | Email or phone | The phone number with its country code, 8 to 15 digits (spaces, dashes and a leading + or 00 are fine). A column whose name contains "phone" or "mobile" also counts. |
Column names may be in any order and any case. Every other column (notes, birthday, tags…) is ignored. A row needs a name and an email or a phone; rows without them are left out.
name,email,phone
Ana Lopez,ana@example.com,+1 555 010 2030
Ben Carter,,+44 7700 900123
Chloe Martin,chloe@example.com,
Duplicates: a row whose email already belongs to an account (a client or a team member) is skipped, and so is a row the server refuses (for example a phone number without its country code). When the import ends, a message says how many clients were added and how many rows were skipped. Two rows with the same phone and no email make two clients, so tidy the file first.
Admin → Clients → Export CSV downloads the client list.
A client's personal data
When a client asks for a copy of their data, open them in Admin → Clients → Notes → Export data (managers and the owner). It downloads one JSON file with their profile, bookings, payments, points, reviews, packages and notifications.
Deleting an account
Clients delete their own account in the client app: Account → Edit profile → Delete my account, confirmed with their password. The screen first lists what they lose: points, packages (no refund for sessions left), upcoming bookings and their history. When they confirm:
- Their upcoming bookings are cancelled under the normal client rules: inside the free window the deposit is refunded to the card; after it, the late-cancel fee the policy sets is kept.
- They are signed out everywhere at once, and the account can't sign in again. The email address is free for a new account.
- After a 30-day grace period, the daily purge removes their sessions, devices, reset links, notifications and uploaded files, then the account itself. Where paid bookings and payments must stay in your books, the account is kept only as "Deleted account": its name, email, phone, password, picture and notes are wiped.
The only owner of the business can't delete their account until someone else is an owner.
What the demo hides
On a public demo (chapter 31), the demo sign-ins see real visitors' emails and phone numbers masked, the data export is locked, and each visitor who signs in as the sample client gets a private copy that nobody else sees.
The sample business
The sample business
The sample business is a salon group called Chairwise in the made-up city of Linden Bay, on New York time, with prices in US dollars:
| Branch | Address | What it offers |
|---|---|---|
| Old Town | 18 Market Lane | Hair and barber |
| Riverside | 240 River Road | Hair, nails, brows and lashes |
| Harbor Spa | 5 Pier Street | Massage, skin and body |
It has 7 categories, 22 services (from a men's cut to a 90-minute massage, some with a deposit), 12 staff with their skills and weekly hours, 60 clients, 3 packages (Blow-dry 5-pack, Skin fade 5-pack, Swedish massage 3-pack), time off, reviews, and bookings for the last 8 weeks and the next 14 days, all relative to today. DEMO_SEED_SIZE=small loads only today and the sample people's own story, for quick tests.
Five people sign in, one per role:
| Role | Person | Signs in on |
|---|---|---|
| Owner | Rosa Delgado | Admin website |
| Branch manager | Tessa Morgan (Old Town) | Admin website |
| Front desk | Jade Lowe | Admin website |
| Stylist | Maya Okafor | Staff app |
| Client | Olivia Grant | Client app, booking website |
Every booking, payment, visit, cancellation, no-show and review of the sample is made through the server's own rules, so the totals, points and ratings add up. Photos: the public demo shows licensed stock photos that are not in the download; without them, people show their initials and services and branches show a brand panel. Add your own photos in the admin website.
Demo mode and the seed commands
Demo mode
DEMO_MODE="true" in .env turns an install into a public demo, like the item's live preview. Never turn it on for a real business; the shipped file has it "false". With it on:
- The sample business is loaded at start and rebuilt every night at 03:00 in the business's time zone (Settings → General; New York for the sample).
- The sign-in pages show one-click sign-ins: on the web the owner, the branch manager and the front desk, and "Try the demo as Olivia" on the website's client sign-in; in each app (built with
DEMO_LOGINS=true) that app's person: in the staff app a stylist who works today (Maya when she works, so the day is never empty), in the client app the client. - Each visitor who signs in as the client gets a private copy of Olivia (her points, package, past visits and upcoming bookings). Nobody else sees it, its bookings hold no stylist's time, and it is removed after 24 hours with everything it booked.
- The team sign-ins are shared: booking work (book, move, check in, check out, refund) works, while the menu, staff, branches, policies, the team, settings, photos, review replies and data exports are locked. Real visitors' emails and phone numbers are masked.
- The sample day moves on by itself, once a minute: sample visits are checked in 5 minutes before they start, started 2 minutes after, finished at their end and paid 5 minutes later (a few pay-at-the-salon visits are missed instead), and two new bookings arrive each hour. A booking a visitor made is never touched.
- Card payments finish on a test page without Stripe (labelled DEMO), the install wizard is off, saved secrets show only as set or not set, and demo emails are not sent to the sample people.
Settings → Demo mode shows whether it is on. To turn it off, set DEMO_MODE="false" and restart the app (docker compose up -d); the sample data stays until you remove it.
Seed commands
| Command | What it does |
|---|---|
docker compose exec app chairwise seed-demo | Adds the sample business, every row marked as sample data. It only adds rows and never deletes anything. It refuses a database with any real account; --confirm adds the sample business next to real data anyway. |
docker compose exec app chairwise reset-demo | Removes the sample data and adds it again. It refuses to run when the database holds any real account, with no way round it. |
| Admin website → Settings → Maintenance → Remove demo data | Deletes only rows marked as sample data (see above). |
docker compose exec app chairwise migrate | Applies the database migrations and stops (the server also does this on every start). |
Real accounts, bookings and payments are never marked as sample data, so no seed or reset command can touch them.
Security
Security notes
What the server checks and limits, so you can answer your team's and clients' questions and know what to keep safe.
Who sees what
- The signed-in person always comes from the session, never from the request. A client's own files and bookings answer "not found" to anyone else outside the team.
- Roles (owner, manager, front desk, staff, client) are checked by the server on every request; the screens only hide what a role cannot use. Each app accepts only its own kind of account.
- Staff see only their own bookings: another stylist's booking answers "not found". They see their own clients' names, notes and contact details, never the client list.
- The front desk, managers and the owner see the clients and their bookings. Only managers and the owner export a client's data or change points.
- A guest's manage link opens only that one booking. Its token is stored only as a hash.
- In demo mode, real visitors' emails and phone numbers are masked for the demo sign-ins.
Accounts and sessions
- Passwords (at least 10 characters) are hashed with Argon2id. A password change or reset signs the person out on every other device.
- On the web, the
cw_sessioncookie is HttpOnly, Secure on https and SameSite=Lax; it lasts 30 days and is renewed while in use, or only until the browser closes when "keep me signed in" is off. Every change made with the cookie must carry the headerx-chairwise: 1, which other sites cannot add, so they cannot act for a signed-in person. - The apps sign in with a token sent as
Authorization: Bearer. It lasts 90 days, is renewed while the app is used, and is kept in the phone's secure storage (the iOS Keychain, the Android Keystore). - Session tokens, reset links and invitations are stored only as SHA-256 hashes.
- The secrets you save in Settings (Stripe, SMTP, storage, the Firebase service account) are encrypted with AES-256-GCM, with a key derived from
APP_SECRET. KeepAPP_SECRETand your backups safe, and never change it after the install. - Deleted accounts are removed for good after 30 days.
Money
- Payments are confirmed only by Stripe events with a valid signature and a timestamp no more than 5 minutes off, each applied once.
- Prices, deposits, points and package sessions are worked out by the server from the services, never taken from the request. The quote and the booking use the same code.
- Card details are typed on Stripe's page and never reach your server.
- Refunds are recorded before they are sent and carry a key that stops Stripe from refunding twice; a refused refund is undone.
- Spending points and package sessions is one conditional database change each, so two bookings can never spend the same points or the last session.
- Two bookings of one stylist can never overlap (chapter 24).
- Demo payments run only with
DEMO_PAYMENTSorDEMO_MODEand are never counted as money.
Rate limits
These limits are kept in PostgreSQL, so they hold across restarts and several copies of the server. They are keyed by a keyed hash of the account or the visitor address (taken only from trusted proxies, chapter 7), never by a plain address:
| Limit | Allowed | What it protects |
|---|---|---|
| Sign-in, per address | 20 per 15 minutes | Sign-in attempts from one address |
| Sign-in, per account | 5 per 15 minutes | Wrong passwords for one account; after five the account waits, even for the right password |
| Sign-up, per address | 5 per hour | New accounts from one address |
| Password reset, per address | 5 per hour | Password reset emails asked for from one address |
| Password reset, per account | 3 per hour | Password reset emails sent to one account |
| Reset and invite links, per address | 20 per hour | Tries at a reset or invite link from one address |
| Demo sign-in, per address | 60 per hour | Public demo sign-ins from one address |
| Invites, per business | 50 per hour | Invites sent by one person of the team |
Every other API call takes from short-term allowances in memory: each signed-in person may make 240 calls at once and then 20 a second, and all calls from one visitor address together (counted only behind a trusted proxy) 1,200 at once and then 60 a second. The Stripe webhook is never limited. A refused call answers 429 with a Retry-After header.
Uploads and files
- Uploads are checked by their content, not their name (chapter 12), and count against the room of the business or the person. The logo may be PNG, WebP or SVG; an SVG with scripts is refused.
- The business's files reach the team only; a person's own files reach them and the admin website.
- Photos of services, staff, branches, packages and categories are public at
/api/v1/photos/…, but only while a public record uses them; a replaced photo is removed from storage.
What loads from other servers
The web app's fonts and icons are part of the build, and the apps bundle their own fonts. Stripe's payment pages open on Stripe's own site. Push notifications go through Firebase. "Directions" hands the branch's position to Apple Maps or Google Maps; the client's own location, used to sort branches by distance, stays on the phone.
Keep it safe
- Use https (chapter 7), long unique passwords and two-factor sign-in on your Stripe, Firebase, Apple, Google, email and server accounts.
- Keep
.env, the apps'.envfiles,android/key.properties, the upload keystore, the Firebase service account file and your backups private. - Install Chairwise updates; security fixes are marked as such in the changelog.
For developers
Every server key, explained
Every setting in the server's .env. The outside-service keys can also be set in the admin website → Settings, which takes precedence. This table is generated from .env.example and the server's own settings code when the release is built. The apps' keys are in chapter 16.
| Key | Required | What it does |
|---|---|---|
| Required | ||
APP_URL | Yes | The public address of the app, without a trailing slash, for example https://book.example.com. Links in emails, the Stripe webhook address and secure cookies come from it. Use https on a public server. |
APP_SECRET | Yes | A long random string of at least 32 characters (openssl rand -hex 32). It encrypts saved keys and keys the hashed visitor addresses of the rate limits. Never change it after the install: saved keys could no longer be read. |
POSTGRES_DB | No | The name of the database the stack creates. Default chairwise. |
POSTGRES_USER | No | The database user the stack creates. Default chairwise. |
POSTGRES_PASSWORD | Yes | The database password. Letters and digits only, because it goes into a connection address. |
DATABASE_URL | Outside Docker | The database address, only when you run the server without Docker. Leave it empty with Docker: the stack builds its own from the three keys above. |
INSTALL_TOKEN | No | The token the install wizard asks for. Empty: a new one is printed in the app's log on first start. |
| File storage (service and staff photos, profile photos, logo) | ||
STORAGE_DRIVER | No | s3 (the bundled MinIO, AWS S3 or Cloudflare R2) or local (files in a Docker volume). Default in Docker s3. |
S3_ENDPOINT | With s3 | The storage address. The bundled MinIO is http://minio:9000; for R2 use your account's S3 address; for AWS S3 leave it empty. |
S3_REGION | No | The bucket's region. Default us-east-1; R2 uses auto. |
S3_BUCKET | No | The bucket name. Default chairwise; the stack creates it in MinIO. |
S3_ACCESS_KEY_ID | With s3 | The storage access key. With the bundled MinIO this is also its admin user. |
S3_SECRET_ACCESS_KEY | Yes | The storage secret, at least 8 characters. With the bundled MinIO this is also its admin password, so Docker refuses to start without it. |
LOCAL_STORAGE_DIR | Set by Docker | The folder for files with STORAGE_DRIVER=local (/app/storage in Docker, a volume). |
| Payments (Stripe; empty = card payments off) | ||
STRIPE_SECRET_KEY | For card payments | The business's Stripe secret key (sk_live_…, or sk_test_… while testing). Empty: card payments are off. |
STRIPE_WEBHOOK_SECRET | For card payments | The signing secret (whsec_…) of the webhook endpoint you add in Stripe for APP_URL/api/v1/webhooks/stripe. |
STRIPE_PUBLISHABLE_KEY | For card payments | Your Stripe publishable key (pk_live_… or pk_test_…), for Stripe's card form when a client pays. |
| Push messages (Firebase Cloud Messaging; empty = push off) | ||
FCM_PROJECT_ID | No | Your Firebase project id and its service account key (Firebase console → Project settings → Service accounts → Generate new private key), pasted as one line of JSON. You can paste the file in the admin website → Settings instead. |
FCM_SERVICE_ACCOUNT_JSON | No | Your Firebase service account key (Firebase console → Project settings → Service accounts → Generate new private key) as one line of JSON, with FCM_PROJECT_ID. Empty: no push messages. Easier: paste the file in the admin website → Settings → Push, which takes precedence and stores it encrypted. |
| Email (SMTP; empty = emails are written to the app's log) | ||
SMTP_HOST | For email | Your email provider's SMTP server. Empty: emails are written to the app's log instead of being sent. |
SMTP_PORT | No | The SMTP port. Default 587. |
SMTP_USERNAME | For email | The SMTP user name. |
SMTP_PASSWORD | For email | The SMTP password or API key. |
SMTP_SECURE | No | starttls (port 587, the default), tls (port 465) or none. |
SMTP_FROM | For email | The sender, for example Chairwise <hello@example.com>. Use an address on a domain your provider has verified. |
| Network | ||
APP_PORT | No | The port on this server where the app answers. Default 8080. |
APP_BIND | No | Which address the port is open on. Default 127.0.0.1: this server only, so visitors come in through Caddy or your own proxy. Use 0.0.0.0 only with TRUSTED_PROXY_HOPS=0 or a firewall that lets only your proxy reach the port. |
APP_DOMAIN | With Caddy | The domain Caddy gets an HTTPS certificate for: the host of APP_URL, for example book.example.com. |
TRUSTED_PROXY_HOPS | No | How many reverse proxies in front of the app add the visitor's address to X-Forwarded-For. 1 = the bundled Caddy (the default in Docker); 0 = trust no proxy. Never set it higher than the proxies really in front of the app. |
| Advanced | ||
COMPOSE_PROJECT_NAME | No | Only for a second copy on the same server (for example staging): give each copy its own name, so their containers, database, files, network, image and build cache stay apart. Empty = the name of the Chairwise folder. |
SEARCH_INDEXING | No | on (the default): search engines may index the public pages (home, legal, sign-in), never the app or the API. off, for a staging copy: /robots.txt closes every page and every answer carries X-Robots-Tag: noindex, nofollow. |
JOB_WORKERS | No | Background job workers in this server, 1 to 32. Default 4. |
DRAIN_SECS | No | For zero-downtime deploys: seconds a stopping server reports itself unhealthy, so a proxy moves visitors to the new copy, before it exits. Default 0. |
DEMO_MODE | No | Only for a public demo: "true" adds the sample business and one-click sign-ins for every role, makes sign-ups demo accounts and resets the data every night. Keep "false" on a live site. |
DEMO_PAYMENTS | No | "true" lets card payments finish without Stripe (paid at once, labelled DEMO). Only for a private test copy; never on a live site. DEMO_MODE turns it on as well. |
DEMO_SEED_DIR | No | The folder chairwise seed-demo reads the sample business and the starter legal pages (legal/<slug>.md) from. The Docker image already points at its own copy of apps/backend/seed; set it only to load your own folder of the same shape. Remove the sample data in the admin website → Settings → Maintenance. |
DEMO_PHOTOS | No | A folder of licensed photos for the sample salon (staff, branches, services; <name>.webp). Empty = the demo shows initials and colour tiles instead of photos. |
DEMO_SEED_SIZE | No | "small" seeds a lighter sample salon (today's visits and the sample clients' story, no 8 weeks of history or 2 weeks ahead) for quick test runs; empty or "full" seeds the whole sample salon. The public demo uses the full one. |
RUST_LOG | No | How much the server logs: info (the default), warn, error or debug. |
| Set by Docker, or for development | ||
ASSET_ARCHIVE | No | For your own zero-downtime deploys: a folder that keeps older builds' files, so pages still open in a browser keep working. |
BIND | No | The address the server listens on. Default 0.0.0.0: plus PORT. |
BUILD_TARGET | No | How Docker gets the program: built (the default, built on this server) or prebuilt (uses prebuilt/chairwise, built elsewhere). |
PORT | Set by Docker | The port the server listens on inside its container (8080). |
READY_FILE | No | For your own zero-downtime deploys: the health check passes only once this file exists. |
STRIPE_API_URL | No | For tests only: another address for Stripe's API. Default https://api.stripe.com. |
WEB_DIST | Set by Docker | Where the built web app is, when it is not packed into the program. |
File structure
Server and web app
chairwise/
├── apps/
│ ├── backend/ the Rust server (Axum): crate chairwise-server, program "chairwise"
│ │ ├── src/main.rs the commands: serve, migrate, health, seed-demo, reset-demo, pack
│ │ ├── src/lib.rs the HTTP app: /api/health, /api/v1, the web app, middleware
│ │ ├── src/api/ one file per area: public, auth, me, team, bookings, desk, payments,
│ │ │ catalog, staff, staff_app, clients, schedule, reviews, packages, …
│ │ ├── src/availability.rs the availability engine (pure: hours, shifts, breaks, buffers, time zones)
│ │ ├── src/bookings/ making, changing and moving bookings along; the staff locks
│ │ ├── src/pricing.rs deposits, quotes, cancel and no-show terms, commission (pure)
│ │ ├── src/payments.rs Stripe Checkout, the webhook rules, refunds, demo payments
│ │ ├── src/checkout.rs the counter checkout
│ │ ├── src/loyalty.rs, src/packages.rs points and packages
│ │ ├── src/reminders.rs reminders and review requests, each sent once
│ │ ├── src/ops.rs the 2-second loop: holds, reminders, points expiry, the demo's day
│ │ ├── src/auth.rs sessions, the roles and their guards
│ │ ├── src/settings.rs the business settings over .env
│ │ ├── src/setup_check.rs the setup check rows and live tests
│ │ ├── src/stripe.rs Stripe on the business's account and the apply-once webhook
│ │ ├── src/push.rs push notifications (Firebase Cloud Messaging) and the in-app list
│ │ ├── src/jobs.rs the job queue (refunds, housekeeping, purge, the demo reset)
│ │ ├── src/demo.rs the demo sign-ins, the starter legal pages and the nightly reset
│ │ ├── src/salon_demo/ the sample salon, its simulated day and private client copies
│ │ ├── seed/ legal/ (starter legal texts) and linden_bay.json (the sample business)
│ │ ├── tests/ server API tests (need a PostgreSQL, see the Tests chapter)
│ │ └── README.md every module of the server, for developers
│ └── frontend/ the web app (React Router 7, Vite, Tailwind CSS 4)
│ ├── src/routes.ts every page: URL → file (lists in src/routes/)
│ ├── src/pages/ admin/ (today, bookings, people, catalogue, growth, settings, team),
│ │ public/ (home, site, book, manage, account), auth/, install/
│ ├── src/ui/, src/components/ui/ shared parts and shadcn/ui components
│ ├── src/layout/ the app shell, sidebar and sign-in guards
│ ├── src/api/ the API client and types
│ ├── src/styles.css colours, fonts and sizes (design tokens)
│ ├── e2e/ browser tests (Playwright)
│ └── README.md the web app's stack, scripts, folders and build
├── migrations/ the database schema (applied on start)
├── docker/ Dockerfile, docker-compose.yml, Caddyfile
├── compose.yaml "docker compose up" from this folder
├── tools/rename.mjs renames and rebrands the apps and the web defaults (chapter 17)
├── Cargo.toml, Cargo.lock the Rust workspace
├── .env.example every server setting
└── docs/ this guide (HTML and PDF) and the third-party licences
The Flutter apps
chairwise_mobile_flutter/
├── lib/
│ ├── main.dart, app.dart start-up and the app root
│ ├── core/
│ │ ├── constants/ app_env.dart (every .env key), app_role.dart (the two apps)
│ │ ├── theme/app_theme.dart colours, sizes and type, light and dark
│ │ ├── router/ the routes, deep links, the tab bars
│ │ ├── providers/ app state (Riverpod): session, push, sync, theme
│ │ ├── services/api/ the API client (token, errors, offline cache)
│ │ ├── services/data/ sign-in and uploads
│ │ ├── services/firebase/ Firebase start-up and push
│ │ └── services/general/ the secure token store and app preferences
│ ├── domain/models/ the JSON the API answers, as Dart classes
│ ├── components/ shared widgets: bars, controls, feedback
│ └── features/ common/ (sign-in), client/ (launch, home, discover, booking,
│ bookings, account), staff/: the screens
├── android/ app/build.gradle.kts (flavours, ids, names, signing),
│ app/src/<flavour>/google-services.json
├── ios/ Runner (schemes client, staff), config/<flavour>/GoogleService-Info.plist
├── assets/fonts/ Albert Sans and Bodoni Moda, with OFL.txt
├── assets/icon/ client.png, staff.png: the app icon sources
├── flutter_launcher_icons-*.yaml the icon settings of each app (dart run flutter_launcher_icons)
├── test/ unit and widget tests
├── pubspec.yaml packages, fonts and the app version
└── .env.example every app setting
Customise and rebuild
Run it for development
- Start a PostgreSQL (your own, or
docker compose up -d postgreswithports: ["127.0.0.1:5432:5432"]added to the postgres service in acompose.override.yaml) and setDATABASE_URLin.env. For development setSTORAGE_DRIVER=local. - Start the server from
apps/backend:cargo run -- serve(it reads.envfrom the folder or the ones above it and listens on port 8080). - Start the web app from
apps/frontend:pnpm install, thenpnpm dev, and openhttp://localhost:5173. Calls to/apigo to the server on port 8080 (API_ORIGINchanges that). Screens reload as you save. - Run an app against it:
API_BASE_URL=http://10.0.2.2:8080in the app.envfor the Android emulator, thenflutter run --flavor client --dart-define-from-file=.env. Flutter's hot reload works as usual.
Without a server at all, flutter run --flavor client --dart-define=SAMPLE_DATA=true runs an app on its built-in sample salon. How to run the tests is in chapter 36.
Change the server
- Each area of the API is one file in
apps/backend/src/api/; itsroutes()function lists the addresses. The business rules are in the modules named after them;apps/backend/README.mdlists every module. - A database change is a new file in
migrations/namedYYYYMMDDHHMMSS_what.sql. Never edit a migration that has already run: the server checks them.
Change the web app
apps/frontend/README.mdexplains its stack, scripts, folders and the production build.- Colours, fonts and sizes are CSS variables in
apps/frontend/src/styles.css; the brand colour from Settings → Branding overrides--brandat run time. - Pages are in
apps/frontend/src/pages/;src/routes.tsmaps each URL to its file. The admin website issrc/pages/admin/and the public homesrc/pages/public/home/.
Change the apps
- Screens are in
lib/features/<app>/, the tab roots in its*_tabs.dartfile, and the shared widgets inlib/components/. In debug builds,/debug/componentsshows every shared widget in light and dark. - Every API call goes through
lib/core/services/api/. - A new setting goes into
.env.exampleand is read inlib/core/constants/app_env.dart, never written into the code.
Rebuild and deploy your changes
docker compose up -d --build # or with --profile https on your server
Docker rebuilds only what changed; a change to the web app alone reuses the compiled server and is quicker still. Rebuild the apps with the commands in chapter 18. Keep your changes in a Git repository, so you can compare them with each new Chairwise version.
Tests
Every part has its own tests. Run them from the folder named in each row.
| Part | Command | What it covers |
|---|---|---|
| Server, unit tests in apps/backend | cargo test -p chairwise-server --lib | No database needed. The availability engine (opening hours, shifts, breaks, early closes, clean-up times, the slot grid, time zones, the daylight-saving gap and repeated hour) and the money rules (deposits, quotes, points steps, cancel and no-show terms, commission), the Stripe signature check and the settings. |
| Server, API tests in apps/backend | TEST_DATABASE_URL=postgres://postgres:postgres@127.0.0.1:55432/postgres cargo test -p chairwise-server | The whole server in process against a real PostgreSQL, with a stand-in Stripe on a local port (never the internet). Races (two clients for one time, a reschedule against a new booking, a calendar drag against a client, a walk-in against an online booking, two bookings spending the same points, the last package session); money (deposits, paying in full, card required, points and packages, a webhook delivered twice, refunds claimed once, free and late cancels, the counter checkout, commission and tips, demo payments); rules (the cancel window to the second, the change window and count, reminders exactly once and across daylight saving, reviews once, time off over bookings, no-shows after the grace); every role against every area; the client app, the staff app, the desk, uploads, the purge, push and the demo. |
| Server, lints | cargo clippy --workspace --all-targets -- -D warnings | Kept clean. cargo deny check checks advisories and licences. |
| Website, unit tests in apps/frontend | pnpm test | Vitest: the calendar's maths and model, the CSV import, the install wizard, the role rules, prices and policy words, the public pages' helpers. Also pnpm typecheck and pnpm lint (Biome). |
| Website, browser tests (no server) in apps/frontend | pnpm e2e | Playwright against the production build with a stand-in API: install, settings, sign-in, and the sign-in inside a frame. Install the browsers once with pnpm exec playwright install. |
| Website, browser tests (real server) in apps/frontend | E2E_BASE_URL=http://localhost:8080 pnpm e2e e2e/salon | Against a running server with DEMO_MODE=true and the sample business: each role's pages, the calendar, the desk and checkout, refunds, the booking website from start to booked, two screen widths and the demo sign-in in a frame in Chromium, Firefox and WebKit. Changes the demo locks need the real owner's login in E2E_OWNER_EMAIL and E2E_OWNER_PASSWORD. |
| Apps in chairwise_mobile_flutter | flutter test | Models, the API client, the router, the built-in sample salon, the booking and managing flows, the staff flows, and every screen in light and dark. flutter analyze checks the code. |
| Apps, other time zone | TZ=Asia/Tokyo flutter test | The same tests on a "phone" in Tokyo: a visit booked for 10:30 AM in New York still shows 10:30 AM, never the phone's own time. |
| Apps against a server | LIVE_API=http://localhost:8080 flutter test test/live_api_test.dart | Reads every answer the apps use from a running server with the apps' own models and checks its shape. Skipped when LIVE_API is not set. |
A PostgreSQL for the API tests, with Docker:
docker run -d --name chairwise-test-pg -e POSTGRES_PASSWORD=postgres -p 127.0.0.1:55432:5432 postgres:17
The login must be allowed to create databases: each test makes its own fresh one. Without TEST_DATABASE_URL the API tests say so and pass. Remove the container afterwards with docker rm -f chairwise-test-pg.
Running on several servers
One server copy is plenty for most salon groups. For more visitors, or to update without a pause, you can run several copies of the same program behind one load balancer.
What every copy must share
- One PostgreSQL database (the same
DATABASE_URL). Every record, lock, job and rate limit lives there. - One S3-compatible bucket for files (
STORAGE_DRIVER=s3).STORAGE_DRIVER=localkeeps files on one machine's disk, which the other copies can't see. - The same
.env: above all the sameAPP_SECRET(it unlocks the keys saved in Settings) and the sameAPP_URL. - The visitor's address: set
TRUSTED_PROXY_HOPSto the number of proxies in front of the copies (chapter 7). Turn off response buffering for/api/v1/events, the live update stream.
What stays right with several copies
| What | Why it is safe |
|---|---|
| No double booking | The stylist locks and the overlap guard are in PostgreSQL, not in a copy's memory (chapter 24). |
| Reminders sent once | One copy at a time sends them (a PostgreSQL lock), and each send is first recorded per booking and kind, so a second copy can't send it again. |
| Background jobs | Each job is claimed by one worker (FOR UPDATE SKIP LOCKED). The hourly, daily and nightly jobs carry a key for their hour or day, so they run once however many copies are up. A job left running by a copy that crashed goes back to the queue after 10 minutes. |
| Payment holds and points expiry | Every copy looks every 2 seconds (holds) or every hour (points); each payment or points row is locked while it ends, so it ends once. |
| Stripe events | Each event's id is stored before it is applied, so one event is applied once whichever copy gets it. |
| Double taps | Request keys are kept in PostgreSQL for 24 hours. |
| Sign-ins | Sessions are stored in PostgreSQL, so any copy can answer any visitor; no sticky sessions are needed. |
| Live updates | Changes travel through PostgreSQL (LISTEN/NOTIFY), so a booking made through one copy reaches screens open on every other copy. Settings saved on one copy reload on all of them. |
| Rate limits | The sign-in, sign-up, password reset and invitation limits are kept in PostgreSQL and shared. The short-term allowances for the rest of the API are kept in each copy's memory, so each copy gives its own. |
Settings for several copies
JOB_WORKERS(1 to 32, default 4) is the number of jobs each copy runs at once. Three copies with the default run up to 12 jobs at a time; that is plenty.- Database connections: each copy opens up to 20 connections to PostgreSQL (one of them listens for live updates). Allow at least 20 per copy plus room for backups and your own tools in PostgreSQL's
max_connections(100 by default). - Connection poolers such as PgBouncer must run in session mode. Transaction mode breaks the live updates (LISTEN) and the reminders' lock.
- Updating without a pause:
DRAIN_SECSmakes a stopping copy report itself unhealthy for that many seconds before it exits, so the load balancer moves visitors to the new copy first. Every copy applies new migrations when it starts; start one new copy first, then the rest.
API reference
The web app, the two apps and your own integrations use the same /api/v1 API. These 177 addresses are generated from the server code when the release is built.
- JSON in and out with camelCase keys; times in ISO 8601 UTC; money in whole cents of the business currency (
…Cents); ids are UUIDs. - Every booking carries both its real moment (
startsAt, UTC) and the branch's ownlocalDate,localTimeandtimeZone. Show the local values; never convert the time yourself. - Errors:
{"error": {"code": "…", "message": "…"}}with the HTTP status, for examplewrong_login(401),wrong_app,suspended,demo_locked(403),slot_taken,card_required,online_booking_off,change_window_closed,storage_full(409) andrate_limited(429). The message is written to be shown to people as it is. POST /bookingsandPOST /packages/{id}/buytake anIdempotency-Keyheader (1 to 200 characters): the same key from the same person within 24 hours gets the first answer again and makes nothing new.- The web app signs in with the
cw_sessioncookie and sendsx-chairwise: 1on every change. The apps send"client": "app"and their"role"(clientorstaff) to/auth/loginand get a token back, then sendAuthorization: Bearer <token>. - Live updates:
GET /api/v1/eventsis a Server-Sent Events stream for the signed-in person and the business (booking.updated,calendar.changed,counts,notification.new,catalog.changed,settings.changed).
| Method | Address | Who may call it | What it does |
|---|---|---|---|
| System | |||
GET | / | Anyone | 200 while the server runs, 503 while it hands over to a new copy during a deploy |
GET | / | Anyone | The running build's version; open pages compare it with their own to offer a reload after a deploy |
GET | / | Anyone | Tells search engines which pages they may index: the public pages, or none with SEARCH_INDEXING=off |
| Public pages, install and inbound webhooks | |||
GET | / | Anyone | The brand, the sign-up mode, money and time zone, the app links, demo sign-ins and what the web app and the apps need before sign-in (installed: false sends every page of the web app to the install wizard) |
GET | / | Anyone | One legal page, with when the legal pages were last saved |
GET | / | Anyone, until the install is done (install token) | Whether the install wizard has run |
POST | / | Anyone, until the install is done (install token) | Checks the install token and the setup before the wizard's last step |
POST | / | Anyone, until the install is done (install token) | Finishes the install (runs once): { token, owner: { name, email, password }, business: { name, supportEmail?, currency?, timezone? }, branch? } makes the owner, saves the business and signs the owner in |
GET | / | Anyone | The uploaded brand logo (no sign-in; long cache, the name changes with the file) |
POST | / | Stripe (signed webhook) | Stripe's signed events; each is applied once by [apply_event] |
| Sign-in and account | |||
POST | / | Anyone | Creates a client account (the client app with "client": "app", or the website) while sign-ups are open; the team joins by invitation only |
POST | / | Anyone | Signs in with email and password; "client": "app" (with role: client or staff) answers a session token for the apps instead of a cookie |
POST | / | Signed in | Signs out of this browser or app (the session and its push token go) |
GET | / | Signed in | The signed-in person, their role and capabilities |
GET | / | Anyone | The signed-in person like /auth/me, or { me: null } when signed out (always 200) |
POST | / | Anyone | Emails a password reset link when the email belongs to an account |
POST | / | Anyone | Sets a new password with a reset link and signs in (each link works once) |
GET | / | Anyone | Whose link this is (404 when it expired or was used) |
GET | / | Anyone | What an invitation link is for (business, role, email) |
POST | / | Anyone | Accepts a team invitation, signing in or creating the account |
PATCH | / | Signed in | Changes the person's name, phone or picture |
POST | / | Signed in | Changes the password (the current one is asked for); other sessions end |
POST | / | Anyone, public demo only | One-click demo sign-in as owner, manager, front desk, staff or client (also at /demo/sign-in); "client": "app" answers a session token; the client gets a private copy of the demo client |
POST | / | Signed in | Saves this device's push token (token, platform: android, ios or web, app: client or staff), one per session |
DELETE | / | Signed in | Stops push messages to this device (the person turned them off) |
GET | / | Signed in | The signed-in person's profile: name, email, phone, role, photo, push choices (notifications: {bookings, reminders, offers, reviews}), usual branch, memberSince, completed visitCount and the client's own notes for their stylist |
PATCH | / | Signed in | Changes any of name, phone, avatarUrl, notifications (booleans per kind), defaultBranchId and notes (the client's own note for their stylist, at most 500 characters); answers the profile |
DELETE | / | Signed in | Deletes the person's own account (password asked, or confirm: "DELETE" from an app); the client's upcoming bookings are cancelled under the normal cancel rules first; it signs out everywhere and is purged after 30 days. A demo visitor's private copy is removed at once |
GET | / | Client | The client's bookings, 20 a page (upcoming soonest first, past newest first) |
GET | / | Client | The client's home in one call: next booking, rebook suggestion, points, packages, unread |
GET | / | Client | The client's points, what they are worth, what expires soon and the history |
GET | / | Client | The client's packages with the sessions left |
GET | / | Signed in | The inbox, newest first, with the unread count |
POST | / | Signed in | { ids } or { all: true } marks notifications read |
| Salon catalogue, availability and photos | |||
GET | / | Anyone | A photo of the sample salon from the DEMO_PHOTOS folder (name.webp only; 404 when the folder is not set or has no such file) |
GET | / | Anyone | The active branches (?lat=&lng= sorts nearest first and adds distanceKm) |
GET | / | Anyone | One branch with its hours and closed days |
GET | / | Anyone | The active categories with their service counts |
GET | / | Anyone | The active services |
GET | / | Anyone | One active service |
GET | / | Anyone | The staff (able to do every given service), with ratings from the visible reviews and their next free slot |
GET | / | Anyone | One staff member: bio, skills, the latest reviews, the next free slot |
GET | / | Anyone | The free start times per day for a visit at a branch, with one staff member or anyone (each slot lists who is free), in the branch's wall time, and the next available slot |
GET | / | Anyone | A photo a public record uses (a service, branch, package, category, or a staff member's picture); 404 for any other file |
GET | / | Anyone | The packages on sale |
POST | / | Client | { returnUrl? } starts buying a package by card → { purchase, payment: { checkoutUrl, expiresAt } } (201); it turns active when the payment arrives |
GET | / | Anyone | The visible reviews, newest first (20 a page) |
GET | / | Anyone on the team | My profile — name, title, photo, my branch today, rating and count, my manager's name and phone, the services I do |
GET | / | Anyone on the team | My day (branch, shift and break, bookings, free gaps, a summary) |
GET | / | Anyone on the team | 7 days: hours, booking counts, first and last booking |
GET | / | Anyone on the team | One of my bookings, with the client's visit count and the salon's notes |
POST | / | Anyone on the team | Checks my client in (from an hour before) |
POST | / | Anyone on the team | Starts my visit |
POST | / | Anyone on the team | { extraServiceIds? } finishes my visit (the front desk takes the payment) |
POST | / | Anyone on the team | Marks my client a no-show (after the grace minutes) |
POST | / | Anyone on the team | { serviceIds, clientName, clientPhone?, startsAt? } books a walk-in with me at the picked time, else at my first free time from now today (201) |
GET | / | Anyone on the team | My weekly shifts and breaks and my coming time off |
POST | / | Anyone on the team | { message } asks the manager to change my hours (201); it shows in Admin → Time off until a manager marks it done |
GET | / | Anyone on the team | My time-off requests, pending first |
POST | / | Anyone on the team | { startsAt, endsAt, reason } asks for time off (pending until a manager decides; the clients it would affect are counted) |
DELETE | / | Anyone on the team | Withdraws a pending request of mine |
GET | / | Anyone on the team | A week's services, commission, tips and total, per day |
GET | / | Anyone on the team | My notifications (the same inbox as /me/notifications) |
| Bookings and payments | |||
POST | / | Anyone | The money of a visit before booking (the same calculation as the booking): package cover, points, deposit, what is paid now, what is due at the salon, points to earn, the policy windows and the open pay modes |
POST | / | Anyone | Books a visit for the signed-in client, or a guest (guest: { name, email, phone }, who gets a manage link by email and manageUrl in this answer) |
GET | / | Signed in | One booking with its events, for its client (the team sees any booking in the admin; a staff member their own) |
GET | / | Client | What cancelling now does (free or not, the fee, the refund, points and package session back, free until when) |
POST | / | Client | { reason? } cancels under the policy (free until the window: everything back; late: the deposit is kept); until the start |
POST | / | Client | { startsAt, staffId? } moves the booking to a free slot until the change window closes (409 change_window_closed with the branch phone) and at most the allowed times |
POST | / | Client | { rating, comment }, once per completed visit |
GET | / | Client | The same services and staff member at the slot nearest the client's usual gap between visits (or the next free one) |
POST | / | Client | { payMode?, returnUrl? } a booking waiting for its card payment (e.g. after a declined card) gets its checkout again for the same payment, or with payMode: "at_salon" switches to paying at the salon when the policy allows it; a confirmed booking pays what is still due online |
PUT | / | Client | { on } the client's "Remind me 2 hours before" switch for this booking (the same-day reminder; the day-before one and the inbox stay) |
GET | / | Anyone | The guest's booking from their email link |
GET | / | Anyone | What cancelling the guest's booking now does |
POST | / | Anyone | The guest cancels under the policy |
POST | / | Anyone | { startsAt, staffId? } the guest moves their booking |
PUT | / | Anyone | { on } the same switch from the guest's email link |
POST | / | Anyone | The guest's POST /bookings/{id}/pay from their manage link |
GET | / | Anyone | The guest's GET /availability for moving their booking (the same params), with that booking's own time not counted as busy; a moving id other than that booking is 404 |
GET | / | Anyone | The demo card page (a test page, never a real payment) |
POST | / | Anyone | { token, cardNumber } pays a demo payment (4242… pays, 4000 0000 0000 0002 is declined: 402 card_declined) and answers where to go back to |
| Notifications | |||
GET | / | Signed in | The signed-in person's notifications, newest first, 30 a page (?cursor= the next of the page before), with the unread count |
POST | / | Signed in | { ids? } marks the given notifications read (all without ids) |
| Team, files and live updates | |||
POST | / | Anyone, public demo only | POST /api/v1/auth/demo (also POST /api/v1/demo/sign-in): one-click demo sign-in as any demo role (DEMO_MODE only): as (or role) is owner, manager, front_desk, staff or client; a client gets a private copy of Olivia's account, staff a stylist working today (Maya when she does); "client": "app" answers the token |
GET | / | Signed in | Live updates (Server-Sent Events) for the person's business and account: ready, a ping every 25 seconds and refetch when a screen fell behind |
GET | / | Front desk, manager or owner | The members and the open invitations (invitations for managers and the owner only) |
POST | / | Owner or manager | Invites someone by email to the front desk, as staff or as a manager (only the owner invites managers) |
POST | / | Owner or manager | Sends an invitation again with a new link |
DELETE | / | Owner or manager | Withdraws an invitation |
PATCH | / | Owner or manager | Changes a member's role (managers move the front desk and staff; the business keeps at least one owner) |
DELETE | / | Owner or manager | Removes someone from the team: they become a client again and every session they have ends at once (managers remove the front desk and staff; never the last owner) |
POST | / | Signed in | Uploads a file (multipart file; typed by content, size limits per kind) |
GET | / | Signed in | A file: a person's own to them and to the admin area, the business's to anyone on the team |
| Admin website | |||
GET | / | Front desk, manager or owner | The business at a glance: the team by role, clients, new clients per month and what needs attention, with the salon's day merged in (?branchId&date: stats, the next 2 hours, pending time off, recent reviews, deposits held, the branches) |
GET | / | Front desk, manager or owner | The badges in the admin menu, by menu item: the setup check (owner), time off to decide, visits waiting at the counter, reviews not seen yet |
GET | / | Owner | Everyone who signs in (search, role, status), with counts per role |
PATCH | / | Owner | { status?, reason?, name? } suspends or restores a person, or renames them |
GET | / | Owner | The business settings (secrets masked), server facts and storage stats |
POST | / | Owner | The brand logo (PNG, SVG or WebP up to 1 MB, checked by content), served publicly as the logo and favicon |
PUT | / | Owner | Saves one settings section (secrets are sealed; an empty secret keeps .env) |
GET | / | Owner | The emails with their built-in and saved wording, for the email editor |
GET | / | Owner | The setup check rows |
POST | / | Owner | Tests one setup check row against the real service |
GET | / | Owner | Background jobs (status and kind filters) with counts per status |
POST | / | Owner | Queues a failed job again |
POST | / | Owner | Removes the demo data (demo-marked rows only) |
GET | / | Front desk, manager or owner | Every branch, inactive ones too (front desk may read), each with today's todayBookings and todayUtilisation (chair time booked, whole percent 0–100) in its own time zone |
POST | / | Owner or manager | A new branch with its hours and closed days (owner, manager) |
PATCH | / | Owner or manager | Changes a branch (hours and closed days replaced when sent) |
DELETE | / | Owner or manager | Deletes a branch with no bookings, or turns it off |
GET | / | Front desk, manager or owner | Every category (front desk may read) |
POST | / | Owner or manager | A new category (owner, manager); answers the Category |
PATCH | / | Owner or manager | Renames, describes, reorders, hides or shows a category; answers the Category |
DELETE | / | Owner or manager | Deletes an empty category |
GET | / | Front desk, manager or owner | Every service with its staff (front desk may read) |
POST | / | Owner or manager | A new service with its deposit rule, branches and staff (owner, manager) |
GET | / | Front desk, manager or owner | One service, inactive ones too |
PATCH | / | Owner or manager | Changes a service (branchIds / staffIds replace the links when sent) |
DELETE | / | Owner or manager | Deletes a service, or turns it off when bookings or packages use it |
GET | / | Front desk, manager or owner | Every staff member with role, contact, commission, skills, shifts and utilisation (chair time booked this week, whole percent 0–100) (front desk may read) |
POST | / | Owner or manager | Adds a staff member (an existing team member by userId, or by name and email: a new account is invited to set its password) with profile, skills and shifts (owner, manager) |
GET | / | Front desk, manager or owner | One staff member for the admin |
PATCH | / | Owner or manager | Changes a staff member's profile, skills (serviceIds) or shifts |
DELETE | / | Owner or manager | Takes a staff member off the books (profile inactive; bookings stay) |
PATCH | / | Owner or manager | Replaces a staff member's weekly shifts ({ shifts: [...] }) |
GET | / | Front desk, manager or owner | A day by staff columns (or a staff member's week): hours, shifts and breaks, bookings, blocks, closed days |
GET | / | Front desk, manager or owner | The bookings table (filters, tabs with their counts, pages) |
POST | / | Front desk, manager or owner | Books for a client (clientId or newClient) with a staff member at a time (lead time ignored, hours kept); payMode at_salon or deposit_link (answers a checkout link to send); walkIn, packagePurchaseId, and notify: false to book without telling the client |
GET | / | Front desk, manager or owner | One booking with its events and the client's notes |
PATCH | / | Front desk, manager or owner | { staffId?, startsAt, notify } moves a booking (window and count skipped, the slot checked like a new booking); the client is told unless notify is false |
POST | / | Front desk, manager or owner | { reason, waiveFee, notify } the salon cancels (a full refund, points and package session back; waiveFee: false applies the client's late rules instead; notify: false tells only the open screens) |
POST | / | Front desk, manager or owner | Checks the client in (from an hour before) |
POST | / | Front desk, manager or owner | Starts the visit |
POST | / | Front desk, manager or owner | { extraServiceIds? } finishes the visit (extras priced from the service); what is due shows at the checkout |
POST | / | Front desk, manager or owner | Marks a no-show (from the grace minutes after the start; the fee is kept, the rest refunded) |
POST | / | Front desk, manager or owner | { staffId, startsAt, endsAt, reason, force? } blocks a staff member's time (409 clashes with the bookings in the way unless force) |
DELETE | / | Front desk, manager or owner | Removes a block |
GET | / | Front desk, manager or owner | The counter: lines, what was paid, the client's points and packages, the extras, the discount limit (and the receipt once paid) |
POST | / | Front desk, manager or owner | { extraServiceIds, tipCents, discountCents, discountReason, usePoints, packagePurchaseId, method: cash|card_desk|card_online|package, emailReceipt } checks the visit out and answers the receipt, or for card_online a checkout link (discounts above the front desk's limit need a manager: 403 discount_limit) |
POST | / | Front desk, manager or owner | Emails the receipt to the client |
GET | / | Front desk, manager or owner | Payments and refunds with filters and pages (Page<Payment>), the figures above the table in stats |
POST | / | Front desk, manager or owner | { amountCents, reason } refunds part or all of a payment (owner, manager; the front desk only a deposit: 403 refund_limit) |
POST | / | Owner or manager | Multipart file → { photoUrl } (owner, manager) |
POST | / | Owner or manager | Multipart file → { photoUrl } (owner, manager) |
POST | / | Owner or manager | Multipart file → { photoUrl } (owner, manager) |
POST | / | Owner or manager | Multipart file → { photoUrl } (owner, manager) |
GET | / | Front desk, manager or owner | Every package with its holders, and the figures (stats) above the table (front desk may read) |
POST | / | Owner or manager | A new package (owner, manager) |
PATCH | / | Owner or manager | Changes a package (bought ones keep their sessions and price) |
DELETE | / | Owner or manager | Deletes a package nobody bought, or takes it off sale |
GET | / | Front desk, manager or owner | The reviews (marked seen once listed) with the figures in stats and the tab counts |
POST | / | Owner or manager | { reply } answers a review in public (an empty reply removes it) |
POST | / | Owner or manager | Hides a review (it leaves the staff member's rating) |
POST | / | Owner or manager | Shows a hidden review again |
GET | / | Front desk, manager or owner | The clients with visits, spend, no-shows, points and the counts per segment (tab works as well) |
POST | / | Front desk, manager or owner | { name, email?, phone?, notes? } adds a client (201 ClientRow; 409 duplicate for an email in use) |
GET | / | Front desk, manager or owner | A client: visits, spend, no-shows, points, packages, payments, notes |
PATCH | / | Front desk, manager or owner | { notes, requireCard } (the salon's private notes, and whether the client must pay by card when booking) |
POST | / | Owner or manager | { delta, reason } adds or takes away points (owner, manager; never below zero) |
GET | / | Owner or manager | Everything stored about a client, as a JSON download (owner, manager) |
GET | / | Front desk, manager or owner | Time-off requests (and blocks with kind=block), pending first, each with the clients it would affect; the tab counts in counts; the staff's requests to change their hours in hoursRequests (open first) |
POST | / | Owner or manager | { staffId, startsAt, endsAt, reason, force? } a manager adds time off for a staff member, approved at once (409 clashes with the bookings in the way unless force) |
POST | / | Owner or manager | { force? } approves a request (409 clashes listing the bookings in the way unless force; those bookings stay and need moving) |
POST | / | Owner or manager | Declines a request (or cancels approved time off) |
POST | / | Owner or manager | Marks a staff member's request to change their hours done (owner, manager); the staff member is told |
GET | / | Owner or manager | Cancel and reschedule windows, deposits, no-shows, lead time, slots |
PUT | / | Owner or manager | Saves the booking policies (only the fields sent change) |
GET | / | Owner or manager | Points earned per dollar, what they are worth, when they expire |
PUT | / | Owner or manager | Saves the loyalty rules (new rules apply to new points) |
GET | / | Owner or manager | The day-before and same-day reminders and the review ask |
PUT | / | Owner or manager | Saves the reminders (dayBefore, sameDay, reviewAsk) |
GET | / | Owner or manager | The reminders sent, newest first (Page<ReminderLogRow>) |
GET | / | Owner or manager | The loyalty rules, the figures, and the first page of the points ledger of every client (Page<PointsEntry> with names and balances) |
GET | / | Owner or manager | The points ledger of every client (owner, manager) |
GET | / | Owner or manager | Revenue by day, by staff and by service, no-show rate, commissions, deposits kept and refunds (ReportData; demo payments never count) |
GET | / | Owner or manager | The no-show and late-cancel fees kept or waived (Page<FeeRow> with counts {all, no_show, late_cancel, waived}); waiving one is a refund of its paymentId |
Database
PostgreSQL. The schema is in migrations/ and is applied by the server on start. Ids are UUIDs, times are UTC and money is in whole cents. A deleted account is purged after 30 days. These 35 tables are generated from the migrations when the release is built.
| Table | What it holds | Keys | Points to |
|---|---|---|---|
| Accounts and sign-in | |||
users | Every person: the owner, managers, the front desk, staff (stylists and therapists) and clients, with their role | primary key id; unique email (any case), when deleted_at is null | branches |
sessions | Signed-in browsers and apps (only a hash of the cookie or Bearer token is stored) | primary key id; unique token_hash | users |
push_tokens | The push token of the device each app session runs on, removed with the session | primary key id; unique session_id; unique token | sessions, users |
password_resets | Password reset links (hashed, valid for one hour, used once) | primary key id; unique token_hash | users |
invites | Open team invitations, with the role to join as (manager, front desk or staff) | primary key id; unique token_hash; unique email (any case), when accepted_at is null | users |
rate_limits | Fixed-window counters for sign-in, sign-up and password reset limits (keyed by a hash) | primary key key | – |
notifications | A person's in-app notifications (the apps' inbox); push messages are copies of these | primary key id | users |
| Branches and the menu | |||
branches | The salon's locations: address, phone, time zone, photo, whether clients can book it online | primary key id; unique slug | – |
branch_hours | Opening hours per weekday (1 = Monday … 7 = Sunday); a missing weekday is closed | primary key branch_id + weekday | branches |
branch_closures | Whole days a branch is closed (holidays), as local dates | primary key id; unique branch_id + day | branches |
categories | Service groups on the menu (Hair, Barber, Nails…) with an icon, description, photo and whether they show | primary key id; unique slug | – |
services | The service menu | primary key id; unique slug | categories |
service_branches | Which branches offer a service | primary key service_id + branch_id | services, branches |
packages | Packages of sessions of one service sold to clients (price, sessions, how long they last, photo) | primary key id | services |
| Staff and schedules | |||
staff_profiles | A stylist or therapist: a team member (users) who takes bookings | primary key user_id | users |
staff_services | Skills: the services a staff member does | primary key staff_id + service_id | staff_profiles, services |
staff_shifts | The weekly shift of a staff member per weekday (one branch that day), with an optional break; wall-clock times in the branch's time zone | primary key id; unique staff_id + weekday | staff_profiles, branches |
time_off | Time a staff member is away: requested time off (pending until a manager decides) or a block the salon put in the calendar (kind = block, approved at once) | primary key id | staff_profiles, users |
hours_requests | "Request a change to my hours" from the staff app; the branch manager is told and marks it done | primary key id | staff_profiles, users |
| Bookings and money | |||
bookings | A visit | primary key id; unique manage_token_hash; unique number, when not shadow | branches, staff_profiles, users, package_purchases |
booking_items | The services of a booking, priced when it was made (extras added at the end of the visit have extra) | primary key id | bookings, services |
booking_events | What happened to a booking, in order (made, paid, moved, checked in, …) | primary key id | bookings, users |
payments | Money in: card payments online (Stripe Checkout), at the desk (card or cash), and demo payments (the test card page, never counted in reports) | primary key id; unique stripe_session_id | bookings, package_purchases, users |
refunds | Refunds: claimed first (the payment's refunded_cents grows in the same transaction), then sent to Stripe with the refund's id as the Idempotency-Key; a refusal undoes the claim (failed) | primary key id | payments, bookings, users |
package_purchases | A client's package: pending until paid, then active with sessions to use until expires_at | primary key id | packages, users |
package_redemptions | A package session used on a booking (one per booking); returned when a free cancellation gives it back | primary key id; unique booking_id | package_purchases, bookings, services |
idempotency_keys | The answer to a request sent with an Idempotency-Key (24 hours): the same key gets the same answer and never a second booking or purchase | primary key scope + key | – |
| Loyalty, reviews and reminders | |||
points_ledger | Every change to a client's points | primary key id; unique idem_key | users, bookings |
reviews | One review per completed booking, by its client | primary key id; unique booking_id | bookings, users, staff_profiles |
reminders_sent | Each reminder (24 h and 2 h before) and review request sent, once per booking and kind | primary key booking_id + kind | bookings |
| Files, payments and settings | |||
media | Every uploaded file: the business's (the team's uploads) or a person's own (a profile photo) | primary key id; unique storage_key | users |
stripe_events | Every Stripe event already applied, so a repeated delivery changes nothing | primary key id | – |
settings | The business settings saved in the admin website, which take precedence over .env (secrets stored encrypted) | primary key key | users |
| Background work and records | |||
jobs | The durable background job queue: the nightly housekeeping and purge, refunds to send again, and the demo reset | primary key id; unique dedupe_key, when dedupe_key is not null and status in ('queued', 'running') | – |
audit_log | Actions taken by the owner, managers and the front desk | primary key id | users |
Help
Updating and backups
Back up
docker compose exec -T postgres sh -c 'pg_dump -U "$POSTGRES_USER" "$POSTGRES_DB"' > backup-$(date +%F).sql
Run it in the Chairwise folder. It reads the database user and name from the postgres container, so it works whatever you set as POSTGRES_USER and POSTGRES_DB; -T keeps a terminal out of the dump.
Also keep a copy of .env (above all APP_SECRET, without which the saved keys cannot be read), of your files (the minio-data Docker volume, your own bucket or the app-storage volume), and of the apps' signing keys and .env files. Restore a database backup into an empty database with docker compose exec -T postgres sh -c 'psql -U "$POSTGRES_USER" "$POSTGRES_DB"' < backup.sql.
Update the server
Docker names the stack, and with it the database volume, after the folder unless COMPOSE_PROJECT_NAME is set. If you move or rename the folder, set COMPOSE_PROJECT_NAME to the old folder name first, or the app starts with an empty database. Your data isn't lost; it's under the old name, which docker volume ls shows before _postgres-data.
- Back up as above.
- From the folder that holds
chairwise/(not inside it), rununzip -o chairwise-x.y.z.zipwith the new version's file name. The zip has a top-levelchairwise/folder, so it unpacks over your install and replaces every shipped file, also ones you changed in the web app or the mobile apps: keep your changes in Git (chapter 35) so you can see and re-apply them. Your.env,compose.override.yaml,prebuilt/and the apps'.envfiles andkey.propertiesare kept, because the zip doesn't contain them. - Compare your
.envwith the new.env.example; new keys are listed there and inCHANGELOG.md. This lists the keys of.env.examplethat your.envdoesn't have yet:cd chairwise for k in $(grep -oE '^#? ?[A-Z][A-Z0-9_]*=' .env.example | tr -d '# ='); do grep -q "^$k=" .env || echo "$k"; done - Run
docker compose up -d --build(with--profile httpson your server). The new version applies any new migrations when it starts; your data stays. - If disk is tight, run
docker builder pruneafterwards to free the build cache.
Update the apps
Copy your changes (names, ids, icons, theme) onto the new chairwise_mobile_flutter/, or compare with Git, then raise the build number in pubspec.yaml, build and upload as in chapter 18. Update the server first: new apps may need the new server, while the old apps keep working with it.
Troubleshooting
The app says it cannot reach the server
- Open
API_BASE_URL/api/healthin the phone's browser: it must answer. On the Android emulator a server on your computer ishttp://10.0.2.2:8080, notlocalhost. API_BASE_URLis the server's root without/api/v1. The value is built into the app: after changing.env, run or build the app again.- A real phone needs an https address with a valid certificate.
"This account is for the … app"
Each account signs in only to its own app: clients to the client app, the team (staff, front desk, managers and the owner) to the staff app. Use the app it names, or change the person's role in Team.
No push notifications
- Setup check → Push messages must be green (the service account is saved).
- The app was built with that app's own
FIREBASE_*keys, all of them filled in (chapter 13). With any of them missing, the app quietly leaves push off. - The phone is a real device, notifications are allowed for the app (and, in the client app, in its own Settings), and the person is signed in.
- For iOS, the APNs key is uploaded in Firebase (chapter 13).
No free times are offered
Work down this list for the branch, service and day in question. The setup check's rows "Branches with opening hours", "Staff with shifts" and "Services with staff" catch the most common gaps.
- The branch is open that day. Admin → Branches: the weekday has opening hours, and the date isn't a closed day (or closes early before the visit could end).
- Online booking is on for the branch. When it is off, clients are told "This branch takes bookings by phone or at the desk".
- The service is on, its category is on, and the service is offered at this branch (Admin → Services).
- Someone can do it: at least one staff member who is switched on has the service in their skills and weekly hours at this branch on that weekday (Admin → Staff). For a visit of several services, one person must do all of them.
- The visit fits. All its services back to back must fit inside one stretch of that person's hours, between breaks and inside the opening hours. A 90-minute visit doesn't fit a 60-minute gap.
- It isn't too soon or too far. Online, the lead time (2 hours by default) hides times that are too close, and the days-ahead limit (60 days) hides times too far away (Admin → Policies).
- The time isn't taken: time off, a block or other bookings (with their clean-up time) may fill the day. The calendar shows them.
The admin website's New booking shows the same engine without the lead time and the days-ahead limit, which helps to tell a rule from a real gap.
A staff member is missing from a service
- Admin → Staff → the person: the service must be ticked in what they can do (or the person ticked in Admin → Services → the service → who can do it).
- They need weekly hours at the branch the client chose, on that weekday.
- They must be switched on, and their account must not be suspended (Team and roles).
- The service must be offered at that branch.
- When the client picked several services, the person must do every one of them.
Reminders are not sent
- Admin → Reminders: the reminder is on, with push and/or email ticked. The log on the same page shows every send and its channels.
- Only confirmed bookings get reminders: not a booking still waiting for its card payment, and not one already checked in.
- A booking made after a reminder was due doesn't get that one: a visit booked 3 hours ahead gets only the 2-hour reminder. The client may also have switched off "Remind me 2 hours before" for that booking.
- Email needs SMTP (setup check → Email); without it, the email is written to the app's log. Push needs Firebase on the server and in the app (chapter 13), and the client must allow notifications. Guests get email only.
- The server sends reminders itself, so it must be running. Setup check → Background jobs shows failures.
Card payments stay "pending payment"
The booking waits for Stripe's webhook. When it doesn't arrive:
- Setup check → Stripe must show the webhook signing secret.
- In Stripe → Developers → Webhooks, the endpoint is
APP_URL/api/v1/webhooks/stripewith the four events of chapter 10. Stripe shows every delivery and the server's answer there. - The signing secret is the one of this endpoint, in the same mode (test or live) as the keys. A secret from another endpoint is refused.
- The server's clock is right: a signature more than 5 minutes off is refused.
- Your proxy passes the request body unchanged to the app.
After a fix, press Resend on the failed delivery in Stripe (If a webhook was missed). If the hold ran out in the meantime, the booking was cancelled; the resent payment brings it back if the time is still free, or is refunded at once.
Times are an hour off, or on the wrong day
- Check the branch's time zone in Admin → Branches. Every time of a branch is shown in its own time zone, whatever the phone, the computer or the server is set to.
- Opening hours and staff hours are clock times in the branch's time zone; daylight saving is handled by the server.
- Changing a branch's time zone keeps the real moment of visits already booked, so their shown time moves. Fix the time zone before taking bookings, or move those visits.
- The business's time zone (Settings → General) is used for reports and the demo reset, not for bookings.
A photo upload is refused
- Photos must really be JPEG, PNG or WebP: the server checks the file's content, not its name. Convert iPhone HEIC photos to JPEG first.
- A photo can be 5 MB at most.
- The room for files may be full (409 "storage full"): see Settings → Storage.
- Only managers and the owner change photos of services, staff, branches, packages and categories; on the public demo they are locked.
- Behind your own Nginx, allow large enough uploads (
client_max_body_size 21m;, chapter 7). - Setup check → File storage → Run again tests the bucket.
The install wizard asks for a token I don't have
The app prints it in its log at every start until the install is finished, and each restart makes a new one, so use the last line of docker compose logs app | grep -i "install token". Or set INSTALL_TOKEN in .env and run docker compose up -d.
After an upgrade everything is empty
The folder was moved or renamed, so Docker started a new, empty stack (chapter 40). Stop it with docker compose down, set COMPOSE_PROJECT_NAME in .env to the name before _postgres-data in docker volume ls, and run docker compose up -d again.
The app does not start
docker compose logs app names the problem, for example "APP_SECRET must be at least 32 characters" or "DATABASE_URL is not set". docker compose ps shows whether PostgreSQL and MinIO are healthy.
The build stops with "killed" or "signal: 9"
The server ran out of memory while compiling. Add swap or build on another computer (chapter 7).
A Flutter build fails
Always pass --flavor and --dart-define-from-file. After changing packages or ids, run flutter clean and flutter pub get; on iOS also cd ios && pod install --repo-update. flutter doctor shows missing tools.
Emails don't arrive
Without SMTP, emails are written to docker compose logs app. With SMTP, send a test email from Settings → Email and check that the sender's domain is verified with your provider.
The calendar does not update by itself
A proxy is buffering the live updates. With the bundled Caddy it works as is; with Nginx add proxy_buffering off;.
Too many sign-in attempts from everyone at once
TRUSTED_PROXY_HOPS is 0 behind a proxy, so every visitor shares one address. Set it to the number of proxies in front of the app (chapter 7).
FAQ
Do I publish two apps?
Yes: the client app and the staff app are two listings on Google Play and two on the App Store, under your own developer accounts. They are built from one codebase.
Where does the money go?
Card payments (deposits, payments in full, packages, card links from the desk) land in your own Stripe account, and Stripe pays them out to your bank on its own schedule. Cash and card-terminal payments at the desk never pass through Chairwise: the desk records them so the books add up. Tips are recorded for the stylist and commission is worked out per person for your payroll; paying your team happens outside Chairwise (chapter 25).
Does it work without Stripe?
Yes: Stripe is optional, and the setup check shows it as not set up until you add its keys (chapter 10). Without it, clients book and pay at the salon, services with a deposit can only be booked at the desk (unless you turn off "Services with a deposit need a card" in Policies), and packages can't be bought online. With it, Stripe charges its own fees per payment (its own pricing; you pay them, not us).
Is it a marketplace for many salons?
No. Chairwise runs one business (your brand) with as many branches as you like, each with its own address, hours, time zone and team. Money goes to your own Stripe account, never through a middleman.
Can clients book without an account?
Yes, as guests on the website or in the app, with a name, email and phone. The confirmation email carries a link to view, move or cancel the booking. Signing up later with the same email keeps their bookings.
Can a client book several services at once?
Yes, up to six, done back to back by one stylist who does all of them, with the clean-up time of the last one kept free.
Can I charge a no-show to the client's card afterwards?
No. A no-show or late-cancel fee is kept from money already paid online, usually the deposit. Ask for deposits on the services where no-shows hurt, and require a card after a set number of no-shows (Admin → Policies).
Does it send SMS messages?
No. Reminders and updates go by push notification, email and the in-app inbox.
Can I use another currency or country?
Set the currency and time zone in Settings → General; Stripe takes payments in it where your Stripe account allows. The apps and the web app are in English.
Do I need to know Rust or Flutter?
Not to install it, set it up or run it: Docker builds the server. Building the apps needs Flutter installed, and the commands in Part 03. Changing the screens needs Dart (apps) or React (web); changing the rules needs Rust.
Can I host it without Docker, or on shared hosting?
Without Docker yes: run the one chairwise program behind your own HTTPS proxy with PostgreSQL 15 or newer (chapter 7). Shared PHP hosting cannot run it.
Which licence do I need?
To take bookings and payments from clients, the Envato Extended Licence. See chapter 45.
Credits and licences
Chairwise is built with these open-source projects, each under its own licence:
- Server: Rust, Axum, Tokio, SQLx, reqwest, rustls, Lettre, RustCrypto (Argon2, AES-GCM, HMAC, HKDF, SHA-2), chrono-tz and mimalloc, under permissive licences (MIT, Apache 2.0, ISC or BSD).
- Web app: React, React Router, Vite, Tailwind CSS, shadcn/ui, Base UI, Radix UI, TanStack Query and Table, Sonner and React DayPicker (MIT).
- Flutter apps: Flutter (BSD 3-Clause) and these packages from pub.dev: firebase_core and firebase_messaging, go_router, flutter_secure_storage, flutter_local_notifications, image_picker, url_launcher, share_plus, shared_preferences, connectivity_plus, hive_ce_flutter, http, intl and shimmer (BSD 3-Clause); timezone (BSD 2-Clause); flutter_riverpod, lucide_icons_flutter, geolocator and add_2_calendar (MIT); flutter_styled_toast (Apache 2.0). flutter_launcher_icons (MIT) makes the app icons and is used only while building.
- Icons: Lucide (ISC licence), in the web app and the apps (lucide_icons_flutter, MIT).
- Fonts: Albert Sans and Bodoni Moda in the apps (their licence is in
assets/fonts/OFL.txt), Geist and JetBrains Mono in the web app, which also uses Albert Sans and Bodoni Moda (all bundled through Fontsource), all under the SIL Open Font License 1.1. - Docker images: PostgreSQL (PostgreSQL Licence), MinIO (GNU AGPL 3.0, run unmodified as a separate service), Caddy (Apache 2.0), and the official Rust, Node.js and Debian images used to build and run the app.
Every server and web dependency
The Rust crates (from Cargo.lock) and the web app's npm packages, counted by licence when the release is built. docs/third-party-licenses.txt lists every package by name, version and licence; the Flutter packages and their versions are in chairwise_mobile_flutter/pubspec.lock.
| Licence | Rust crates | npm packages |
|---|---|---|
| MIT | 53 | 270 |
| Apache-2.0 OR MIT | 213 | 2 |
| Unicode-3.0 | 18 | – |
| ISC | 2 | 10 |
| Apache-2.0 | 1 | 10 |
| MIT OR Unlicense | 5 | – |
| OFL-1.1 | – | 4 |
| (MIT OR Apache-2.0) AND Unicode-3.0 | 3 | – |
| Apache-2.0 OR MIT OR Zlib | 3 | – |
| Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT | 3 | – |
| BSD-3-Clause | 1 | 2 |
| 0BSD | 1 | 1 |
| Apache-2.0 OR BSD-2-Clause OR MIT | 2 | – |
| Apache-2.0 OR BSL-1.0 OR MIT | 2 | – |
| Apache-2.0 OR ISC OR MIT | 2 | – |
| Apache-2.0 OR LGPL-2.1-or-later OR MIT | 2 | – |
| BSD-2-Clause | – | 2 |
| CDLA-Permissive-2.0 | 2 | – |
| MPL-2.0 | – | 2 |
| Zlib | 2 | – |
| (Apache-2.0 OR MIT) AND BSD-3-Clause | 1 | – |
| 0BSD OR Apache-2.0 OR MIT | 1 | – |
| Apache-2.0 AND ISC | 1 | – |
| Apache-2.0 OR BSL-1.0 | 1 | – |
| BlueOak-1.0.0 | – | 1 |
| CC-BY-4.0 | – | 1 |
| LicenseRef-Envato-Regular-or-Extended | 1 | – |
| MIT AND BSD-3-Clause | 1 | – |
| MIT-0 | – | 1 |
| Unlicense | – | 1 |
| Total | 321 | 307 |
Every licence above allows use in a commercial product. cargo deny check licenses checks the Rust crates against the allowed list.
Images
The kit ships no photos: the public pages draw a brand panel instead. Your own photos go in apps/frontend/public/images/site/ (hero.webp, team.webp), with their credits in credits.json next to them; rebuild after adding them. The logo is an original SVG. Staff, service, branch, package and category photos are uploaded in the admin website and kept in your file storage.
Every image in this guide is a screenshot of the running apps with the sample business. The photos in those screenshots and on the live demo are from Pixabay under the Pixabay Content License; they are used for the demo only and are not in the download. The sample people are made up; the photos show stock models. Photographers: staff: Maya Okafor by Starkvisuals; staff: Theo Marsh by WikimediaImages; staff: Jonah Reyes by jakealdridge; staff: Priya Shah by F1Digitals; staff: Lena Brooks by 818376; staff: Sofia Marin by erwinbosman; staff: Ava Chen by cuncon; staff: Noor Haddad by This_is_Engineering; staff: Elena Vasquez by Mark_Mook_Fotografie; staff: Marcus Hale by Claudio_Scott; staff: Hana Kim by Canis24; staff: Iris Bennett by Pexels; branch: Old Town by Sunriseforever; branch: Riverside by Michelle-Maria; branch: Harbor Spa by kitirina; web hero stylist by xenostral; service: womens cut by kaleido-dp; service: blow dry by Engin_Akyurt; service: colour by Engin_Akyurt; service: skin fade by louiscarter196; service: cut and beard by louiscarter196; service: hot towel shave by jackmac34; service: gel manicure by Huskyherz; service: nail art by Mounthive; service: lash lift by agustino; service: brow shape by beauty43; service: swedish massage by rhythmuswege; service: hot stone by whitesession; service: facial by office469; service: express facial by Tumisu; service: deep tissue by MobileMassagenMD..
Changelog
1.0.0 (unreleased)
First release. Placeholder: the full list of features is written when the salon modules are done.
- Two Flutter apps from one codebase: the client app and the staff app, as two flavours with their own name, app id, icon and deep links; light and dark themes.
- Admin website for the owner, branch managers and the front desk, with the team, settings and a setup check that tests every outside service.
- Install and hosting: an install wizard, one Docker Compose stack (PostgreSQL, MinIO, the app, optional Caddy HTTPS), any S3-compatible storage or a local folder, and a public demo mode with one-click sign-ins and a nightly reset.
- Security: Argon2id passwords, secure web sessions and app tokens, secrets encrypted at rest, rate limits kept in the database, uploads checked by their content, and role checks on every call.
Support and licence
Questions, bug reports and help with installation: use the Support tab on the item's page on the marketplace. Please include your Chairwise version, how you host it, which app and phone it is about, and what you see (a screenshot, or the lines from docker compose logs app). Never send your .env, keys, tokens, the Firebase service account or passwords.
Support covers questions about the item's features, help with bugs and help with installing it as described here. It does not cover custom changes to the code, publishing the apps in your developer accounts, or the setup and review of your accounts at Stripe, Google, Apple and other outside services, which are handled by those companies.
The Regular Licence lets you use Chairwise for one product whose end users are not charged. To take bookings and payments from clients, you need the Envato Extended Licence. One licence covers one business (one brand on one installation, with its two apps). The licences page at codecanyon.net/licenses/standard explains both licences in full.
Chairwise is not affiliated with, endorsed by or sponsored by Stripe, Google, Apple or Firebase. Their names are trademarks of their owners.