Install it, connect your services, run clinics on it
Caremint is clinic and doctor practice software that you run as your own software business. Clinics sign up and get a calendar with a column per doctor, patient records, visit notes with ICD-10 diagnoses, prescriptions as PDFs, invoices and payments, an online booking page, WhatsApp reminders through Meta's official WhatsApp Cloud API, video visits and a patient portal. You sell plans to them through your own Stripe account and run everything from the super-admin. You can also run it for one clinic of your own.
This guide is written for first-time installers: every command is shown in full, and every setting says where to find it. The chapter about Meta takes you through Meta's own screens click by click, because that is where most people get stuck.
Get started
1Welcome
Thank you for choosing Caremint. This guide takes you from the download to a running clinic platform with your first clinic booking patients.
What you get
- The clinic for your customers and their teams: an overview of the day; a calendar by day and week with a column per doctor, drag to move, walk-ins and a waiting list; patients with allergies, conditions, documents, consent records and CSV import; visits with vitals, notes in four parts, ICD-10 diagnosis search and signing; prescriptions as PDFs on the clinic's letterhead with the doctor's signature; invoices, desk payments, pay links and refunds; reports; reminders by WhatsApp and email; online booking; staff with roles and working hours; services and rooms; and settings with an audit log.
- Pages for patients: the clinic's booking page (and a button for its website), a link to confirm, move or cancel, a page to pay a deposit or a bill, the patient portal, a public prescription check and a video waiting room.
- The super-admin for you: monthly recurring revenue, clinics, people, plans, payments and subscriptions, platform settings (branding, Meta app, Stripe, email, AI providers, storage, sign-ups, legal pages, maintenance, email wording) and a setup check that tests every outside service live.
- WhatsApp reminders on each clinic's own number through Meta's official WhatsApp Cloud API: the day before and 2 hours before, with Confirm, Reschedule and I can't come buttons that update the calendar. Caremint never uses WhatsApp Web, QR-code logins or "warm-up" tools, which break WhatsApp's terms and get numbers banned. Without a connected number, reminders go by email.
- Payments to each clinic's own Stripe account for patients' deposits and bills, and to your Stripe account for the clinics' plans.
- An install wizard and sample plans, so the app is ready the first time it opens.
- One-command self-hosting with Docker: the app (one compiled Rust program that also serves the web app), PostgreSQL, MinIO file storage and optional automatic HTTPS with Caddy.
What is in the download
| Path | What it is |
|---|---|
apps/backend/ | The server, written in Rust (Axum): the /api/v1 API, the WhatsApp and Stripe webhooks, the background jobs (reminders among them) and the built web app, compiled into one program called caremint. |
apps/frontend/ | The web app: React 19, React Router 7, Vite, Tailwind CSS 4 and shadcn/ui components. Every screen your clinics, their patients and you see. |
crates/wa/ | The WhatsApp Cloud API library: sending, webhooks and signature checks, templates, number details, Embedded Signup, throttling and the built-in simulator used by the demo and the tests. |
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 setting, explained. Copy it to .env. |
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 overview, 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, WhatsApp library tests against Meta's own webhook examples, and browser tests) and integrated by us.
- Documentation: Yes. Drafted with Claude by Anthropic and checked against the running app and the providers' own setup screens.
- Graphics: No. No image was made with an AI image generator. The Caremint logo is a leaf icon from the Lucide icon set on a coloured square, the demo clinic's logo is a simple drawing made for the demo, the doctors' demo signatures are set in an open-licence handwriting font, and every screenshot in this guide and the item's previews is a capture of the running app.
- Demo text: Yes. The made-up clinics, staff, patients, visit notes, prescriptions and messages of the demo were written with Claude by Anthropic and edited by us. Every name, phone number and email in the demo is invented.
AI-powered features: Yes
- Writing help for visit notes: the doctor types bullet points, and the AI turns them into the four parts of a visit note (subjective, objective, assessment, plan) for the doctor to check. Nothing is saved until the doctor chooses Use these notes.
- Provider: OpenAI, Anthropic (Claude) or Google Gemini, chosen in the super-admin, with your own API key. The provider bills you directly for every draft; the chapter Extra costs you pay gives today's prices.
- No AI diagnosis. The helper only rewrites what the doctor wrote. It is told never to add a finding, a diagnosis or a medicine, and it gives no medical advice. AI text can still be wrong, so the doctor reads every line before using it.
- Without a key the helper is off and hidden, and nothing is sent to an AI provider. On the public demo a simple rule-based writer (not an AI model, no cost) stands in and says so.
Caremint is practice management software: it keeps a clinic's calendar, records and bills. It does not diagnose, give medical advice or replace a doctor's judgement. It is built with privacy controls (chapter 32), but whether a clinic meets HIPAA, GDPR or its local health-data law depends on where and how you run it, the agreements you sign and the clinic's own practices. Caremint makes no compliance claim.
Screenshots
The main screens of the clinic, the patients' pages, the super-admin and the phone layout. Every chapter in parts 03 to 05 has more.
2Requirements
To run it (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 on macOS or Windows works for trying it on your own computer. - For the first build (Docker compiles the Rust server from source): 2 processor cores and 4 GB of memory (or 2 GB plus swap). Plan for a few minutes on such a server; a 16-core server built this release in about a minute and a half. More cores build faster but use more memory at once. Leave about 6 GB of free disk for Docker's build cache;
docker builder prunegives that space back once the app runs. - To run it the server needs far less: the app image is about 110 MB and the app uses only a few MB of memory when idle. PostgreSQL and MinIO run beside it, so plan at least 1 GB of memory for a small install. 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. Meta sends WhatsApp events only to a public
https://address with a valid certificate, and patients open their links on their phones; the bundled Caddy gets a free certificate for you. - A current version of Chrome, Edge, Firefox or Safari for you, the clinics and their patients.
To build or change it 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 (yours) | Selling plans to clinics. Each clinic that takes patient payments online connects its own Stripe account in the app. | To charge clinics |
| An SMTP email provider | Reminders by email, booking confirmations, portal sign-in codes, password resets, invites and notices. Without it, each email is written to the app's log. | For a public launch |
| Meta developer account and a business portfolio (Meta Business Suite) | Your Meta app, the WhatsApp webhook, and Embedded Signup for clinics. Each clinic needs its own WhatsApp Business Account (Meta creates it during sign-up). | For WhatsApp reminders |
| OpenAI, Anthropic or Google AI | The writing helper for visit notes. Without a key it is off. | Optional |
| S3-compatible storage | Patient documents, imports, logos and signatures. The bundled MinIO does this on the same server. | Optional |
| A Jitsi Meet server | Video visits. The free public server meet.jit.si is used when you set nothing. | Optional |
3Extra costs you pay
Caremint has no monthly fee of its own. What you and your clinics pay each month depends on the outside services you turn on. Each of them is run by another company with its own pricing, and you, the buyer, are responsible for every one of these costs (or for passing them on to your clinics). The prices below are the providers' published list prices in November 2026; they change, so check each provider's own pricing page before you set the prices of your plans.
WhatsApp reminders (Meta)
Meta charges for WhatsApp Business Platform messages per delivered template message, by the template's category and the country code of the patient who receives it. Messages patients send in are free.
| Message | Example price (USA and Canada) | When it applies |
|---|---|---|
| Utility template | about $0.0034 | Every reminder, booking confirmation, "starts soon" message, missed-visit note, documents message, pay link and waitlist offer. Since 1 October 2026, utility templates are charged even inside the 24-hour customer service window. |
| Authentication template | about $0.0034 | The patient portal's sign-in code, when the clinic has an approved login_code template. Some countries have a higher "authentication-international" rate. Without it the code goes by email. |
| Service message | 1,000 free a month per number, then about $0.0034 | A free-form reply to a patient inside the 24-hour window, for example from the patient's record. |
Prices differ by country, from a fraction of a cent to a few cents per utility message. An example: a clinic with 400 visits a month sends about four utility templates per visit (the booking confirmation, the reminder the day before, the 2-hour message and the visit's documents), so about 1,600 messages, or roughly $5.40 a month at the US rate.
Meta bills the owner of the WhatsApp Business Account that sent each message (Meta now calls it the "Messaging account"), using the payment method saved on that account in Meta Business Suite. Each clinic connects its own number, so Meta bills the clinic directly, and Caremint never collects or passes on Meta's fees. Without a payment method on file, Meta stops delivering paid messages, and Caremint sends the reminder by email where the rule allows it.
Meta publishes the current prices for every country and the dates of upcoming changes on its WhatsApp pricing page, where the full rate card can be downloaded. Meta changes its rates several times a year.
Everything else
| Service | Price | What that means for you |
|---|---|---|
| Writing help off (no AI provider) | Free | Doctors type their notes themselves; nothing is sent to an AI provider. |
OpenAI, default model gpt-5-mini | $0.25 / $2.00 | Per million input / output tokens. About 0.1 to 0.2¢ per note draft. |
Anthropic, default model Claude Sonnet 5.5 (claude-sonnet-5-5) | $2 / $10 | Per million input / output tokens. About 0.5 to 1¢ per note draft. Claude Haiku 5.5 ($0.10 / $0.50) costs much less; Claude Opus 5.5 ($4 / $20) costs more. |
Google Gemini, default model gemini-2.5-flash | $0.30 / $2.50 | Per million input / output tokens. About 0.1 to 0.2¢ per note draft. |
| Stripe for your plans | 2.9% + 30¢ | Per successful US card payment, plus 0.7% of subscription volume for Stripe Billing. On a $79 plan that is about $3.15 a month. Other countries and cards have their own rates. |
| Stripe for patient payments | 2.9% + 30¢ | Per successful US card payment, paid by each clinic on its own Stripe account (deposits and bills). |
| Email (for example Amazon SES) | $0.10 per 1,000 | Per email sent. Other SMTP providers sell monthly plans with a free tier. |
| Video visits (Jitsi Meet) | Free, or your plan with a provider | The public meet.jit.si server costs nothing. Your own Jitsi server costs only its hosting. Hosted services such as 8x8 JaaS have a small free tier and then charge per monthly active user. |
| File storage | $0 to $0.015 per GB | The bundled MinIO or the server's own disk costs nothing extra. Cloudflare R2, for example, charges $0.015 per GB a month with the first 10 GB free and no fee for downloads. |
| Server (VPS) | about $10 to $40 a month | One server with 2 cores and 4 GB of memory runs the whole Docker stack for many clinics. |
| Domain name | about $10 to $20 a year | The address of your platform, for example clinic.example.com. |
A draft sends the helper's instructions and the doctor's bullet points (together about 500 to 1,000 tokens) and gets back the four note parts (about 300 to 600 tokens). Long bullet lists and models that reason before answering use more. Check your provider's usage page after the first real drafts.
Every plan has a number of AI note drafts a month (Super-admin → Plans). A draft counts only when a real AI provider wrote it. A clinic that has used its drafts keeps writing notes by hand until the next month or an upgrade, so the AI bill can never run past what your plans allow.
4Quick start with Docker
This runs Caremint 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
caremint/folder (the one withcompose.yamlin it). - Create your settings file:
cp .env.example .env - Open
.envin any text editor and fill in these 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 WhatsApp tokens, Stripe keys and other secrets you save. 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:
The first build takes a few minutes, mostly for compiling the Rust server. Later builds reuse Docker's cache. Docker then starts PostgreSQL and MinIO (file storage), creates the storage bucket and starts the app, which applies the database migrations by itself.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: cm-install-… (open /install and paste it). - Open http://localhost:8080. The install wizard opens: paste the token, check the server, create your super-admin account and name your product.
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 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.
Docker keeps a few GB of build cache so that later builds are fast. If disk is tight, run docker builder prune once the app is running: it frees that space without touching your data, and the next build simply starts from scratch again.
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.
5Put it online
For real patients, Caremint must be reachable at a public https:// address: patients open booking, payment and portal links on their phones, and Meta delivers every WhatsApp event to a webhook on your server.
1. Pick a server
| Size | Good for |
|---|---|
| 2 cores, 4 GB memory, 40 GB disk | Building on the server and running a growing platform (dozens of clinics). |
| 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 | Hundreds of clinics, or many server copies. Sending speed on WhatsApp is set by Meta's limits for each number, not by the server. |
Any provider that sells Linux servers with Docker works. Disk use grows mainly with patient documents, so move files to outside storage once it grows (see File storage). Choose the server's country with care: it is where patient records live (chapter 32).
2. DNS
At your domain registrar, add an A record for the address you want (for example clinic for clinic.example.com) pointing at your server's IP address. Wait until ping clinic.example.com shows that IP.
3. Settings
In .env:
APP_URL=https://clinic.example.com
APP_DOMAIN=clinic.example.com
TRUSTED_PROXY_HOPS=1
4. Start with HTTPS
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://clinic.example.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 waiting room 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 Caremint, 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: Caremint 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.caremint.rule=Host(`clinic.example.com`)
- traefik.http.routers.caremint.entrypoints=websecure
- traefik.http.routers.caremint.tls.certresolver=letsencrypt
- traefik.http.services.caremint.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: Caremint on the network of an Nginx container
services:
app:
networks:
default:
proxy:
aliases: [caremint]
networks:
proxy:
external: true
name: proxy # your proxy's network, as docker network ls shows it
Then send the traffic to http://caremint:8080 (http://app:8080 also works while no other container on that network is called app). In Nginx:
location / {
proxy_pass http://caremint: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 101m; # patient documents go up to 100 MB
}
In Nginx Proxy Manager, add a Proxy Host with scheme http, forward hostname caremint and port 8080, request its SSL certificate, and paste the last two lines above into the Advanced tab.
Then start the app with docker compose up -d --build and 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
Caremint limits sign-ins, sign-ups, password resets and online bookings per visitor address, so nobody can guess passwords or flood a clinic's calendar 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. Caremint counts the address your proxy adds last, so a header a visitor makes up is never used; replacing the header is still tidiest (Nginx: proxy_set_header X-Forwarded-For $remote_addr;). Turn off response buffering for /api/v1/events (Nginx: proxy_buffering off;) so live updates work, and allow uploads up to 101 MB (Nginx: client_max_body_size 101m;). |
| 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, every visitor counts as one address for the per-address limits, and the per-account limits still apply. Without HTTPS this suits only testing. |
Super-admin → 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 caremint folder (add --platform linux/arm64 for an ARM server)
docker build -f docker/Dockerfile --target pack -t caremint-pack --platform linux/amd64 .
docker create --name caremint-pack-copy caremint-pack
mkdir -p prebuilt
docker cp caremint-pack-copy:/caremint prebuilt/caremint
docker rm caremint-pack-copy
# copy prebuilt/caremint 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 caremint-server
./target/release/caremint pack apps/frontend/dist/client ./caremint
# .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 ./caremint serve
Keep it running with a service manager such as systemd. The server applies the migrations when it starts; ./caremint migrate applies them on their own.
Two copies on one server
To run a staging copy next to the live one, unzip Caremint into a second folder and give each copy its own .env:
# .env of the live copy
COMPOSE_PROJECT_NAME=caremint
APP_PORT=8080
APP_URL=https://clinic.example.com
# .env of the staging copy
COMPOSE_PROJECT_NAME=caremint-staging
APP_PORT=8081
APP_URL=https://staging.example.com
SEARCH_INDEXING=off
COMPOSE_PROJECT_NAME keeps each copy's containers, database, files, network, image and build cache apart, so a docker compose command in one folder never touches the other. Left empty, it is the folder's name, so two folders with the same name (for example /srv/live/caremint and /srv/staging/caremint) would share everything: always set it when you run two copies. Give each copy its own passwords and its own APP_SECRET, and never copy real patient records into a staging copy. Only one copy can run the bundled Caddy, because it needs ports 80 and 443, so put both behind one proxy you run yourself (Behind a proxy you already run) with a different router name or network alias for each, for example caremint-staging. SEARCH_INDEXING=off keeps search engines away from the staging copy (Search engines).
6Install wizard
The first visit to a new install opens the wizard at /install. It runs once; afterwards the page is locked.
- Setup token. Paste the token from the app's log (
docker compose logs app | grep -i "install token"showsInstall token: cm-install-… (open /install and paste it)) and press Check token. The app prints it at every start until the install is finished, and a restart makes a new one, so use the last line. Lost it? SetINSTALL_TOKENin.envto a value of your choice and restart the app withdocker compose up -d. - Server check. The database, file storage, the app address, email, Stripe, the Meta app, the WhatsApp webhook, the writing helper and the other settings from
.env, each marked Ready or Later. Lines marked required must work before you go on; a red one blocks Continue until you change.env, restart the app and press Check again. Everything marked Later can be set up afterwards in Super-admin → Settings. - Create the super-admin. Your name, email and password (at least 10 characters) and the name of your product, which you can change any time. The app address is shown from
APP_URL. Add the sample plans (on by default) adds four plans with monthly and yearly prices (chapter 11); untick it to make your own. - Done. You are signed in as the super-admin and the wizard is locked. It lists what it created and the things to set up before you invite clinics: email, Stripe and, optionally, the Meta app. Open setup check or Go to the admin.
7Setup check
Super-admin → Setup check lists everything a running platform depends on, with a plain-words status, what to do about it and, where possible, a Test button that calls the service for real.
| Row | What the test does |
|---|---|
| Database | Reads the PostgreSQL version and the number of migrations applied. |
| File storage | Writes, reads and deletes a small test file in your bucket or folder. |
| Email (SMTP) | Connects to your mail server and sends a test email to the address you type. |
| Stripe and Stripe webhook | Reads your Stripe balance; warns about paid plans without a Stripe price ID and a missing webhook secret. |
| Meta app | Gets an app token from Meta with your app ID and secret; warns when Embedded Signup is not set up. |
| WhatsApp webhook | Calls your own webhook address the way Meta does, with the verify token, and shows when Meta last sent an event. |
| AI writing help | Lists the provider's models with your key, or says the helper is off. |
| App address | Checks that APP_URL is https and that the app answers there. |
| Visitor addresses | Shows the TRUSTED_PROXY_HOPS setting. |
| Background jobs | Shows queued, running and failed jobs (reminders, sending, webhook processing, template reviews, imports), with the reason a job failed and a Retry button. |
| Install | Shows when the install wizard ran. |
Connect services
Every outside service you run for the whole platform can be set in .env or in Super-admin → Settings. Values saved in the super-admin take precedence over .env, are stored encrypted with your APP_SECRET, and are never shown again once saved (only their last four characters). Change a value by typing a new one. Two things belong to each clinic instead and are set inside the clinic: its WhatsApp number (Reminders → WhatsApp) and its Stripe account for patient payments (Settings → Payments).
8WhatsApp reminders: Meta setup, step by step
Caremint sends reminders and receives the patients' answers through Meta's WhatsApp Cloud API, from each clinic's own WhatsApp number. This chapter sets up your Meta app, a test number and the webhook, connects the number to a clinic, and then takes the number live. Allow about an hour the first time. Meta's screens change now and then; the names below are the ones Meta used in November 2026.
Without any of this, every reminder goes by email. A clinic can start with email and connect WhatsApp later; nothing else changes.
Messaging account or WhatsApp account?
In 2026 Meta's Business settings show two separate items where older guides say "WhatsApp Business Account (WABA)". Caremint needs the first one:
| Meta shows | Where | What it is |
|---|---|---|
| Messaging account | Business settings → Accounts → Messaging accounts; in the App Dashboard's API Setup it is the "Messaging account ID" | The real WhatsApp Business Account: it holds the message templates, the phone numbers and the payment method. Its ID is the WhatsApp Business Account ID Caremint asks for. |
| WhatsApp account | Business settings → Accounts → WhatsApp accounts | The phone number's business presence (profile, display name). It has a different ID. Do not paste this ID into Caremint, and do not give your system user only this one. |
Step 1. A Meta developer account
- Sign in to Facebook with the account that will own the app, and turn on two-factor authentication (Meta requires it for business tools).
- Open developers.facebook.com, choose Get started and register as a developer. Meta confirms your account with a phone number or a card; a phone number already used by another Meta developer account is refused, so use a card or another number in that case.
Step 2. A business portfolio
Open business.facebook.com and create a business portfolio for your company (name, your name, a business email). Everything WhatsApp lives inside it: the Messaging account, the numbers, the system user and later the business verification.
Step 3. A Meta app with the WhatsApp use case
- In the developer dashboard choose My Apps → Create app.
- Give it a name (your product's name), pick the use case Connect with customers through WhatsApp and connect it to your business portfolio.
- Create the app. Meta adds the WhatsApp product, a test Messaging account and a free test phone number.
Step 4. The test number and its five recipients
- In the App Dashboard open WhatsApp → API Setup. Note the Phone number ID and the Messaging account ID of the test number.
- Under To, choose Manage phone number list and add the phones you will test with. A test number can message at most five allow-listed numbers; any other number fails with error 131030.
- Each phone you add gets a 5-digit code on WhatsApp. Type it in to confirm the number.
- Send Meta's
hello_worldtest message from that page once, to check that the number works.
The access token shown on API Setup stops working after about 24 hours. Use it only for this first test. Caremint needs a permanent token from a system user (next step).
Step 5. A system user and a permanent token
- Open Business settings (business.facebook.com → Settings) → Users → System users and choose Add.
- Name it with one word without spaces, for example
ClinicServer(Meta refuses names with spaces), and give it the Employee role. Employee is enough. - Choose Assign assets:
- Apps → your app → turn on Manage app (full control).
- Accounts → Messaging accounts → your Messaging account → turn on full control ("Everything").
- Choose Generate token: pick your app, set the expiry to Never, tick whatsapp_business_management and whatsapp_business_messaging, and generate.
- Copy the token right away and keep it somewhere safe: Meta shows it only once. Anyone with this token can send messages as the business.
Step 6. The app secret
In the App Dashboard open App settings → Basic, find App secret and choose Show. Meta asks for your Facebook password again. Caremint uses the app secret to prove that every webhook really comes from Meta.
Step 7. Your Meta app in Caremint
- In Caremint open Super-admin → Settings → Meta app.
- Enter the App ID and the App secret, and press New verify token (or set
META_VERIFY_TOKENin.env). The verify token is any random string; it only proves to Meta that the webhook address is yours. - Save. The page shows your callback URL:
https://clinic.example.com/api/v1/webhooks/whatsapp(yourAPP_URLfollowed by/api/v1/webhooks/whatsapp).
Step 8. The webhook in Meta
- In the App Dashboard open Use cases, then Connect with customers through WhatsApp → Customize. Under Step 2. Production setup choose Configure Webhooks. (Dashboards from before 2026 had it under WhatsApp → Configuration → Webhook → Edit.)
- Paste the Callback URL and the Verify token from Caremint and choose Verify and save. Meta calls your server at once; this works only when Caremint is online at that https address.
- The Webhook fields table then appears below, with a Subscribe switch for each field. Check that these are on:
messages(required: the patients' answers and taps, and the sent, delivered, read and failed receipts),message_template_status_update(template approvals and rejections arrive at once),message_template_quality_update(a template's quality rating changed),phone_number_quality_update(quality rating and messaging limit changes),user_preferences(a patient stopped or resumed marketing messages inside WhatsApp).
- Each field has a Test link that sends a signed sample event to your server: a quick check that Meta reaches Caremint. If the app secret saved in Caremint is wrong,
docker compose logs appshows "webhook refused: bad or missing signature"; otherwise the sample is accepted quietly (it is for a made-up number, so nothing appears in a clinic).
While the app is unpublished, this page warns that it receives only test webhooks. In practice the sent, delivered and read events of the test number arrive anyway; if real answers ever stop reaching Caremint while the Test link works, publish the app (see Troubleshooting).
Super-admin → Setup check → WhatsApp webhook shows the time of the last event from Meta.
Step 9. Connect the number to a clinic
- Sign in to a clinic as its owner or clinic admin. To make one, open the clinic menu at the top of the sidebar and choose Create a clinic, or use
/signupwhile sign-ups are open (Super-admin → Settings → Sign-ups). - Open Reminders → WhatsApp → Connect a WhatsApp number → Enter IDs and a token.
- Fill in the Phone number ID, the WhatsApp Business Account ID (the Messaging account ID), the permanent access token from step 5 and, if you like, a label the clinic's team sees, for example "Front desk line".
- When the token comes from your platform Meta app (the one in Super-admin → Settings → Meta app), turn on This number is on the platform's Meta app. When the number belongs to another Meta app, such as a clinic's own app, enter that app's secret instead: without it Caremint cannot check the signature of that app's webhooks and refuses them, so no answer would arrive.
- Press Connect. Caremint checks everything with Meta before saving: it reads the display number, the verified name, the quality rating and the messaging limit, and subscribes the app to the account's webhooks.
- For a number on another Meta app, the next screen shows a Callback URL and a Verify token for that number. Paste them into that app's Configure Webhooks page as in step 8. Numbers on your platform app use the webhook you already set up.
Right after connecting, Caremint sends its reminder templates to Meta for review (chapter 10). Templates at Meta on the same page shows each one's status. A reminder goes by WhatsApp once its template is approved, usually within minutes; until then it goes by email.
Step 10. Test it
In the clinic, add a test patient whose mobile is one of the allow-listed phones and who agreed to WhatsApp, and book them an appointment. The booking confirmation arrives on that phone within a second or two, and the message log (Reminders → Message log) shows it sent, then delivered, then read. Book one for tomorrow and tap Confirm on the reminder: the appointment turns confirmed in the calendar. Meta delivers to the test number's five recipients only, so use them for every test until the number is live.
Step 11. Go live with a real number
- Add the clinic's number. In the App Dashboard's API Setup (or WhatsApp Manager → Phone numbers) choose Add phone number. Enter the display name patients will see (the clinic's name), the business category and the number, then confirm it with the code Meta sends by SMS or voice call. The number must be able to receive that code and must not be in use on the WhatsApp or WhatsApp Business app (delete that account first).
- Display name. Meta reviews the display name against its display name rules (it should match the clinic, with no extra words such as slogans). Until it is approved, messages may show the number instead.
- Payment method. In Business settings → Billing and payments, add a card to the Messaging account. Meta bills that account for every reminder; without a payment method, paid messages stop.
- Business verification. In Business settings → Security center, choose Start verification and send the business documents. It raises the sending limit and is required before you can offer Quick sign-up to clinics.
- Connect the new number in the clinic as in step 9, with the same permanent token (the system user already has the Messaging account).
- Register it for sending. Meta sends only from a number registered for the Cloud API. Caremint reads this from Meta: a number that is not registered yet shows Register for sending under Reminders → WhatsApp, and sends from it fail with error 133010. As the owner or a clinic admin, choose Register for sending, type the 6-digit PIN and choose Register.
- The PIN becomes the number's two-step verification PIN. Keep it safe: Meta asks for it if the number is moved. If the number already has a two-step verification PIN, enter that one. Caremint passes the PIN to Meta and does not keep it.
- "Wrong PIN" means the number already has another PIN: use that one, or change it in WhatsApp Manager → Phone numbers → Two-step verification.
- "Too many tries. Try again in N minutes." means Meta blocks new tries for a while (it allows 10 registrations in 72 hours). Any other refusal shows Meta's own text.
Caremint reads the new state with its next daily refresh of the number.curl -X POST "https://graph.facebook.com/v27.0/PHONE_NUMBER_ID/register" \ -H "Authorization: Bearer YOUR_PERMANENT_TOKEN" -H "Content-Type: application/json" \ -d '{"messaging_product":"whatsapp","pin":"123456"}'
Messaging limits
Meta limits how many different people a business can start conversations with in a moving 24 hours, counted for the whole business portfolio (all its numbers share it). New portfolios start at 250 people a day; business verification, or 2,000 delivered messages within 30 days with good quality, raises it to 2,000, and Meta then raises it further by itself (10,000, 100,000, unlimited) when quality is high and at least half of the limit was used in the last 7 days. A clinic with 250 or fewer visits a day stays inside the first limit. The WhatsApp tab shows each number's quality rating and its daily limit.
9Embedded Signup for clinics
With Embedded Signup, a clinic connects its own WhatsApp number in a few clicks: Reminders → WhatsApp → Connect a WhatsApp number → Quick sign-up opens Meta's own window, where the clinic chooses or creates its business portfolio, Messaging account and phone number. Meta then returns a short-lived code and the account and number IDs; Caremint exchanges the code server to server for a business token, subscribes your app to the clinic's account webhooks, registers the number with a new random two-step PIN, reads the number's details, saves the token encrypted and sends the reminder templates for review.
Quick sign-up only works once Meta has approved your business and your app as a Tech Provider. Meta reviews your business documents, your app and two screen recordings, and it can ask for changes. That can take from a few days to a few weeks, and Caremint cannot speed it up or guarantee the result. Until then, clinics connect with IDs and a token, and Quick sign-up says it is not set up on this platform yet.
What Meta asks for
- Business verification of your business portfolio (Business settings → Security center). Meta requires it before App Review.
- Complete app settings (App settings → Basic): app icon, category, contact email, a privacy policy URL and a terms of service URL. You can use Caremint's own legal pages, for example
https://clinic.example.com/legal/privacyand/legal/terms, once you have written them in Super-admin → Settings → Legal pages. - Tech Provider onboarding. In the App Dashboard open Use cases, choose Customize on the WhatsApp use case and open Tech Provider onboarding. Accept the terms there.
- App Review for advanced access to
whatsapp_business_messaging(send messages for your clinics) andwhatsapp_business_management(manage their accounts and templates). Meta asks for two screen recordings:- a message sent from your app and received in WhatsApp: record a booking in Caremint, with the phone showing the confirmation arrive;
- your app creating a message template: record a clinic connecting a number and Templates at Meta showing the templates sent for review.
- Access verification if Meta asks for it after App Review (Meta checks that you really act for other businesses).
- An Embedded Signup configuration. Add the Facebook Login for Business product to your app, open Configurations → Create configuration, choose the login variation WhatsApp Embedded Signup and Embedded Signup version 4, add the WhatsApp asset and the two permissions above, and save. Copy the Configuration ID. Versions 2 and 3 were retired by Meta on 15 October 2026, so use version 4.
- Login settings. In Facebook Login for Business → Settings, turn on Login with the JavaScript SDK and add your domain (for example
clinic.example.com) to Allowed domains for the JavaScript SDK and yourAPP_URLto Valid OAuth redirect URIs. - In Caremint, paste the Configuration ID into Super-admin → Settings → Meta app (or
META_CONFIG_IDin.env). Once the app ID, the app secret and the configuration ID are all set, every clinic can use Quick sign-up.
Limits and billing
- Meta lets a Tech Provider onboard 10 new customer accounts in a rolling 7 days until business verification, App Review and access verification are all done, then 200.
- Each clinic adds a payment method to its own Messaging account in Meta; Meta bills the clinic for its reminders. See Extra costs you pay.
- The webhooks of every number connected this way reach your platform app's webhook (chapter 8, step 8), so nothing else has to be set up per clinic.
Meta's own guides: Embedded Signup overview and the Tech Provider get-started guide, both on Meta's developer site.
10WhatsApp rules Caremint follows
Meta's rules for the WhatsApp Business Platform protect the people who receive messages. Caremint builds them in, so clinics stay within them without having to know them by heart. They still apply to you and your clinics: read Meta's WhatsApp Business Messaging Policy and make your own terms of service point to it.
Utility templates only, approved by Meta
Every message Caremint starts is an approved template. When a clinic connects a number, Caremint sends its own templates to that clinic's WhatsApp account for review, in English (en_US): booking_confirmed, appointment_reminder, appointment_soon, missed_visit, visit_documents, repeat_due, feedback_request, payment_link and waitlist_offer (all utility) and login_code (authentication, for the patient portal). Caremint sends no marketing templates. Meta usually reviews a template within minutes and at most 24 hours, and may pause or turn off a template with poor quality; Reminders → WhatsApp → Templates at Meta shows each status and Meta's reason for a rejection, with Send for review again. A message whose template is not approved goes by email instead, where the rule allows it.
The 24-hour customer service window
A free-form message (for example a reply to a patient from their record) may only be sent within 24 hours of the patient's last message. After that the server refuses it (window_closed), and the reply goes by email or the next reminder starts the conversation again.
Consent
- Each patient record holds the patient's consent for WhatsApp, email and marketing, with the date it last changed. Caremint sends WhatsApp only to patients who agreed to it, and email only to patients who agreed to email.
- A patient who replies STOP (or UNSUBSCRIBE) gets a short confirmation and no more WhatsApp from that clinic; their record shows WhatsApp turned off. A patient can also stop messages inside WhatsApp itself; Meta tells Caremint (the
user_preferenceswebhook) and the record follows. - The booking page asks patients whether they want their confirmation and a reminder on WhatsApp, and the clinic records consent given at the desk on the patient's record. Clinics should keep their own proof of consent as their local law asks.
Patients' answers act on the calendar
Reminder templates carry quick-reply buttons: Confirm marks the appointment confirmed, Reschedule sends the patient their link to pick a new time and tells the front desk, and I can't come cancels it and offers the time to the waiting list. Anything else the patient writes appears under Reminders → Message log for the front desk to answer.
Usernames and business-scoped user IDs
Since 2026 WhatsApp users can have a username and hide their phone number. Meta then identifies them to each business with a business-scoped user ID. Caremint matches an answer to its patient by this ID or by the phone number, and keeps the ID on the patient's record once Meta sends it.
Quality rating and messaging limits
Meta rates each number High, Medium or Low from how people react (blocks, reports, reads), and limits how many people a portfolio can reach in 24 hours (chapter 8). The WhatsApp tab shows both. Reminders that patients asked for rarely hurt quality; never use a clinic's number for anything else.
Official API only
Caremint never logs in to WhatsApp Web, never scans QR codes and never "warms up" numbers. Those tools break WhatsApp's terms and get numbers banned. Every message goes through Meta's Cloud API with the clinic's own number.
11Plans and billing for clinics (Stripe)
You sell plans to clinics. Caremint works with your own Stripe account: Stripe Checkout for new subscriptions, Stripe's customer portal for card changes and cancellations, and signed webhooks that switch plans on and off. (Patients pay the clinic, not you: that is chapter 12.)
Stripe is a third-party payment service with its own pricing, and you pay its fees: in the USA 2.9% + 30¢ per successful card payment plus 0.7% of subscription volume for Stripe Billing. Other countries, cards and currencies have their own rates on Stripe's pricing page.
1. Plans
Super-admin → Plans. Each plan has a name, a description, a monthly price and an optional yearly price, the currency, a free trial (days), a list of features shown on the pricing page, whether it is public, whether it is the default plan new clinics get, and an optional "Most popular" badge. Its limits are enforced on the server:
| Limit | What happens when it is reached |
|---|---|
| Doctors (people who see patients) | Adding another one is refused with an upgrade prompt. |
| Branches | Adding another branch is refused. |
| Appointments a month | Booking keeps working, so no patient is turned away; the owner gets a banner and an email at 80% and 100%. |
| WhatsApp reminders a month | Past the limit, reminders go by email until the next month or an upgrade. |
| AI note drafts a month | The writing helper pauses; doctors still write and save notes. |
| File storage | An upload past the limit is refused. |
| Online payments | Whether the clinic may take deposits and pay links online (chapter 12). |
An empty limit means unlimited. Archiving a plan hides it from new clinics; existing subscribers keep it. The install wizard's sample plans (a year costs ten months; each has a 14-day free trial; edit them freely):
| Plan | Month / year | Doctors | Branches | Appointments a month | WhatsApp reminders a month | AI note drafts a month | Storage |
|---|---|---|---|---|---|---|---|
| Solo (default) | $29 / $290 | 1 | 1 | 400 | 400 | 50 | 2 GB |
| Practice (most popular) | $79 / $790 | 5 | 2 | 2,500 | 2,500 | 300 | 20 GB |
| Group | $199 / $1,990 | 20 | 10 | 12,000 | 12,000 | 1,500 | 100 GB |
| Enterprise | $399 / $3,990 | No limits, priority support | |||||
Free trials
A new clinic on a paid plan gets that plan's trial days. When the trial runs out, or a paid plan is cancelled and its period ends, the clinic turns read-only: everything can still be read, and Settings → Plan and billing still works, but nothing new can be booked, written or sent. A banner says so and the owner gets one email a day until a plan is picked. Checkout lifts it at once, and Stripe is told how many trial days are left.
2. Stripe keys
- In the Stripe Dashboard, switch to Test mode first. Under Developers → API keys, copy the Secret key (
sk_test_…) and the Publishable key. - Paste them into Super-admin → Settings → Stripe (or
STRIPE_SECRET_KEYandSTRIPE_PUBLISHABLE_KEYin.env).
3. Prices
- In Stripe, open Product catalog → Add product for each paid plan, with a recurring monthly price and, if you sell yearly, a recurring yearly price.
- Copy each price's ID (
price_…) into the plan in Super-admin → Plans. Press Check price: Caremint reads the price from Stripe and shows its amount and interval, so a wrong ID is caught before a clinic sees it.
4. The webhook
- In Stripe, open Developers → Webhooks → Add endpoint with the URL
https://clinic.example.com/api/v1/webhooks/stripe. - Select these events:
checkout.session.completed,customer.subscription.created,customer.subscription.updated,customer.subscription.deleted,invoice.paid,invoice.payment_succeeded,invoice.payment_failed,charge.refunded,charge.dispute.createdandcharge.dispute.closed. - Copy the endpoint's Signing secret (
whsec_…) into Super-admin → Settings → Stripe (orSTRIPE_WEBHOOK_SECRET). Without it, paid plans would never switch on, and the setup check says so.
5. The customer portal
In Stripe, open Settings → Billing → Customer portal and activate it, with payment method updates, invoice history and cancellation turned on. Clinic owners reach it from Settings → Plan and billing → Manage in Stripe.
6. Go live
Test a full upgrade with Stripe's test card 4242 4242 4242 4242, then repeat steps 2 to 4 in live mode with your live keys and live price IDs.
DEMO_PAYMENTS="true" in .env turns on a test checkout that switches plans without any card, and lets clinics try patient pay links with test cards. It is "false" in the shipped file. It only works while no Stripe secret key is set: once you add one, plan changes go to Stripe Checkout. Keep it off on a live site.
Plans switch on only from Stripe's signed webhooks. Each Stripe event is applied once, in the same database transaction as its changes, so Stripe's retries never double anything. Payments and subscriptions are never deleted with a clinic: a clinic with money records is soft-deleted, so refunds and chargebacks still find their invoices.
Charging clinics through Caremint (selling plans or subscriptions) requires the Envato Extended Licence. The Regular Licence covers a single product whose end users are not charged.
When a card payment fails
- While Stripe retries the card (on the retry schedule in your Stripe billing settings), the clinic is past due, not suspended: it keeps working and still counts in the monthly recurring revenue, the owner gets a "payment failed" email, and the failed payment shows under needs attention in the super-admin.
- After Stripe's last retry (the final invoice fails, or Stripe marks the subscription
unpaid), the subscription is unpaid and the clinic suspended with the reason "Payment failed: the card was declined on every retry.". The owner gets an email. The clinic's records stay; an unpaid subscription leaves the monthly recurring revenue and counts as lost revenue that month. - When the clinic pays (Stripe's
invoice.paid), the subscription and the clinic are both active again. This lifts only the suspension for non-payment: one a super-admin set stays until a super-admin lifts it.
12Patient payments (each clinic's own Stripe)
Patients pay deposits and bills straight into the clinic's own Stripe account. You never hold the clinic's money, and each clinic sees its payments in its own Stripe Dashboard. The clinic's plan must allow online payments (chapter 11).
- The clinic's owner or admin opens Settings → Payments and copies the Webhook address shown there (
https://clinic.example.com/api/v1/webhooks/stripe/clinics/<clinic id>). - In the clinic's Stripe Dashboard, Developers → Webhooks → Add endpoint with that address and the events
checkout.session.completed,checkout.session.async_payment_succeededandcheckout.session.async_payment_failed. Copy its Signing secret (whsec_…). - Under Developers → API keys, copy the Secret key (
sk_live_…, orsk_test_…to try it first) and, if you like, the Publishable key. - Back in Settings → Payments, paste the secret key and the webhook signing secret and press Connect Stripe. Caremint checks the key with Stripe and shows the account's name.
Caremint records an online payment only when the clinic's signed Stripe webhook confirms it. Until the signing secret is saved, pay links and booking deposits stay off and the page says Webhook missing, so no patient can pay for something Caremint would never record.
What patients can pay online
- Deposits on the booking page, for services that ask for one (Online booking → Deposits). The time is held while the patient pays; an unpaid hold is released by itself.
- Bills: Billing → an invoice → Send payment link. The link (
/pay/<token>) lasts 7 days and opens a fresh Stripe Checkout page each time. It can go by WhatsApp (thepayment_linktemplate) or email, and the patient portal shows a Pay button for every open bill. - Refunds of online payments go back through the clinic's Stripe account (Billing → the payment → Refund). Desk payments (cash, card machine, bank, insurance) are recorded by hand.
Stripe charges the clinic its own fees on each patient payment (in the USA 2.9% + 30¢ per card payment). Caremint adds nothing.
13Email (SMTP)
Caremint sends two kinds of email through one SMTP account: messages to patients (reminders that go by email, booking confirmations, documents, pay links and portal sign-in codes, sent with the clinic's name), and platform emails (password resets, team invites and notices: a payment failed, a plan limit was reached, a clinic was suspended, a trial ended, support asks for access). Each notice goes out at most once per event, never from demo clinics.
- Get SMTP details from any email provider (Amazon SES, Postmark, Brevo, Mailgun, your own mail server…): host, port, username, password and a sender address on a domain you have verified with that provider.
- Enter them in Super-admin → Settings → Email (or the
SMTP_*keys in.env). Usestarttlson port 587,tlson port 465. - Press Send test email in Super-admin → 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 wording of every platform email is editable in Super-admin → Settings → Email; each clinic edits the wording of its own reminder emails under Reminders → Rules.
Email providers are third-party services with their own pricing, and you pay them: Amazon SES, for example, charges $0.10 per 1,000 emails, and most other providers sell monthly plans with a small free tier.
Reminder emails name the clinic, the doctor, the time and the service. If your clinics' law treats that as health data, choose a provider that signs the agreement your law asks for (for example a business associate agreement under HIPAA), and let clinics name services neutrally (chapter 32).
14Writing help for visit notes (AI)
On a visit, the doctor chooses Write from bullet points, types short notes and presses Write the draft: the AI turns them into the four note parts for the doctor to check, change and then use. It uses the provider you choose, with your own key, for every clinic. Without a key it is off and hidden.
- Create an API key at OpenAI, Anthropic or Google AI Studio, and add a payment method there.
- In Super-admin → Settings → AI providers, pick the provider, paste the key and, if you like, change the model (defaults:
gpt-5-mini,claude-sonnet-5-5,gemini-2.5-flash). The same values can go in.env(AI_PROVIDER,OPENAI_API_KEYand so on). Off turns the helper off for everyone. - Set each plan's AI note drafts a month in Super-admin → Plans.
- Press Test on the AI row of the setup check.
What the helper does and doesn't do
- It only rewrites the doctor's own bullet points into subjective, objective, assessment and plan, spelling out shorthand. It is told never to add a finding, a diagnosis or a medicine that is not in the bullet points.
- Nothing is saved until the doctor chooses Use these notes, and the notes stay a draft until the doctor signs them.
- A draft counts against the clinic's plan only when the AI provider wrote it; if the provider declines or can't be reached, nothing is counted.
The bullet points the doctor types are sent to the AI provider you pick. Check its data terms before you turn the helper on, for example whether it signs a business associate agreement under HIPAA or a data processing agreement under GDPR, and whether it keeps or trains on the text. Tell your clinics which provider you use.
OpenAI, Anthropic and Google are third-party services with their own pricing, and they bill you, the buyer, for every draft: roughly 0.1 to 1¢ per draft with the default models, as the chapter Extra costs you pay explains. Your plans' AI note drafts cap that spend for each clinic.
15Video visits
A service marked as a video visit gives each appointment its own Jitsi Meet room. The patient opens it from their booking link or the reminder: a waiting room checks the camera, the microphone and the sound first, then opens the call. The doctor joins from the appointment. A doctor can instead have their own fixed meeting link (Zoom, Google Meet or Jitsi) for all their video visits: Staff and hours → the doctor → Own meeting link.
- Default: the free public server
https://meet.jit.si. On it, the first person in a room may be asked to sign in with Google, GitHub or Facebook. - Your own Jitsi server (free and open source) or a hosted one such as 8x8 JaaS avoids that sign-in and keeps the calls on servers you choose. Set its address in
VIDEO_BASE_URL(for examplehttps://meet.example.com) and restart the app.
Caremint does not record calls and stores nothing from them. The video and sound go between the browsers and the Jitsi server; check that server's terms if your clinics' law has rules for video consultations.
16File storage
Patient documents (uploaded by the clinic or shared with the patient), CSV imports, clinic logos and doctors' signatures 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 Super-admin → Settings → Storage. Keep the bucket private, and choose its region with the same care as the server's. - A local folder:
STORAGE_DRIVER=localkeeps files in theapp-storageDocker volume. Fine for one server.
Files are never public: the app serves each one only to signed-in staff of its clinic, or to the patient it was shared with in the portal. Uploads are checked by their content, not their name: images (JPEG, PNG, WebP up to 5 MB), audio and video (up to 16 MB) and documents (PDF, Word, Excel, PowerPoint, text and CSV up to 100 MB). Each plan has a storage limit, and Super-admin → Settings → Storage shows how much space is used.
The bundled MinIO and the server's own disk cost nothing extra. Outside storage providers are third-party services with their own pricing, and you pay them for space and sometimes for downloads: Cloudflare R2, for example, charges $0.015 per GB a month after the first 10 GB, with no download fees.
The clinic (your customers)
Each of your customers works in their own clinic: its staff, patients, calendar, records, money and settings, kept apart from every other clinic. A person can belong to several clinics and switch between them from the clinic menu. What each person sees depends on their role (chapter 17).
17Overview and roles
The overview
The first page after signing in is the clinic's day: its numbers (today's appointments, tomorrow confirmed, revenue today, notes to sign, the no-show rate), now and next, tomorrow's confirmations, the waiting room, who is working, what needs attention (unsigned notes, patients' messages to answer, unpaid bills, plan limits) and quick actions. It updates live as the day goes on. A doctor sees their own day first; the front desk sees arrivals and payments first. A new clinic sees a first-day checklist: services, staff, opening hours, WhatsApp, payments, the first patient and the first booking.
Roles
Every person has one of four roles: Owner, Clinic admin, Doctor or Receptionist. Separately, a person can see patients: they then get a column in the calendar and count towards the plan's doctors (an owner who is also a doctor turns this on for themselves). What each role may do is checked by the server on every request; the screens only hide what a role cannot use.
| Permission | Owner | Clinic admin | Doctor | Receptionist |
|---|---|---|---|---|
| See the calendar and book appointments | Yes | Yes | Yes | Yes |
| Open visit notes and prescriptions | Yes | No* | Yes | No* |
| Write and sign visit notes | Only people who see patients | |||
| Take payments and make invoices | Yes | Yes* | No* | Yes* |
| See reports and revenue | Yes | Yes* | No* | No* |
| Change settings and staff | Yes | Yes* | No | No |
| Change the plan and delete patients | Yes | No | No | No |
* The owner can switch these for the clinic under Staff and hours → Edit roles; the rest are fixed for safety. A person who opens a page their role can't use sees what it is and can ask the owner for access in one tap.
18Calendar and appointments
- Day view with a column per person who sees patients, or one doctor's week. Working hours are white, the rest shaded, blocked time hatched; appointments are coloured by where they are in the day.
- Book: click an empty slot, or New appointment: find the patient (or add them in one line), pick the service, doctor, room, date and one of the doctor's free times, a reason, and whether WhatsApp confirms it now.
- No double booking. The database itself refuses two appointments for the same doctor at the same time (for services that don't allow overlaps), so two people booking at once can never both win. The one who lost sees the nearest free times.
- Drag an appointment to move it, and choose whether the patient is told of the new time by WhatsApp or email.
- The day's steps: confirm, check in (the waiting room counts the minutes), start the visit, finish; or no-show. The appointment sheet shows the patient (age, phone, allergies, balance), the reminder and the patient's reply, the history and the next step.
- Walk-ins join the doctor's queue without holding a time.
- Block time for one doctor (an admin hour) or everyone (a staff meeting), and leave under Staff and hours.
- Waiting list: patients who want an earlier time. When a time is cancelled, it is offered on WhatsApp to the first person on the list it fits (doctor, service, dates); if they turn it down, the next one gets the offer.
- Appointments (the list): today, coming up, not confirmed and cancelled this month, with filters, search, CSV export and the same actions.
19Patients
- The list: all, seen this year, owes money and archived, with doctor and tag filters and a search by name, phone or patient number.
- Add a patient: name, birth date, sex, mobile for WhatsApp, email, what they agreed to be sent (WhatsApp, email, marketing), main doctor, allergies (or "None known"), insurance and a parent for a child. A likely duplicate is shown with a link to the existing record.
- The record: the next appointment, visits, the last blood pressure and the balance on top; visits, the medicines they take now and documents; the health summary (allergies, conditions), contact details, consent and staff notes. Opening a record is written to the audit log.
- Documents: upload files to the record (chapter 16) and share chosen ones with the patient's portal.
- Import: upload a CSV, match its columns, check every row (nothing is saved yet), then import in the background with live progress. Rows that need a fix can be downloaded; a whole import can be undone for 24 hours.
- Export: every patient as CSV (people who may change settings). The export is written to the audit log.
- Archive hides a patient and keeps everything. Delete (the owner only) removes the record 30 days later; until then it can be restored.
20Visits and notes
- Start visit (from the overview, the calendar, the list or the record) opens the visit: vitals on top (with a warning when blood pressure was up on the last two visits), the notes in four parts (subjective, objective, assessment, plan), and the diagnoses.
- Diagnoses: search a bundled list of common ICD-10-CM codes (published by the US National Center for Health Statistics, public domain) or type free text.
- Writing help (when the platform turned it on, chapter 14): Write from bullet points turns the doctor's short notes into a draft to check; nothing is saved until Use these notes.
- On the right: the patient at a glance, this visit's prescriptions, the follow-up (with the first free time to book) and the bill.
- Notes save on their own as a draft. Finish visit signs them and sends the bill to the front desk. A signed visit is locked: later changes are dated notes (addenda) added below it, with who wrote them.
- Visits (the list): today's visits, every draft still to sign and every signed visit, with filters, search and CSV export.
21Prescriptions
- New prescription (from a visit or the list): the patient's allergies on top, then one block per medicine (name, dose, how often, for how long, quantity, refills and a note for the label). Saving shows any allergy warning and opens the preview.
- Sign (people who see patients) prints the doctor's name, registration number and signature (uploaded in Your profile) on the clinic's letterhead, with a check code.
- Print, Download PDF or Send it to the patient by WhatsApp and email. A signed prescription can be voided, and a doctor can stop one medicine on it later.
- The check: a pharmacy opens
/rxand types the code from the paper. It shows whether the prescription is real and still valid, the clinic, the doctor, the patient's initials and the medicines, and nothing else about the patient. - Repeats: the list shows the repeats due in the next 30 days, and the repeat-prescription reminder (chapter 23) asks the patient to book.
22Billing (patients' invoices and payments)
- This month at a glance: money taken, unpaid, paid online and refunds; then every invoice (all, unpaid, paid, refunded) with filters, search and CSV export.
- Invoices are made from the visit (the lines the doctor and the front desk add) or on their own (New invoice): lines from the price list or typed in, a discount, the clinic's tax (Settings → Letterhead and documents) and a note. Totals are always worked out on the server.
- Payments: at the desk (cash, card machine, bank transfer or insurance; part payments add up), or online with a payment link by WhatsApp or email (chapter 12). A deposit paid when booking is taken off the visit's invoice. A finished visit with nothing to pay gets no bill.
- Refunds: online payments go back through Stripe; desk refunds are recorded.
- PDFs of every invoice and receipt on the clinic's letterhead; Send the receipt by WhatsApp and email.
23Reminders and WhatsApp
Reminders has three tabs: Rules, Message log and WhatsApp. The top of Rules shows what reminders did this month: sent, confirmed, rescheduled by patients and the no-show rate.
The rules every clinic starts with
| Rule | When | How | On at first |
|---|---|---|---|
| Booking confirmation | As soon as a visit is booked or moved | WhatsApp, else email | Yes |
| Reminder the day before | 09:00 the day before (Confirm, Reschedule, I can't come) | WhatsApp, else email | Yes |
| Visit starts soon | 2 hours before, with directions | Yes | |
| We missed you | 1 hour after a no-show, with a link to book again | WhatsApp, else email | Yes |
| Receipt and documents | When the visit is finished | WhatsApp and email | Yes |
| Prescription can be renewed | 09:00, shortly before a medicine runs out | WhatsApp, else email | Yes |
| How was your visit? | 10:00 the day after | WhatsApp, else email | No |
Each rule can be turned on or off, and its time, channel and email words changed. Times are the clinic's own time zone. Each message is sent once, never twice, and only to patients who agreed to that channel (chapter 10). "WhatsApp, else email" uses email when the patient has no WhatsApp, the template is not approved yet, the plan's WhatsApp reminders for the month are used up, or WhatsApp fails.
Message log
Every WhatsApp and email the clinic sent and every message patients wrote: all, replies and failed, for the last 7, 30 or 90 days. Each row says how far it got (sent, delivered, read, failed, and the email sent instead) and what the patient answered. Replies that need a person are counted on the overview until the front desk answers them. Messages are kept for 12 months.
The clinic's number (name shown, quality, daily limit), Connect a WhatsApp number (chapters 8 and 9), Register for sending when Meta needs it, and Templates at Meta with each template's review state.
24Online booking
Each clinic has its own booking page at https://clinic.example.com/book/<clinic> (the address is set under Online booking). Online booking sets its rules:
- Patients can book online on or off. When it is off, the page shows the clinic's phone number instead.
- Earliest booking and furthest ahead, free cancelling until (how long before the visit a patient can still move or cancel online), and when times start (every 15 minutes, 30 minutes…).
- Deposits for the services that ask for one (chapter 12), and whether a reason for the visit is required.
- Who patients can book, with each person's next free time and a switch, and which services (Services and rooms).
- Book a visit button for the clinic's own website: one line of code to paste, with the clinic's colour.
- A live preview of the page, and how many visits patients booked online this month.
25Staff, services and rooms
Staff and hours
- Everyone and the invites waiting, with role, speciality, working hours, bookings this week and leave.
- Invite a person by email: name, role, whether they see patients, title, speciality and the day they start. They set their own password from the email.
- A person's sheet: working hours (split shifts allowed), leave (with how many patients are booked then and a way to move them), the services they offer, whether patients can book them online, the usual room, their title, speciality and registration number for prescriptions, and their own video meeting link.
- What each role can do, and Edit roles for the owner (chapter 17).
Services and rooms
- Services: name and a line for the booking page, length, price, deposit, who offers it, whether it is a video visit, whether patients can book it online, and its calendar colour.
- Rooms in each branch, with what is on in each now (in a visit, free until the next booking). One room can be the video room for telehealth visits.
- Branches (Settings → Clinic): each with its address and rooms; the plan sets how many.
26Reports
For a period and one doctor or all: appointments, the no-show rate, money taken and new patients, each against the period before; appointments and no-shows over time (with the weeks before WhatsApp reminders shaded), what each doctor and service billed, and where bookings came from (the online booking page, the front desk, a phone call, a visit, a walk-in, or the patient moving their own booking). The days export as CSV. A change against the period before shows only when the clinic has records for the whole earlier period.
27Clinic settings
| Section | What it sets |
|---|---|
| Clinic | Logo, name, short name, address and contact details, time zone, currency and country, the clinic colour (one colour for the app, the booking page and the letterhead) and the branches. |
| Opening hours | The clinic's week (split shifts and closed days, holidays) and what patients read before a visit (come early, how to find the clinic, a map link). The booking page offers times only inside these hours. |
| Letterhead and documents | What tops every invoice, receipt and prescription (the logo, an extra line such as a licence number), the footer, the note under invoices and the tax, with a preview. |
| Payments | The clinic's own Stripe account (chapter 12). |
| WhatsApp and email | A summary of the number, the rules that are on and what went out this month; managed under Reminders. |
| Privacy and data | How records are kept (who may open them, signed notes, keeping, export and delete), the sample patients a new clinic starts with (remove or bring back), support access requests (below), deleting the clinic (the owner, typing its name) and the latest audit rows. |
| Audit log | Who opened or changed what, when and from which device, in plain words: search, filter by kind, CSV export. |
| Plan and billing | The owner only: the plan, this month's use of every limit, changing the plan (Stripe Checkout, monthly or yearly), Manage in Stripe, cancelling, and the invoices for the platform's plan. |
| Your profile | Everyone: name and picture, password, notifications (email and browser, per event) and, for people who see patients, the signature their prescriptions print. |
Support access
Patient records belong to the clinic. When you (the platform owner) need to look inside a clinic to help it, you ask from the clinic's sheet in the super-admin with a reason (chapter 29). The clinic's owner gets an email and a note in their bell, and decides under Privacy and data: Approve lets support open the clinic for 30 minutes; Refuse ends the request. Every look is in the audit log.
Patients' pages
28Booking, payments, portal and video
Patients never sign up for anything. Their pages carry the clinic's own name, logo, address, phone and colour, so they see their clinic and not the software, and they work on any phone.
The booking page (/book/<clinic>)
- What for: the services the clinic offers online.
- Who and when: the first free doctor or one person, a week of days and that day's free times by part of the day, in the clinic's time. A full day offers the next day with a free time.
- Your details: who the visit is for, how to reach them, why they come, whether to send the confirmation and a reminder on WhatsApp, and the clinic's rules. If someone else took the time a moment before, the details stay and the nearest free times are offered.
- Booked: when, where, when to arrive, how to pay and until when it can be changed for free; add to calendar, directions, the change-or-cancel link and the portal. A deposit first goes to the payment page.
The Book a visit button (chapter 24) opens the same page from the clinic's own website.
Change or cancel (/manage/<link>)
The link in every confirmation and reminder: what and when, I'll be there, move it (the next days' free times with the same person; the old time is freed only when the move is confirmed) or cancel it. Past the free-change window it says to call the clinic.
Pay (/pay/<link>)
A bill or a deposit, paid on the clinic's own Stripe Checkout. The page waits for Stripe to confirm the payment, then shows it paid.
The patient portal (/portal/<clinic>)
The patient types their mobile or email and gets a 6-digit code (by WhatsApp when the clinic has an approved sign-in template and the patient agreed to WhatsApp, otherwise by email). A code works for 10 minutes and 5 tries; the page never says whether someone is a patient; no password. Inside: the next visit (directions, change or cancel, the video room), past visits with the doctor's summary, prescriptions as PDF, bills (receipt, or pay online) and the documents the clinic shared. A sign-in lasts 30 days on that device.
Video waiting room
For a video visit, the patient's link opens a waiting room: their own camera, a microphone level and a test sound, the connection, a countdown and Join (open from 10 minutes before the start), with what to do if the video drops. The call runs on Jitsi Meet or the doctor's own link (chapter 15).
Prescription check (/rx)
For pharmacies: the code from a prescription shows whether it is real and valid (chapter 21).
Run the platform
29Super-admin
The super-admin is your side of the platform, under /platform. The install wizard makes you its first admin. Give a colleague the admin role (everything) or the viewer role (sees everything, changes nothing) in Users.
Overview
Monthly recurring revenue (a yearly plan counts as a twelfth), new and lost revenue this month, clinics (active, suspended), paying and trialing clinics (paying means an active subscription to a paid plan: trials and past-due subscriptions don't count), messages across all clinics, revenue by month or week, customers by plan, the newest clinics and a needs attention list (failed payments, numbers that need reconnecting, clinics at a limit).
Clinics
Every clinic with its owner, plan, size, revenue and the one status that matters most; filter by paying, free or suspended, plan and number status; export CSV. The detail sheet shows the owner, the subscription, money paid, this month's usage, the WhatsApp numbers, the members and the payments, and lets you:
- Change the plan by hand (a manual grant: Stripe is not charged);
- Suspend with a reason (the owner gets an email, the clinic turns read-only with a banner) or reactivate. A suspension for a failed payment lifts itself when the clinic pays; one you set stays until you lift it;
- Delete: the clinic is soft-deleted, its Stripe subscription cancelled and its number tokens wiped, and its payment records are kept;
- Ask for access, then Open as owner once the clinic's owner approves (chapter 27). You type why you need to look; the owner has 30 minutes from their approval. The borrowed session ends with the approval, shows a banner with an Exit button and is written to the clinic's audit log; inside it you cannot see tokens, keys or PINs, change the plan, delete the clinic or open the super-admin.
Users, plans, payments
- Users: everyone who can sign in, across all clinics; platform staff and suspended people have their own tabs. Suspend a person (which signs them out everywhere) or make them staff. You cannot change your own role or suspend yourself.
- Plans: chapter 11.
- Payments and subscriptions: every payment (paid, failed, refunded) with this month's totals and why a payment failed, and every subscription with its status, interval and what ends or fails soon.
Settings
| Section | What it sets |
|---|---|
| Branding | Product name, logo, brand colour, support email, Documentation URL and Support URL (chapter 30). |
| Meta app | App ID, app secret, verify token, Embedded Signup configuration ID and Graph API version (chapters 8 and 9). |
| Stripe | Secret key, publishable key and webhook signing secret for the clinics' plans (chapter 11). |
| SMTP server (chapter 13) and the wording of the seven platform emails, with placeholders such as the link and the clinic's name. | |
| AI providers | Which AI writes the note drafts (or Off), keys and models (chapter 14). |
| Storage | Bucket or local folder, with the space used (chapter 16). |
| Sign-ups | Open to everyone, by invite only, or closed; the plan new clinics get. |
| Legal pages | Terms of service, privacy policy and refund policy in Markdown, shown at /legal/terms, /legal/privacy and /legal/refunds and linked from the public pages. Write your own; they are your agreement with your clinics, and your privacy policy must say how you handle patient data. |
| Maintenance | Maintenance mode with your message (clinics see a maintenance page; super-admins keep working), the background job counts and the Remove demo data button. |
30Rebrand
Super-admin → Settings → Branding changes the product name, the logo, the brand colour and the support email without touching code. They show in the sidebar, the sign-in and sign-up pages, the public landing and pricing pages, the platform emails and the browser tab. The logo must be a square PNG, SVG or WebP of at most 1 MB; SVG files with scripts are refused. Each clinic also has its own logo and colour (Settings → Clinic), which the patients' pages, the clinic's documents and the clinic's own screens use.
Help links
Caremint never links to an address of ours. Two fields in Branding decide where its help links go:
| Field | Where it shows | When it is empty |
|---|---|---|
| Documentation URL | The address where you published this guide (docs/index.html from your download), for example https://help.example.com/docs. The super-admin menu shows Help and docs, and the install wizard and the Meta settings link straight to the right chapter. | No docs link in the menu; the setup pages name the file and the chapter to read instead. |
| Support URL | Your own help or contact page, for your clinics. Every clinic's menu shows Help and docs, which opens it. | The link opens an email to the support email instead, or is hidden when that is empty too. |
Both must be full addresses starting with https:// (or http://). Your clinics never see this guide: it is written for you, so the clinic's help link goes to your own support page.
To change the text of the public landing page, the pricing page wording or anything else beyond these settings, edit the React pages (chapter 36) and rebuild.
Search engines
Caremint answers /robots.txt itself: search engines may index the public pages (landing, pricing, legal pages, sign-in and sign-up) and the clinics' booking pages, while the clinics, the super-admin, the install wizard, invitations, password resets, the API and every patient link (changing a booking, paying, the portal, prescription checks) stay closed. With SEARCH_INDEXING=off in .env, for a staging copy, /robots.txt closes every page and every answer also carries X-Robots-Tag: noindex, nofollow. Restart the app after changing it (docker compose up -d).
31Demo mode and the seed commands
Demo mode
DEMO_MODE=true turns an install into a public demo, like the item's live preview. Never turn it on for a real platform. It is not in .env.example and is off unless you add it. With it on:
- The sign-in page shows one-click sign-ins: the clinic's owner, a doctor, the front desk and a read-only super-admin, and the portal shows the demo patient's page in one click. They work inside the marketplace's preview frame too (the session cookie is then
SameSite=None; Secure; Partitioned). One address can use them a limited number of times an hour; after that the page says how many minutes to wait. - The demo data is added on start: "Lakeside Family Clinic" (made up) with its team, patients, 24 weeks of history and two weeks ahead, visit notes, prescriptions, invoices and reminders, and other made-up clinics for the super-admin screens. Every name, phone number and email is invented (phone numbers use the 555 range).
- The clinic's WhatsApp number is a simulated number that talks to Caremint's built-in WhatsApp simulator instead of Meta: reminders get sent, delivered and read receipts over a few seconds, and patients' taps are simulated.
- Nothing outside is called: no AI provider (a rule-based writer drafts notes, free), plan changes and patient payments are test checkouts (card
4000 0000 0000 0002is declined, to show what a patient sees), the install wizard is off, imports are off, and passwords, secrets, tokens and other risky settings are locked. - The demo data is removed and added again every night at 03:00 UTC.
Seed commands
| Command | What it does |
|---|---|
docker compose exec app caremint seed-demo | Adds the demo data, every row marked as demo. It only adds rows and never deletes anything. It refuses to run on a database that has any real account, clinic, payment or subscription; --confirm adds the demo clinic next to real data anyway (for a staging copy). |
docker compose exec app caremint reset-demo | Removes the demo rows and adds them again. It refuses to run when the database holds any real account, clinic, payment or subscription, with no way round it. Restart the app afterwards so its WhatsApp simulator loads the new numbers. |
| Super-admin → Settings → Maintenance → Remove demo data | Deletes only rows marked as demo. A demo clinic that has a real payment or subscription is kept. |
docker compose exec app caremint migrate | Applies the database migrations and stops (the server also does this on every start). |
Real accounts, clinics, payments and subscriptions are never marked as demo, so no seed or reset command can touch them. Every new clinic also starts with a few sample patients marked as samples, so its screens are not empty; the owner removes them under Settings → Privacy and data.
Privacy and security
32Health data and privacy
Clinics keep health records in Caremint, and many countries have strict laws for them (HIPAA in the USA, GDPR in Europe, and local health-data laws elsewhere). Caremint gives you and your clinics the controls those laws usually ask for. Whether a clinic complies depends on where and how you run it, the agreements you sign and the clinic's own practices, so Caremint makes no compliance claim. Get advice for the countries you sell in.
What Caremint does
- Each clinic's records are kept apart from every other clinic's (chapter 33), and only the clinic's own staff can open them.
- Roles decide who opens what: by default the front desk and clinic admins cannot open visit notes or prescriptions (chapter 17).
- An audit log of every record opened, every change, every export and every support look, with who, when and from which device (Settings → Privacy and data → Audit log, exportable as CSV).
- Signed notes are locked; later changes are dated addenda, so the record shows what was known when.
- Support can't look without permission: you open a clinic only after its owner approves, for 30 minutes, logged (chapter 27).
- Consent records for WhatsApp, email and marketing, and STOP honoured at once (chapter 10).
- Export and delete: patients export as CSV; the owner deletes a patient, who is removed 30 days later.
- Kept only as long as needed: the message log is cleared after 12 months, notifications after 90 days, stored webhook bodies and finished jobs after 14 days, and expired sessions and sign-in codes within the hour.
- Secrets are encrypted in the database (chapter 33), and nothing is sent to an AI provider unless you turn the writing helper on.
- No AI diagnosis and no medical advice (chapter 14).
What you and your clinics must do
- Choose where the data lives. The server, its backups and the file storage hold the records; pick their country and provider to fit your clinics' law, and turn on disk encryption where the provider offers it. Caremint encrypts secrets, not every patient field; the database itself relies on your server's protection.
- Sign the agreements the law asks for with the services that touch patient data: your server and storage host, your email provider (reminders name the doctor, the time and the service), your AI provider (if the writing helper is on) and your video service. Under HIPAA that is a business associate agreement; under GDPR a data processing agreement. Meta's WhatsApp terms apply to the reminders; check whether they are enough for your market.
- Keep messages lean. Reminders carry the service's name. If a service's name would reveal something sensitive, name it neutrally (for example "Consultation" instead of a condition).
- Write your legal pages (Super-admin → Settings → Legal pages): your terms with clinics, and a privacy policy that says what you store, where, for how long and who you share it with. Each clinic is responsible for its own notice to its patients.
- Back up, and test the restore (chapter 39). Keep backups encrypted and as private as the live data.
- Use strong sign-ins: long unique passwords for staff, and two-factor sign-in on your server, Meta, Stripe, email and storage accounts.
- Deleting a clinic closes it at once and cancels its plan; its records stay in your database (and its payment records must stay for tax). To erase a closed clinic's records for good when it asks, remove them from the database yourself after it has its export.
You run the platform, so you are the one who decides where it runs and which providers it uses. Caremint gives you the controls; how you use them decides whether your clinics can meet their law.
33Security notes
What the server checks and limits, so you can answer your clinics' questions and know what to keep safe.
Clinics are kept apart
- The current clinic always comes from the signed-in session, never from the request. Every query is filtered by it, and links between a clinic's rows are composite database keys, so a row cannot point at another clinic's row even by mistake. Another clinic's id answers "not found".
- Roles and permissions are checked by the server on every request; the screens only hide what a role cannot use.
- The database refuses two appointments for one doctor at the same time, so no race can double-book.
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.
- The session cookie is HttpOnly, Secure on https and SameSite=Lax. A "keep me signed in" session is renewed while in use; any other ends with the browser session.
- Every change made with the session cookie must carry the header
x-caremint: 1, which browsers cannot add from another site, so other sites cannot make changes for a signed-in person. - Session tokens, password reset links, invites, portal sessions and sign-in codes are stored only as SHA-256 hashes.
- WhatsApp tokens, app secrets, each clinic's Stripe keys and the secrets saved in the super-admin 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. - Patients sign in to the portal with a 6-digit code (10 minutes, 5 tries) and never with a password; their booking and payment links carry long random tokens, and a pay link ends after 7 days.
- "Open as owner" needs the clinic owner's approval, lasts at most 30 minutes, is audit-logged and cannot reveal secrets, change plans or reach the super-admin.
Webhooks
- Meta: every WhatsApp webhook is checked against the
X-Hub-Signature-256signature over the raw body, with the app secret of the number's own app or your platform app; anything else is refused. Each delivery is stored once, so Meta's retries are never processed twice, and then handled by a background job. - Stripe: your platform webhook and each clinic's own webhook are checked against their signature and timestamp, each with its own secret, and every event is applied once.
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 5), 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 |
| Online bookings, per address | 20 per hour | Online bookings from one address (the public booking page) |
| Invites, per clinic | 50 per hour | Invites sent by one clinic |
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. Webhooks from Meta and Stripe are 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 16). The platform logo may be PNG, WebP or SVG; an SVG with scripts or event handlers is refused, and logos are served with a strict content policy.
- Files are private: only signed-in staff of the clinic, or the patient a file was shared with, can open them.
Money
- Plans switch on only from verified Stripe events; a clinic cannot give itself a plan. Patient payments count only from the clinic's signed Stripe webhook. Invoice totals are worked out on the server from the lines, never taken from the browser.
- Plan limits and AI drafts are checked on the server and spent with one conditional database update, so parallel requests cannot go past them.
- Payment and subscription records are never deleted with a clinic or a plan.
- The demo seed and reset commands touch only rows marked as demo and refuse to run on a database with real data (chapter 31).
What loads from other servers
The web app loads nothing from other servers: its fonts and icons are part of the build. The exceptions are chosen by the person using them: Quick sign-up loads Meta's Facebook JavaScript SDK from connect.facebook.net; a video visit opens the Jitsi Meet server (or the doctor's own meeting link); and Stripe Checkout and the Stripe portal open on Stripe's own pages.
Keep it safe
- Use https (chapter 5), long unique passwords and two-factor sign-in on your Meta, Stripe, email and server accounts.
- Keep
.envand your backups private; anyone withAPP_SECRETand a backup can read the saved tokens and keys. - Install Caremint updates; security fixes are marked as such in the changelog.
For developers
34Every key, explained
Every setting in .env. The outside-service keys can also be set in Super-admin → Settings, which takes precedence. This table is generated from .env.example and the server's own settings code when the release is built.
| Key | Required | What it does |
|---|---|---|
| Required | ||
APP_URL | Yes | The public address of the app, without a trailing slash, for example https://clinic.example.com. Links in emails and WhatsApp messages, the patients' links, the webhook addresses 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 tokens and keys and keys the hashed visitor addresses of the rate limits. Never change it after the install: saved tokens could no longer be read. |
POSTGRES_DB | No | The name of the database the stack creates. Default caremint. |
POSTGRES_USER | No | The database user the stack creates. Default caremint. |
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 (patient documents, imports, logos, signatures) | ||
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 caremint; 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. |
| WhatsApp (Meta WhatsApp Cloud API) | ||
META_APP_ID | For Embedded Signup | Your Meta app's ID (App Dashboard → App settings → Basic). Needed for Embedded Signup and the platform webhook (chapters 8 and 9). |
META_APP_SECRET | For Embedded Signup | Your Meta app's secret, from the same page. It checks the signature of every webhook Meta sends to your app. |
META_CONFIG_ID | For Embedded Signup | The configuration ID of your Embedded Signup setup (Facebook Login for Business → Configurations). |
META_VERIFY_TOKEN | For the webhook | Any random string. Paste the same value as the Verify token in the App Dashboard → Use cases → WhatsApp → Customize → Configure Webhooks (chapter 8, step 8). |
META_GRAPH_VERSION | No | The Graph API version Caremint calls. Empty: the version it was tested with (v27.0). |
| Payments (Stripe; empty = paid plans off) | ||
STRIPE_SECRET_KEY | For paid plans | Your own Stripe secret key, for selling plans to clinics (sk_live_…, or sk_test_… while testing). Empty: paid plans are off (chapter 11). Each clinic connects its own Stripe account for patient payments in the app (chapter 12). |
STRIPE_WEBHOOK_SECRET | For paid plans | The signing secret of your Stripe webhook endpoint (whsec_…), chapter 11. |
STRIPE_PUBLISHABLE_KEY | No | Your Stripe publishable key (pk_…). |
DEMO_PAYMENTS | No | "true" turns on test checkouts without a card: plan changes while no Stripe secret key is set, and patient payments for clinics without their own Stripe. Keep "false" on a live site. |
| 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 Caremint <hello@example.com>. Use an address on a domain your provider has verified. |
| Writing help for visit notes (optional; builtin = no AI, no cost) | ||
AI_PROVIDER | No | openai, anthropic, gemini or builtin (the default: the writing helper for visit notes is off, and nothing is sent to an AI provider). Chapter 14. |
OPENAI_API_KEY | With openai | Your OpenAI API key. |
OPENAI_MODEL | No | The OpenAI model. Default gpt-5-mini. |
ANTHROPIC_API_KEY | With anthropic | Your Anthropic API key. |
ANTHROPIC_MODEL | No | The Anthropic model. Default claude-sonnet-5-5. |
GEMINI_API_KEY | With gemini | Your Google Gemini API key. |
GEMINI_MODEL | No | The Gemini model. Default gemini-2.5-flash. |
| Video visits | ||
VIDEO_BASE_URL | No | The Jitsi Meet server for video visits, for example https://meet.example.com. Empty: the free public server https://meet.jit.si, where the first person in a room may be asked to sign in. Chapter 15. |
| 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 clinic.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 (chapter 5). |
| 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 Caremint folder (chapter 5, Two copies on one server). |
SEARCH_INDEXING | No | on (the default): search engines may index the public pages (landing, pricing, legal, sign-in and the clinics' booking pages), never the app, the API or a patient's own links. 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. |
RUST_LOG | No | How much the server logs: info (the default), warn or debug. |
| Set by Docker, or for development | ||
ANTHROPIC_BASE_URL | No | Another address for the Anthropic API. Default https://api.anthropic.com. |
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/caremint, built elsewhere; chapter 5). |
DEMO_MODE | No | Only for a public demo: true adds the sample clinics and one-click sign-ins, blocks everything that would reach the outside world and resets the data every night (chapter 31). Never on a live site. |
DRAIN_SECS | No | For your own zero-downtime deploys: seconds a stopping server keeps answering while the health check reports it is stopping. Default 0. |
GEMINI_BASE_URL | No | Another address for the Gemini API. |
LOCAL_STORAGE_DIR | Set by Docker | The folder for files with STORAGE_DRIVER=local (/app/storage in Docker, a volume). |
META_GRAPH_URL | No | For tests only: another address for Meta's Graph API. Default https://graph.facebook.com. |
OPENAI_BASE_URL | No | Another address for an OpenAI-compatible API. Default https://api.openai.com. |
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. |
WEB_DIST | Set by Docker | Where the built web app is, when it is not packed into the program. |
35File structure
caremint/
├── apps/
│ ├── backend/ the Rust server (Axum): crate caremint-server, program "caremint"
│ │ ├── src/main.rs the commands: serve, migrate, health, seed-demo, reset-demo, pack, export-assets
│ │ ├── src/lib.rs the HTTP app: /api/health, /api/v1, the web app, middleware
│ │ ├── src/api/ one module per area: auth, clinic, calendar, patients, care (visits and
│ │ │ prescriptions), money, messages, numbers, reports, overview, booking,
│ │ │ portal, billing, media, events, admin, public (install, webhooks)
│ │ ├── src/appointments.rs booking, the day's steps, moving and cancelling
│ │ ├── src/schedule.rs working hours, leave, blocked time and free times
│ │ ├── src/care.rs visits, signing, addenda, prescriptions and their PDF
│ │ ├── src/reminders.rs the reminder rules, the waiting list and unpaid holds
│ │ ├── src/messaging.rs WhatsApp and email to patients, and their answers
│ │ ├── src/invoices.rs invoices, desk payments, deposits and refunds
│ │ ├── src/clinic_pay.rs patient payments into each clinic's own Stripe
│ │ ├── src/billing.rs the clinics' plans: Stripe checkout, portal and webhooks
│ │ ├── src/ai.rs the writing helper for visit notes
│ │ ├── src/pdf.rs the PDF writer for prescriptions, invoices and receipts
│ │ ├── src/jobs.rs the background job queue (PostgreSQL, FOR UPDATE SKIP LOCKED)
│ │ ├── src/settings.rs super-admin settings over .env
│ │ ├── src/setup_check.rs the setup check rows and live tests
│ │ ├── src/demo.rs sample plans, demo data and the nightly reset
│ │ ├── assets/ the demo clinic's logo and the demo doctors' signatures
│ │ ├── tests/ server tests (need a PostgreSQL, see chapter 36)
│ │ └── 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
│ ├── src/pages/ clinic/, patient/ (booking, pay, portal), platform/ (super-admin),
│ │ auth/, install/, public/
│ ├── src/components/ui/ shadcn/ui components
│ ├── src/ui/ tables, sheets, charts, toasts shared by the pages
│ ├── src/layout/ the app shell, sidebar and sign-in guard
│ ├── 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
├── crates/wa/ WhatsApp Cloud API library and simulator (crate caremint-wa, with a README)
├── migrations/ the database schema (applied on start)
├── docker/ Dockerfile, docker-compose.yml, Caddyfile
├── compose.yaml "docker compose up" from this folder
├── Cargo.toml, Cargo.lock the Rust workspace
├── .env.example every setting
└── docs/ this guide (HTML and PDF) and the third-party licences
36Customise and rebuild
Run it for development
- Start a PostgreSQL (for example
docker compose up -d postgres, withports: ["127.0.0.1:5432:5432"]added to the postgres service, or your own) and setDATABASE_URLin.env. For development setSTORAGE_DRIVER=local. - Start the server from
apps/backend:cargo run(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.
Change the web app
apps/frontend/README.mdexplains the web app's stack, its scripts and folders, changing the brand and the production build.- Colours, fonts and sizes live in
apps/frontend/src/styles.cssas CSS variables (for example--brand). The brand colour set in Super-admin → Branding overrides--brandat run time, and each clinic's colour does the same inside that clinic. - Pages are in
apps/frontend/src/pages/, one folder per area;src/routes.tsmaps each URL to its file. The public landing and pricing pages aresrc/pages/public/Landing.tsxandPricing.tsx. - Components are shadcn/ui (
src/components/ui/) on the Base UI and Radix primitives, with Lucide icons. - Checks:
pnpm typecheck,pnpm lint(Biome),pnpm test(Vitest) andpnpm e2e(Playwright).
Change the server
- Each area of the API is one module in
apps/backend/src/api/; itsroutes()function lists the addresses. The business rules (booking, reminders, money, limits) are in the modules named after them;apps/backend/README.mdlists every module and what it does. - A database change is a new file in
migrations/namedYYYYMMDDHHMMSS_what.sql. Never edit a migration that has already run: the server checks them. - Checks:
cargo clippy --workspace --all-targets -- -D warningsandcargo test --workspace. The server tests need a PostgreSQL user that may create databases:TEST_DATABASE_URL=postgres://user:password@127.0.0.1:5432/postgres cargo test -p caremint-server --test api(each test gets a fresh database); without it they say so and pass.cargo deny checkchecks advisories and licences.
Worked example: add an API route
Say a clinic wants the number of a patient's visits that are still unsigned. In apps/backend/src/api/patients.rs, add the address to routes():
.route("/patients/{id}/unsigned-count", get(unsigned_count))
and the handler (add Care to the file's use crate::auth::{…} line). Taking Care makes it work only for staff who may open visit notes in the current clinic; the query filters by cx.id, so it can never read another clinic:
/// How many of a patient's visits are not signed yet.
async fn unsigned_count(
State(state): State<AppState>,
Care(cx): Care,
Path(id): Path<Uuid>,
) -> ApiResult<Json<Value>> {
let n: i64 = sqlx::query_scalar(
"select count(*) from visits where clinic_id = $1 and patient_id = $2 and signed_at is null",
)
.bind(cx.id)
.bind(id)
.fetch_one(&state.db)
.await?;
Ok(Json(json!({ "unsigned": n })))
}
In the web app, call it with the shared client, which adds the session and the security header:
import { get } from "@/api/client";
const { unsigned } = await get<{ unsigned: number }>(`/patients/${patientId}/unsigned-count`);
Then rebuild (below). Add a test next to the others in apps/backend/tests/api/.
Rebuild and deploy your changes
docker compose up -d --build # or with --profile https on your server
Docker rebuilds only what changed, and a change to the web app alone reuses the compiled server. Keep your changes in a Git repository, so you can compare them with each new Caremint version.
37API reference
The web app uses the /api/v1 API below; you can call it from your own tools with a signed-in session. These 221 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 (
…Cents). - Errors:
{"error": {"code": "…", "message": "…", "details": {…}}}. Codes:bad_request(400);unauthorized(401);plan_limit(402, with the limit, the use and the plan);forbidden,csrf,demo_locked,no_permission,no_clinic,read_only,impersonating,suspended,clinic_suspended,support_access_needed(403);not_found(404);conflict,time_taken,possible_duplicate,stale,has_appointments,booking_off,too_late,window_closed,no_number,not_ready,whatsapp,ai_credits(409);rate_limited(429);internal(500);unavailable,maintenance(503).time_takencarries the nearest free times indetails; WhatsApp refusals carry Meta's own code indetails.metaCode. - Lists:
?page=1&size=50(size up to 500) →{items, total, page, size}, withcountsfor the tabs where a page has them. - "Staff" means any member of the current clinic; "Notes", "Payments", "Settings" and "Reports" the staff whose role has that permission (chapter 17); "Owner" the clinic's owner; "Patient (portal)" a patient signed in to the portal; "The patient's link" the token in a patient's booking or payment link; "Super-admin (viewer reads)" lets the read-only viewer role read too.
- Live events:
GET /api/v1/eventsis a Server-Sent Events stream for the current clinic (appointments, visits, invoices, messages and notifications as they change, and apingevery 25 seconds).
| Method | Address | Who may call it | What it does |
|---|---|---|---|
| System | |||
GET | / | Anyone | 200 while serving, 503 while handing over to a new copy (the proxy then moves people) |
GET | / | Anyone | Open pages compare it with their own to offer a reload after a deploy |
GET | / | Anyone | See [web::robots_txt] |
| Public site, install and inbound webhooks | |||
GET | / | Anyone | The brand, sign-up mode, demo sign-ins and what the web app needs before sign-in |
GET | / | Anyone | The public plans for the pricing page |
GET | / | Anyone | One legal page |
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: the super-admin, brand and sample plans (runs once) |
GET | / | Meta (signed webhook) | Meta's webhook check: answers the challenge for the platform or a number's verify token |
POST | / | Meta (signed webhook) | A WhatsApp webhook delivery (signature checked, stored once, applied by a job) |
POST | / | Stripe (signed webhook) | A Stripe webhook event (signature checked, applied once) |
GET | / | Anyone | No sign-in (the name holds the file's hash), cached a year |
GET | / | Anyone | The uploaded brand logo (no sign-in; long cache, the name changes with the file) |
| Sign-in and account | |||
POST | / | Anyone | Creates an account and its first clinic (when sign-ups are open) |
POST | / | Anyone | Signs in with email and password (wrong passwords count down, then the account waits) |
POST | / | Signed in | Signs out of this browser |
GET | / | Signed in | The signed-in user, their clinics, role and capabilities |
GET | / | Anyone | { me } like /auth/me when signed in, { me: null } when not |
POST | / | Signed in | Makes another of the user's clinics the current one |
POST | / | Signed in | Creates another clinic owned by the user |
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) |
POST | / | Signed in | Ends an "open as owner" session and goes back to the super-admin's own |
GET | / | Anyone | What an invitation link is for (clinic, role, email) |
POST | / | Anyone | Accepts an invitation, signing in or creating the account |
PATCH | / | Signed in | Changes the user's name, email 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 the owner, a doctor, the front desk or the read-only super-admin (DEMO_MODE only) |
| Visits, notes and prescriptions | |||
GET | / | Notes | Visits in a date range (newest first), with the tab counts and my drafts left to sign |
GET | / | Notes | The list's visits (same filters, up to 10,000) as CSV |
POST | / | Notes | Starts (or reopens) the visit of an appointment |
GET | / | Notes | One visit's notes (opening them is written to the audit log) |
PUT | / | Notes | Saves the draft notes (409 stale when another tab saved first) |
POST | / | Notes | Signs the notes (doctors who see patients) |
POST | / | Notes | A dated note under signed notes |
POST | / | Notes | Writing help drafts the notes from bullet points (nothing is saved) |
GET | / | Notes | Whether writing help is on, and the credits left this month |
GET | / | Notes | Common ICD-10-CM codes by code or words |
GET | / | Notes | Prescriptions in a date range (newest first), with the tab counts |
POST | / | Notes | A new draft prescription (with allergy warnings) |
GET | / | Notes | The list's prescriptions (same filters, up to 10,000) as CSV |
GET | / | Notes | One prescription |
PUT | / | Notes | Replaces a draft's medicines |
POST | / | Notes | Signs it (it gets its check code) |
POST | / | Notes | Voids it (it stays on file, marked void) |
POST | / | Notes | Stops one medicine |
GET | / | Notes | The printable A4 prescription |
POST | / | Notes | Sends the signed PDF to the patient (WhatsApp document and/or email) |
GET | / | Anyone | A pharmacy checks a prescription by the code printed on it (no sign-in) |
| Clinic, staff and settings | |||
GET | / | Staff | The current clinic |
PATCH | / | Settings | The profile (name, address, colour, slug, time zone, currency), opening hours or settings |
DELETE | / | Owner | Deletes the clinic (owner only; type its name to confirm) |
POST | / | Settings | The clinic logo (multipart file: PNG, JPEG or WebP up to 1 MB), shown in the app, the booking page and on prescriptions and invoices |
DELETE | / | Settings | Removes the logo |
GET | / | Staff | The signed-in doctor's signature picture, for the profile page's preview |
POST | / | Staff | The signed-in doctor's signature, printed on their prescriptions (multipart file: PNG or JPEG up to 512 KB) |
DELETE | / | Staff | Prescriptions print without a signature picture again |
POST | / | Settings | Shows or removes the sample patients (the first-day overview) |
GET | / | Staff | The staff with their hours, services and leave, and open invitations |
GET | / | Staff | What each role can do in this clinic |
PUT | / | Owner | The owner changes what a role may do |
POST | / | Staff | A teammate refused a page asks the owner for access (a notification for the owner, at most once a day per person and page; sent is false when it was already asked today) |
POST | / | Settings | Invites someone by email with a role (a doctor counts towards the plan) |
POST | / | Settings | Sends an invitation again with a new link |
DELETE | / | Settings | Withdraws an invitation |
PATCH | / | Staff | Role, calendar column, title, hours, room, services, online booking |
DELETE | / | Settings | Removes someone from the staff (their past visits keep their name) |
POST | / | Settings | Time off (nobody can book that person then); says how many visits clash |
DELETE | / | Settings | Removes time off |
GET | / | Staff | The services (archived ones last) |
POST | / | Settings | A new service |
PATCH | / | Settings | Changes a service |
DELETE | / | Settings | Archives a service (past appointments keep it) |
GET | / | Staff | The branches and their rooms, each with what is on in it today |
POST | / | Settings | A new room in a branch (the main branch when none is given) |
PATCH | / | Settings | Renames or describes a room |
DELETE | / | Settings | Archives a room |
POST | / | Settings | Another branch (counts towards the plan) |
PATCH | / | Settings | Renames a branch or changes its address |
DELETE | / | Settings | Archives a branch and its rooms (never the main branch) |
GET | / | Settings | Who did or opened what (Privacy and data), newest first |
GET | / | Settings | The filtered log as CSV (the newest 50,000 rows) |
GET | / | Staff | My notifications (newest first) and how many are unread |
POST | / | Staff | Marks every notification read |
GET | / | Staff | My notification choices in this clinic |
PUT | / | Staff | Saves my choices (any part of { patientReplies: { email, browser }, … }) |
GET | / | Owner | The platform's requests to open this clinic (approved for 30 minutes at a time) |
POST | / | Owner | The owner approves (30 minutes) or denies a support request |
GET | / | Staff | ready first, then every change in the clinic, a ping every 25 s; a tab that fell behind gets refetch |
GET | / | Staff | What each role needs first thing: today's day, tomorrow's confirmations, money, messages to answer, unsigned notes, the first-day checklist and the plan's usage |
POST | / | Staff | Uploads a file for a message (type checked by content, size limits per kind) |
GET | / | Staff | A clinic file, to members of that clinic only |
| Calendar and appointments | |||
GET | / | Staff | The people, their hours, the appointments and blocked time of one day (or up to 7), and the counts the header shows |
GET | / | Staff | The free start times that day, per person |
GET | / | Staff | The list view by tab (today, upcoming, unconfirmed, cancelled, all), with filters, sorting, pages and the tab counts |
POST | / | Staff | Books an appointment (a taken time answers 409 time_taken with nearby free times) |
GET | / | Payments | The list's rows (same tab and filters, up to 10,000) as CSV, for the front desk |
GET | / | Staff | One appointment with the patient's card, its history and its messages |
PATCH | / | Staff | Moves an appointment (time or person; the patient is told) or changes its room, reason or note |
POST | / | Staff | Confirm, check in (or undo it), start, finish or mark a no-show |
POST | / | Staff | Cancels; the patient is told and the freed time goes to the waitlist |
POST | / | Staff | Sends the reminder now |
POST | / | Staff | Blocks time for one person (or the whole clinic) so nobody books it |
DELETE | / | Staff | Frees blocked time |
GET | / | Staff | Patients waiting for an earlier time |
POST | / | Staff | Puts a patient on the waitlist (a freed time is offered to them on WhatsApp) |
DELETE | / | Staff | Takes a patient off the waitlist |
| Patients | |||
GET | / | Staff | Search by name, number, phone or email; filter by tag, doctor or state |
POST | / | Staff | Adds a patient (409 possible_duplicate lists likely matches unless force) |
GET | / | Staff | The number the next new patient gets |
GET | / | Staff | The tags in use, most used first |
GET | / | Settings | Every patient as CSV (managers; written to the audit log) |
POST | / | Settings | Checks a CSV (multipart file, optional mapping JSON); nothing is saved yet |
GET | / | Settings | An import's state and counts |
GET | / | Settings | The rows that need a fix, as CSV |
POST | / | Settings | Imports the checked rows in the background |
POST | / | Settings | Removes an import's new records (within 24 hours) |
GET | / | Staff | The record with its appointments, and (for people who may see them) visits, prescriptions, invoices, files, notes and messages |
PATCH | / | Staff | Saves changes (409 possible_duplicate unless force) |
DELETE | / | Owner | The owner deletes a record; it is removed for good after 30 days |
POST | / | Owner | Brings back a deleted record (within its 30 days) |
POST | / | Settings | Hides a record from the lists (moved away, passed on); Restore brings it back |
POST | / | Staff | A staff note on the record (not a clinical note) |
POST | / | Staff | Files an uploaded file (from POST /media) on the record |
DELETE | / | Staff | Removes a file from the record |
POST | / | Staff | A WhatsApp answer, inside the 24 hours after the patient last wrote |
| Invoices and payments | |||
GET | / | Payments | Invoices in a date range (default: the last 30 days), the tab counts, the money totals and this month's figures |
POST | / | Payments | A new invoice for a patient (optionally for an appointment) |
GET | / | Payments | The list's invoices (same tab and filters, up to 10,000) as CSV |
GET | / | Staff | One invoice with its lines, payments, link and history |
PATCH | / | Payments | Discount, note, how it is paid, insurance claim number |
POST | / | Staff | Adds a line (a service brings its name and price) |
DELETE | / | Staff | Removes a line |
POST | / | Staff | A draft goes to the front desk to be paid |
POST | / | Payments | Cancels an invoice nobody has paid anything on |
POST | / | Payments | Records a payment at the desk (cash, card machine, bank, insurance) |
POST | / | Payments | Sends a payment link to the patient (WhatsApp, else email) |
GET | / | Staff | The invoice (or receipt, once paid) as a PDF |
POST | / | Payments | Sends the invoice PDF to the patient with the visit's documents |
GET | / | Payments | Payments taken in a date range (default: today), newest first |
POST | / | Payments | Refunds part or all of a payment (a card payment at the clinic's Stripe) |
GET | / | Settings | Whether the clinic's Stripe is connected, and its webhook address |
PUT | / | Settings | Saves the clinic's Stripe keys (checked with Stripe first) |
DELETE | / | Settings | Removes the clinic's Stripe keys |
GET | / | The patient's link | The payment page's data (no sign-in; the link is the key) |
POST | / | The patient's link | A fresh Stripe Checkout session for the link |
POST | / | The patient's link | The demo's test checkout (only when demo payments are on) |
POST | / | Stripe, the clinic's own account (signed webhook) | A clinic's Stripe event (checked with that clinic's secret) |
| Reminders, messages and WhatsApp | |||
GET | / | Staff | Every rule, the templates' review state, the number and this month's reminders |
PUT | / | Settings | Turns a rule on or off and sets its channel, time and email words |
POST | / | Settings | Sends Caremint's templates that are missing to Meta for review |
POST | / | Settings | Sends one template for review again (after a refusal) |
GET | / | Staff | The message log (default: the last 7 days), newest first, with the counts the tabs show |
POST | / | Staff | Marks a patient's message as looked after |
GET | / | Staff | The connected numbers with quality, limit and webhook counts |
POST | / | Settings | Connects a number by hand (phone number id, WABA id, token) |
POST | / | Settings | Connects a number from Embedded Signup (the code is exchanged for a token) |
GET | / | Staff | One number with its webhook address, verify token and health |
PATCH | / | Settings | Replaces a number's access token or app secret |
DELETE | / | Settings | Disconnects a number |
POST | / | Settings | Reads the number's quality and messaging limit from Meta again |
POST | / | Settings | Registers the number for sending with its two-step PIN |
GET | / | Staff | The number's WhatsApp business profile, read from Meta |
PATCH | / | Settings | Changes the business profile at Meta (only the fields sent): about, address, description, email, websites (two at most), vertical |
POST | / | Settings | A new profile picture (multipart file, JPEG or PNG, square, 5 MB at most) |
| Reports | |||
GET | / | Reports | The numbers for a date range (default: this month so far), with the same length of time before it for comparison |
GET | / | Reports | The range day by day as CSV (appointments, no-shows, money taken) |
| Online booking and the patient portal | |||
GET | / | Staff | Visits booked online this month against all bookings, and when each person who sees patients is next free online (their shortest online service, within two weeks) |
GET | / | Anyone | The clinic, its online services and the people who take online bookings (or, while online booking is off, the clinic and off: how to book instead) |
POST | / | Anyone | Books a time |
GET | / | Anyone | Free times for a service on a date |
GET | / | The patient's link | The patient's booking (and its video link for a video visit) |
GET | / | The patient's link | Free times to move to, with the same person and service |
POST | / | The patient's link | The patient confirms they are coming |
POST | / | The patient's link | The patient moves the visit to another free time |
POST | / | The patient's link | The patient cancels; the front desk is told and the time is offered to the waitlist |
GET | / | Anyone | The "Book online" button for a clinic's own website (<script src=".../api/v1/public/embed.js" data-clinic="your-slug"></script>) |
POST | / | Anyone | Sends a sign-in code (the answer never says whether someone is a patient) |
POST | / | Anyone | Checks the code and opens the portal (sets the portal cookie) |
POST | / | Anyone, public demo only | The public demo's one-click portal sign-in (Noah Patel at Lakeside) |
POST | / | Anyone | Ends the portal session |
GET | / | Patient (portal) | The patient, their clinic, upcoming and past visits, prescriptions, invoices and files |
GET | / | Anyone | { me } like /portal/me when a patient is signed in, { me: null } when not |
GET | / | Patient (portal) | One of the patient's signed prescriptions |
GET | / | Patient (portal) | One of the patient's invoices or receipts |
POST | / | Patient (portal) | A payment link for an unpaid invoice (the answer has its address) |
GET | / | Patient (portal) | One of the documents the clinic shared with the patient |
| Plan and billing | |||
GET | / | Owner | The plan, subscription, usage, invoices and card on file |
GET | / | Owner | The plans a clinic can pick |
POST | / | Owner | Starts a plan change (Stripe Checkout link, test checkout, or a switch to a free plan) |
POST | / | Owner | A Stripe customer portal link (owner only) |
POST | / | Owner | Cancels the paid plan at the end of the period (owner only) |
| Super-admin | |||
GET | / | Super-admin (viewer reads) | The platform dashboard: revenue, clinics, messages and what needs attention |
GET | / | Super-admin (viewer reads) | The clinic list (search, status, plan and number filters, sorting, paging) |
GET | / | Super-admin (viewer reads) | One clinic |
PATCH | / | Super-admin | Changes a clinic's plan or status (a suspended clinic sends nothing to patients) |
DELETE | / | Super-admin | Closes a clinic and cancels its paid subscriptions |
POST | / | Super-admin | Asks the clinic's owner to let support open the clinic |
POST | / | Super-admin | "Open as owner": a session as the clinic's owner while the owner's approval lasts (30 minutes at most) |
GET | / | Super-admin (viewer reads) | The user list (search, platform role, status) |
PATCH | / | Super-admin | Changes a user's platform role or status |
GET | / | Super-admin (viewer reads) | Every plan, archived ones too |
POST | / | Super-admin | Adds a plan |
POST | / | Super-admin | The "Found in Stripe" badge: reads a price id from Stripe |
PATCH | / | Super-admin | Changes a plan (prices, Stripe ids, limits, features) |
DELETE | / | Super-admin | Takes a plan off sale; its subscribers keep it |
POST | / | Super-admin | Puts an archived plan back on sale |
GET | / | Super-admin (viewer reads) | Every payment (filters, paging) |
GET | / | Super-admin (viewer reads) | Every subscription (filters, paging) |
GET | / | Super-admin (viewer reads) | The platform settings (secrets masked), server facts and storage stats |
POST | / | Super-admin | Makes a new webhook verify token for the platform Meta app and shows it once |
POST | / | Super-admin | The brand logo (PNG, SVG or WebP up to 1 MB, checked by content), served publicly as the logo and favicon |
PUT | / | Super-admin | Saves one settings section (secrets are sealed; an empty secret keeps .env) |
GET | / | Super-admin (viewer reads) | The platform emails with their built-in and saved wording, for the email editor |
GET | / | Super-admin (viewer reads) | The setup check rows |
POST | / | Super-admin | Tests one setup check row against the real service |
GET | / | Super-admin (viewer reads) | Background jobs (status and kind filters) with counts per status |
POST | / | Super-admin | Queues a failed job again |
POST | / | Super-admin | Removes the demo data (demo-marked rows only) |
38Database
PostgreSQL. The schema is in migrations/ and is applied by the server on start. Ids are UUIDs, times are UTC, money is in whole cents. Every clinic table carries clinic_id; payment and subscription rows are never deleted with their clinic. These 51 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: platform staff and clinic staff, with their super-admin role (none, admin or viewer) | primary key id; unique email (any case) | – |
sessions | Signed-in browsers (only a hash of the cookie is stored), including the super-admin's "open as owner" sessions | primary key id; unique token_hash | users, clinics |
password_resets | Password reset links (hashed, valid for one hour, used once) | primary key id; unique token_hash | users |
invites | Open invites to a clinic, with the role to join as | primary key id; unique token_hash; unique email (any case) per clinic, when accepted_at is null | clinics, users |
rate_limits | Fixed-window counters for sign-in, sign-up, reset and booking limits (keys hold a keyed hash, never a plain address) | primary key key | – |
| Clinics and staff | |||
clinics | The tenants: your customers' clinics, with their plan, trial, Stripe customer, time zone, booking page address, own Stripe keys (encrypted) and settings | primary key id; unique slug; unique stripe_customer_id | plans, users |
clinic_members | Who works in a clinic: their role (owner, clinic admin, doctor or receptionist), whether they see patients, working hours and online booking | primary key clinic_id + user_id | clinics, users, rooms |
clinic_counters | Running numbers per clinic: patients (CM-00001), invoices (INV-2026-00001), prescriptions (RX-2026-00001) | primary key clinic_id + kind + year | clinics |
branches | A clinic's locations, one of them the main branch | primary key id; unique per clinic, when is_main and archived_at is null | clinics |
rooms | Consulting rooms and video rooms in a branch | primary key id | clinics, branches |
services | What a clinic offers: length, price, deposit, video or in person, and whether it can be booked online | primary key id | clinics |
service_staff | Who offers each service | primary key service_id + user_id | services, clinic_members |
staff_leave | Leave and days off: never bookable online; bookings already in that time show as "to move" | primary key id | users, clinic_members |
audit_log | Every look at and change to a record, and every admin action | primary key id | clinics, users |
support_access | Support's requests to open a clinic; the clinic owner approves each one for 30 minutes | primary key id | clinics, users |
notifications | What staff see under the bell | primary key id | clinics, users |
notification_reads | Up to when each person has read their notifications | primary key clinic_id + user_id | clinics, users |
| Plans, billing and usage | |||
plans | The plans you sell, with prices, Stripe price IDs, trial days, limits and features | primary key id | – |
subscriptions | A clinic's paid plan from Stripe; a money row, so a clinic that has one can only be soft-deleted | primary key id; unique provider_ref | clinics, plans |
payments | Your invoices to clinics (plan payments) paid, failed or refunded; money rows, never deleted with their clinic | primary key id; unique number; unique provider_ref | clinics, plans |
stripe_events | Every Stripe event already applied (yours and each clinic's), so a repeated delivery changes nothing | primary key id | – |
usage_counters | Monthly appointments, WhatsApp reminders and AI note drafts used per clinic (calendar month, UTC) | primary key clinic_id + period_start | clinics |
email_notices | Platform emails sent once per clinic and period (plan limit reached, …), so a busy day sends one email | primary key clinic_id + kind + period | clinics |
| Platform | |||
platform_settings | Platform settings set from the super-admin (override .env) | primary key key | users |
jobs | The durable job queue (claimed with FOR UPDATE SKIP LOCKED) | primary key id; unique dedupe_key, when dedupe_key is not null and status in ('queued', 'running') | clinics |
| Patients | |||
patients | Patient records: details, contact consent, allergies, conditions, insurance, next of kin and tags; removed for good 30 days after the owner deletes one | primary key id; unique number per clinic | clinics, users, clinic_members |
patient_notes | Staff-only notes on a patient ("Prefers morning visits") | primary key id | users, patients |
patient_documents | Files on a patient's record (uploaded by staff or the patient), and whether they are shared in the portal | primary key id | users, patients, media, visits |
patient_imports | A CSV import: checked first (rows and problems kept here), then imported on "Import", undoable for 24 hours | primary key id | clinics, users |
media | Files in storage: patient documents, logos, signatures, imports, generated PDFs | primary key id | clinics, users |
| Calendar | |||
appointments | Visits in the calendar: patient, person, service, room, time, status, deposit and the patient's own link | primary key id; unique manage_token_hash | clinics, users, patients, clinic_members, services, rooms |
appointment_events | An appointment's history ("Booked on the online booking page", "Confirmed by tapping Confirm on WhatsApp") | primary key id | users, appointments |
time_blocks | Blocked time (admin time, a meeting) | primary key id | clinics, users, clinic_members |
waitlist | Patients who want an earlier time | primary key id | users, patients, services, clinic_members |
| Visits and prescriptions | |||
visits | A visit's vitals, notes in four parts, diagnoses (ICD-10) and follow-up; locked once the doctor signs | primary key id; unique appointment_id, when appointment_id is not null | clinics, users, patients, appointments, clinic_members |
visit_addenda | Dated notes added under signed visit notes | primary key id | users, visits |
prescriptions | Prescriptions: draft, signed with a check code, or void | primary key id; unique verify_code; unique number per clinic | clinics, users, patients, visits, clinic_members |
prescription_items | The medicines on a prescription, with dose, how often, how long, and when one was stopped | primary key id | users, prescriptions |
ai_events | Every use of the writing helper | primary key id | clinics, users |
| Invoices and patient payments | |||
invoices | Patients' invoices with totals worked out on the server, tax, discount and insurance claim | primary key id; unique number per clinic; unique visit_id, when visit_id is not null and status <> 'void' | clinics, users, patients, appointments, visits, clinic_members |
invoice_lines | The lines of an invoice | primary key id | users, invoices, services |
invoice_events | An invoice's history ("Payment link sent on WhatsApp", "Card declined by the bank") | primary key id | users, invoices |
clinic_payments | Payments from patients: at the desk (cash, card machine, bank, insurance) or online through the clinic's own Stripe, with refunds | primary key id; unique provider_ref | clinics, users, patients, invoices, appointments |
payment_links | A link the patient opens to pay (an invoice or a booking deposit) | primary key id; unique token_hash | clinics, users, invoices, appointments |
| Reminders and WhatsApp | |||
reminder_rules | One row per reminder kind and clinic (created with the clinic) | primary key id; unique kind per clinic | clinics |
messages | Every message the clinic sent or a patient wrote, on WhatsApp or by email (kept 12 months) | primary key id; unique wamid per clinic, when wamid is not null | clinics, users, patients, appointments, invoices, media |
templates | The local copy of the clinic's message templates at Meta | primary key id; unique waba_id + name + language per clinic | clinics, wa_numbers |
wa_numbers | Each clinic's WhatsApp number with its Meta IDs, encrypted token, quality rating and messaging limit | primary key id; unique phone_number_id; unique verify_token_hash; unique per clinic, when status <> 'disconnected' | clinics |
webhook_events | Raw deliveries from Meta, stored before any processing (dedupe on the body hash) | primary key id; unique body_sha256 | clinics |
| Patient portal | |||
portal_codes | A patient's sign-in to the portal: a 6-digit code by email or WhatsApp, 10 minutes, 5 tries | primary key id | patients |
portal_sessions | Signed-in patient portal browsers (only a hash of the cookie is stored), 30 days | primary key id; unique token_hash | patients |
Help
39Updating 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 Caremint 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. The dump holds patient records: store it encrypted and as privately as the live data, and run it every day (for example from cron).
Also keep a copy of .env (above all APP_SECRET, without which the saved tokens and keys cannot be read) and of your files: the minio-data Docker volume, your own bucket, or the app-storage volume. Restore a database backup into an empty database with docker compose exec -T postgres sh -c 'psql -U "$POSTGRES_USER" "$POSTGRES_DB"' < backup.sql, and try a restore on a test copy now and then.
Update
Upgrade in the same folder (unzip the new version over it as below; your .env stays). 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. Docker writes that name in lower case without dots or spaces (a folder Caremint-1.0.0 becomes caremint-100); docker volume ls shows it before _postgres-data.
- Back up as above.
- From the folder that holds
caremint/(not inside it), rununzip -o caremint-x.y.z.zipwith the new version's file name. The zip has a top-levelcaremint/folder, so it unpacks over your install; unzipping inside the install would makecaremint/caremint.-oreplaces the old files without asking about each one. Your.env,compose.override.yamlandprebuilt/are 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:
Copy the ones you need, with their comments, intocd caremint for k in $(grep -oE '^#? ?[A-Z][A-Z0-9_]*=' .env.example | tr -d '# ='); do grep -q "^$k=" .env || echo "$k"; done.env; a key you leave out keeps its default. - In the
caremintfolder, rundocker 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.
If you changed the code, compare your changes with the new version first. CHANGELOG.md lists what changed and marks security fixes.
40Troubleshooting
Reminders go by email instead of WhatsApp
- Reminders → WhatsApp: the clinic's number must be connected, and the template for that reminder Approved under Templates at Meta. A rejected template shows Meta's reason.
- The patient's record must have a mobile and WhatsApp ticked under what they agreed to.
- The plan's WhatsApp reminders for the month may be used up (Settings → Plan and billing).
- The message log shows each try: a failed WhatsApp shows Meta's reason in plain words and the email sent instead.
Patients' answers don't reach the calendar
- Super-admin → Setup check → WhatsApp webhook: press Test. It must show green, and "last event" should change when a patient answers.
- In the App Dashboard → Use cases → Connect with customers through WhatsApp → Customize → Configure Webhooks, check the callback URL (exactly
https://your-domain/api/v1/webhooks/whatsapp) and that themessagesfield is subscribed. Its Test link sends a sample to your server. - If real answers don't reach Caremint but Meta's Test link works, publish the app (App Dashboard → Publish), which needs a privacy policy URL. Meta promises unpublished apps only test webhooks.
- If the number belongs to another Meta app, that app needs the same webhook, with the number's own verify token, and its app secret must be entered on the number in Caremint. Without it the log shows
webhook refused: bad or missing signature. - Your server must answer on https with a valid certificate from the internet:
curl -I https://your-domain/api/healthfrom another computer. - On a test number, the patient's phone must be one of its five allow-listed recipients.
Meta's error codes
When Meta refuses a message, the message log shows the reason in plain words and keeps the code. The most common ones:
| Code | What it means | What to do |
|---|---|---|
| 131030 | The patient is not on the test number's allow list. | Add the phone under API Setup → To → Manage phone number list (at most five), or go live with a real number. |
| 100 (subcode 33) | "Object does not exist or missing permissions": usually the system user has the WhatsApp account instead of the Messaging account, or an ID is wrong. | In Business settings → System users → Assign assets, give the system user the Messaging account with full control, generate a new token and connect the number again with it. |
| 190 | The token expired or was revoked. | Use a system-user token with expiry "Never" (chapter 8, step 5) and connect the number again with it. |
| 131026 | The patient cannot receive the message (not on WhatsApp, an old app, or they blocked the clinic). | Nothing to fix on your side; the email goes instead where the rule allows it. |
| 131042 | A payment problem on the clinic's Messaging account. | The clinic adds or fixes the payment method in Business settings → Billing and payments. |
| 133010, 133006, 131045 | The number cannot send yet. | Choose Register for sending under Reminders → WhatsApp (chapter 8, step 11). For 133006, first verify the number again in WhatsApp Manager. |
| 132001 | The template does not exist in that language or is not approved yet. | Wait for Meta's review, or send it for review again under Templates at Meta. |
Every code Caremint knows, as the server groups them (generated from the code):
| Codes | Meaning | What Caremint does, and what you can do |
|---|---|---|
0, 190 | The access token expired, was revoked or is invalid | Marks the message failed and the number as Error, so the clinic reconnects it. The email copy goes out when the reminder rule allows it. Create a new permanent token (chapter 8, step 5) and replace it on the clinic's number (Reminders → WhatsApp). |
3, 10, 131005, 200–299 | The token lacks a permission, or the app was removed | Marks the message failed and the number as Error, so the clinic reconnects it. The email copy goes out when the reminder rule allows it. Give the system user the Messaging account with Everything and the app with Manage app, then create a new token with both WhatsApp permissions. |
4, 80007, 130429 | App, account or throughput rate limit | Tries again after the wait Meta asks for, then marks the message failed if it still cannot be sent. The email copy goes out when the reminder rule allows it. Nothing: it passes. Reminders are spread out by the job queue. |
131056 | Too many messages to the same user in a short time | Tries again after the wait Meta asks for, then marks the message failed if it still cannot be sent. The email copy goes out when the reminder rule allows it. Wait a little before messaging the same patient again. |
131048, 131064 | Sending limited because of low quality or misclassified templates | Marks the message failed and shows the code and Meta's reason in the message log. The email copy goes out when the reminder rule allows it. Check the number's quality rating in WhatsApp Manager. Reminders are utility messages, so this is rare. |
368, 131031, 130497 | The WhatsApp account is restricted or disabled by policy | Marks the message failed and shows the code and Meta's reason in the message log. The email copy goes out when the reminder rule allows it. Read the notice in WhatsApp Manager → Account quality, and appeal there if it is a mistake. |
131030 | Test number: the recipient is not one of its allow-listed phones | Marks the message failed and shows the code and Meta's reason in the message log. The email copy goes out when the reminder rule allows it. Add the phone to the test number's recipient list in the App Dashboard, or connect a real number. |
131047 | The 24-hour customer service window is closed | Marks the message failed and shows the code and Meta's reason in the message log. The email copy goes out when the reminder rule allows it. Nothing to fix: more than 24 hours after the patient's last message only an approved template can reach them, and every reminder is one. |
131026 | The recipient cannot receive the message (not on WhatsApp, old app, …) | Marks the message failed and shows the code and Meta's reason in the message log. The email copy goes out when the reminder rule allows it. Check the patient's mobile number. They may not use WhatsApp, or may have an old app. |
130403 | The business blocked this user | Marks the message failed and shows the code and Meta's reason in the message log. The email copy goes out when the reminder rule allows it. Unblock the patient in WhatsApp Manager if you want to message them again. |
131049 | Marketing message held back to protect user experience | Marks the message failed and shows the code and Meta's reason in the message log. The email copy goes out when the reminder rule allows it. Meta limits how many marketing messages each person receives. Caremint's templates are utility, so this is rare. |
131050 | The user stopped marketing messages from this business | Marks the message failed and shows the code and Meta's reason in the message log. The email copy goes out when the reminder rule allows it. The patient stopped marketing from this clinic in WhatsApp. Reminders are utility messages and still go. |
131062 | This message type cannot be sent to a business-scoped user ID: send to the phone | Marks the message failed and shows the code and Meta's reason in the message log. The email copy goes out when the reminder rule allows it. Add the patient's mobile number to their record. |
132001 | Template missing in that language or not approved | Marks the message failed and shows the code and Meta's reason in the message log. The email copy goes out when the reminder rule allows it. Press Sync now under Reminders → WhatsApp → Templates at Meta, and check that the template is approved. |
132015 | Template paused for low quality | Marks the message failed and shows the code and Meta's reason in the message log. The email copy goes out when the reminder rule allows it. Meta pauses a template with poor feedback for a few hours. It is used again once Meta lifts the pause. |
132016 | Template permanently disabled | Marks the message failed and shows the code and Meta's reason in the message log. The email copy goes out when the reminder rule allows it. Send the template for review again under Reminders → WhatsApp. |
132000, 132012, 132018 | Template parameters don't match the template | Marks the message failed and shows the code and Meta's reason in the message log. The email copy goes out when the reminder rule allows it. Rare: a reminder was missing a value (a doctor or a time). Check the appointment and send it again. |
132005, 132007, 131063 | Template content refused, too long once translated, or marketing disabled | Marks the message failed and shows the code and Meta's reason in the message log. The email copy goes out when the reminder rule allows it. Read Meta's reason under Reminders → WhatsApp → Templates at Meta, then send the template for review again. |
2388xxx | Template could not be created or edited | Marks the message failed and shows the code and Meta's reason in the message log. The email copy goes out when the reminder rule allows it. Read Meta's reason under Reminders → WhatsApp, then send the template for review again. |
132068, 132069 | The Flow is blocked or throttled | Marks the message failed and shows the code and Meta's reason in the message log. The email copy goes out when the reminder rule allows it. Caremint sends no WhatsApp Flows. If you added one yourself, check it in WhatsApp Manager. |
131051 | Unsupported message type | Marks the message failed and shows the code and Meta's reason in the message log. The email copy goes out when the reminder rule allows it. Rare: update Caremint. |
131052 | The user's media could not be downloaded | Marks the message failed and shows the code and Meta's reason in the message log. The email copy goes out when the reminder rule allows it. Ask the patient to send the file again, or upload it to their record. |
131053 | Our media could not be uploaded or fetched | Marks the message failed and shows the code and Meta's reason in the message log. The email copy goes out when the reminder rule allows it. Check storage in Super-admin → Setup check, and the file's type and size (chapter 16). |
33, 100, 131008, 131009, 131021, 135000 | A parameter is missing or invalid | Marks the message failed and shows the code and Meta's reason in the message log. The email copy goes out when the reminder rule allows it. Usually a wrong ID, or a token whose system user lacks the Messaging account: check the IDs on the number and the system user's assets (chapter 8). |
131059 | Template list cursor no longer valid | Marks the message failed and shows the code and Meta's reason in the message log. The email copy goes out when the reminder rule allows it. Nothing: press Sync now under Reminders → WhatsApp again. |
131045, 133006, 133010 | The business number is not registered with Cloud API | Marks the message failed and shows the code and Meta's reason in the message log. The email copy goes out when the reminder rule allows it. Choose Register for sending on the number under Reminders → WhatsApp (chapter 8, step 11). For 133006, verify the number again in WhatsApp Manager first. |
133000, 133005, 133008, 133009, 133015, 133016 | Register, deregister or two-step PIN failure | Marks the message failed and shows the code and Meta's reason in the message log. The email copy goes out when the reminder rule allows it. Check the number's two-step verification PIN in WhatsApp Manager, then connect it again. |
131042 | Payment method problem on the WhatsApp account | Marks the message failed and shows the code and Meta's reason in the message log. The email copy goes out when the reminder rule allows it. Add or fix the payment method on the Messaging account in Meta's Business settings. |
131057, 2494100 | Account or number in maintenance mode, e.g | Tries again after the wait Meta asks for, then marks the message failed if it still cannot be sent. The email copy goes out when the reminder rule allows it. Nothing: it passes. |
1, 2, 131000, 131016, 133004 | Temporary error or downtime on Meta's side | Tries again after the wait Meta asks for, then marks the message failed if it still cannot be sent. The email copy goes out when the reminder rule allows it. Nothing: it passes. If it lasts, check Meta's status page. |
| No code | The request never got an answer (connect error, timeout) | Tries again after the wait Meta asks for, then marks the message failed if it still cannot be sent. The email copy goes out when the reminder rule allows it. Check that the server can reach graph.facebook.com. |
| No code | The answer could not be read | Marks the message failed with the reason. The email copy goes out when the reminder rule allows it. Rare. If it keeps happening, update Caremint. |
| No code | Rejected before sending: the input breaks a WhatsApp rule | Marks the message failed with the reason. The email copy goes out when the reminder rule allows it. Rare: a reminder's text was too long or a variable was missing. Shorten the clinic's name or address. |
| Any other code | Anything else | Marks the message failed and shows the code and Meta's reason in the message log. The email copy goes out when the reminder rule allows it. Look the code up in Meta's list of WhatsApp error codes. |
A template was rejected
Templates at Meta shows Meta's reason. Meta sometimes rejects or re-categorises a template by itself; send it for review again, and if Meta keeps refusing, ask for a review of the decision in WhatsApp Manager. Until it is approved, that reminder goes by email.
Online payments don't switch on
Settings → Payments must show Connected, not Webhook missing: add the webhook in the clinic's Stripe account and paste its signing secret (chapter 12). The clinic's plan must also allow online payments. A payment that Stripe shows as paid but Caremint doesn't: check the webhook's deliveries in Stripe → Developers → Webhooks.
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" (it reads Install token: cm-install-… (open /install and paste it)). Or set INSTALL_TOKEN in .env and run docker compose up -d.
After an upgrade everything is empty
The install wizard appears again, or the clinics are gone, because the folder was moved or renamed: Docker names the stack and its database volume after the folder unless COMPOSE_PROJECT_NAME is set, so it started a new, empty one. Your data isn't lost; it's under the old name. docker volume ls shows it as <old name>_postgres-data. Stop the app with docker compose down, set COMPOSE_PROJECT_NAME in .env to the part before _postgres-data and run docker compose up -d again (chapter 39).
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 5).
Paid plans don't switch on
Setup check → Stripe webhook must be green. In Stripe → Developers → Webhooks, the endpoint must point to /api/v1/webhooks/stripe and list the events in chapter 11; Stripe shows every delivery and its answer there.
Emails don't arrive
Without SMTP, emails are written to docker compose logs app. With SMTP, press Send test email in the setup check; check the sender domain is verified with your provider.
The calendar doesn't update by itself
A proxy is buffering the live stream. With the bundled Caddy it works as is; with Nginx add proxy_buffering off; for /api/v1/events.
Times are an hour off
Each clinic's time zone is set under Settings → Clinic. Reminders, the calendar and the booking page all use it.
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 5).
41FAQ
Can I run it for one clinic only?
Yes. Install it, close sign-ups (Super-admin → Settings → Sign-ups), create your clinic and give it a plan by hand (Super-admin → Clinics → the clinic → Change the plan; Stripe is not charged). You then need only the Regular Licence, as long as you don't charge anyone for the software (chapter 44).
Do clinics need their own Meta and Stripe accounts?
For WhatsApp, each clinic needs its own WhatsApp Business Account, which Meta bills; with Quick sign-up Meta creates it in its own window. For online payments, each clinic connects its own Stripe account. Both are optional: without them, reminders go by email and payments are taken at the desk.
Does it work with the WhatsApp Business app or WhatsApp Web?
No. Caremint uses only Meta's official WhatsApp Cloud API. A number used in the WhatsApp or WhatsApp Business app has to be moved to the Cloud API first.
Is it HIPAA or GDPR compliant?
Caremint is built with the privacy controls those laws usually ask for, but compliance depends on how and where you run it and the agreements you sign; Caremint makes no compliance claim (chapter 32).
Does the AI diagnose patients?
No. The writing helper only rewrites the doctor's own bullet points into notes for the doctor to check, and it is off unless you add an AI key (chapter 14).
Can patients book without an account?
Yes. The booking page asks only for their details; the portal signs them in with a code sent to their phone or email.
Can I try it without Meta?
Yes: the live demo, or your own install with DEMO_MODE=true on a test copy, uses the built-in WhatsApp simulator. Real messages need Meta (chapter 8); Meta's free test number reaches five phones.
Do I need to know Rust?
No, not to install, rebrand or run it: Docker builds everything. Changing the screens needs React; changing server rules needs Rust (chapter 36).
Can I use another database or host it without Docker?
PostgreSQL 15 or newer is required. Without Docker, run the one caremint program behind your own HTTPS proxy (chapter 5). Managed PostgreSQL services work through DATABASE_URL.
Which licence do I need?
To charge clinics (sell plans), the Envato Extended Licence. See chapter 44.
42Credits and licences
Caremint 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, SHA-2) and mimalloc, all MIT or Apache 2.0.
- Web app: React, React Router, Vite, Tailwind CSS, shadcn/ui, Base UI, Radix UI, TanStack Query and Table, Sonner and React DayPicker, all MIT.
- Icons: Lucide (ISC licence), including the leaf in the Caremint logo.
- Fonts: Geist and JetBrains Mono, both under the SIL Open Font License 1.1, bundled through Fontsource and served by your own app. Prescriptions, invoices and receipts use the standard Helvetica that every PDF reader has, so no font file ships for them.
- Diagnosis codes: a list of common ICD-10-CM codes, published by the US National Center for Health Statistics and in the public domain.
- Video visits: Jitsi Meet (Apache 2.0) runs on the server you choose; Caremint only opens its rooms.
- 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 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.
| 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 | – |
| (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 |
| OFL-1.1 | – | 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 |
| MIT AND BSD-3-Clause | 1 | – |
| MIT-0 | – | 1 |
| Unlicense | – | 1 |
| Total | 320 | 305 |
Every licence above allows use in a commercial product. cargo deny check licenses checks the Rust crates against this list.
Images
Caremint ships no stock photos. The Caremint logo is the Lucide leaf on a coloured square; the demo clinic's logo is a simple drawing made for the demo; the demo doctors' signatures are text set in an open-licence handwriting font; and every image in this guide is a screenshot of the running app with made-up data.
43Changelog
1.0.0 (2026-11-25)
First release.
- Calendar: day and week views with a column per doctor, drag to move, click to book, walk-ins that join the
queue, blocked time and leave, rooms, a waiting list that is offered freed times, and clashes answered with the
nearest free times.
- Online booking: each clinic's own booking page and a button for its website; patients pick a service, a doctor
and a free time; deposits for chosen services; change and cancel online up to the clinic's cut-off; the phone
number shown when online booking is off.
- WhatsApp reminders: on the clinic's own number through Meta's official WhatsApp Cloud API, the day before and
2 hours before, with Confirm, Reschedule and I can't come buttons that update the calendar; booking and change
confirmations; email instead while no number is connected; message log and template status from Meta.
- Patients: records with allergies, conditions, insurance and next of kin, tags, documents, CSV import with
column matching and undo, CSV export, archive and delete after 30 days, and consent records for WhatsApp, email
and marketing.
- Visits: vitals, notes in four parts, ICD-10 diagnosis search, a writing helper that turns the doctor's bullet
points into notes (OpenAI, Anthropic or Google Gemini with your own key, or none), signing that locks the notes,
and dated notes added later.
- Prescriptions: a PDF on the clinic's letterhead with the doctor's signature, allergy warnings, and a check
code anyone can verify on a public page.
- Billing: invoices made from the visit, payment links by WhatsApp, deposits, cash and bank payments, refunds,
receipts as PDF, and payments straight to each clinic's own Stripe account.
- Patient portal and video visits: sign-in with a code, the next visit, prescriptions, bills to pay and shared
documents; a video waiting room with a camera and sound check (Jitsi Meet).
- Clinic settings: clinic details and colour, opening hours and holidays, letterhead and tax, staff with roles
and working hours, services and rooms, reports, privacy and data, and an audit log of every look and change.
- Billing for you: plans with limits and a free trial, Stripe Checkout and the customer portal, a read-only
clinic when a trial or plan ends, and a test checkout while Stripe is not set.
- Super-admin: revenue, clinics, people, plans, payments and subscriptions, platform settings that take
precedence over .env, branding, legal pages, maintenance mode, email wording, and a setup check that tests every
outside service live.
- Security: argon2id passwords, saved tokens encrypted at rest, CSRF protection, rate limits kept in the
database, signed webhooks checked, and every clinic row tied to its clinic so it can never point at another.
- Install and hosting: an install wizard, sample plans, a public demo mode with nightly reset, and one Docker
Compose stack (the app as one compiled Rust program, PostgreSQL, MinIO and optional HTTPS with Caddy).
- Settings (
.env.example): each later release lists the keys it adds here.
44Support and licence
Questions, bug reports and help with installation: use the Support tab on the item's page on the marketplace. Please include your Caremint version (shown in the account menu), how you host it, and what you see (a screenshot, or the lines from docker compose logs app). Never send us your .env, API keys, tokens, passwords or any patient data.
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, legal or compliance advice, or the setup and review of your accounts at Meta, Stripe and other outside services, which are handled by those companies.
The Regular Licence lets you use Caremint for one product whose end users are not charged, for example one clinic's own system. To charge clinics (sell plans or subscriptions), you need the Envato Extended Licence. One licence covers one platform (one brand on one installation). The licences page at codecanyon.net/licenses/standard explains both licences in full.
Caremint is not affiliated with, endorsed by or sponsored by Meta or WhatsApp.