Seerline Docs · 1.0.0 Also included as a PDF
Seerline · documentation · version 1.0.0

Install it, approve your first expert, take paid sessions

Seerline is a marketplace for live, paid advice that you run as your own business. People open the user app, pick an expert (an astrologer, a tarot reader, a coach, a lawyer, a tutor: categories are yours to set) and talk to them by chat, voice or video, paying by the minute from a wallet they top up by card. Experts take those sessions in the expert app and are paid their share. You run the whole platform from the admin panel on the web, next to a public website with your expert directory.

This guide is written for first-time installers. Every command is shown in full, every setting says where to find it, and every money rule is explained in plain words. Read Part 01 to get the server running, Part 02 to connect payments and calls, and Part 04 to build your two apps.

Part 01

Get started

Welcome

Thank you for choosing Seerline. This guide takes you from the download to a running platform with your first category, your first approved expert and your two apps on real phones.

What you get

  • The user app (Flutter, Android and iOS): sign in or sign up, optional birth details (name, date, time and place of birth, and a question) that are shared with an expert only inside a session the user chooses, a home page with categories, who is online now and top-rated experts, explore and search (category, language, price a minute, rating, online only), expert profiles with rates for chat, voice and video, reviews and working hours, favourites with "tell me when online", a request sheet that shows what will be held, a waiting room while the expert answers, live chat, voice and video sessions with a per-minute meter, a "2 minutes left" warning with a top-up inside the session, a summary with rating and review, a wallet with top-up packs, promo codes and every transaction, session history with receipts, refund requests, reports, notifications, settings and account deletion.
  • The expert app (the same codebase, a second flavour): sign up and apply (profile, categories, languages, skills, ID and certificate as photos or PDFs, proposed rates), the waiting and change-requested states, an online switch, today's earnings and minutes, incoming requests that ring with a countdown, the same chat, voice and video screens with the client's shared details, session history, earnings (pending, available, paid, with the commission shown), payout requests, rates within your limits, working hours, reviews with replies, profile, notifications and settings.
  • The admin panel (web): an overview, live sessions with force end, every session with its billing minute by minute, expert applications with their documents, experts (suspend, commission override, video on or off), users, categories, the wallet ledger with manual adjustments, top-ups with refunds to the card, refund requests, payouts, reports, reviews, promo codes, settings for every rule, staff roles, an audit log, a setup check and an install wizard.
  • The public website: a home page, the expert directory and public expert pages with "Open in the app", categories, a "become an expert" page, app download links, your legal pages and the page people come back to after paying.
  • The server: one Rust program that serves the API for both apps, the web pages, the Stripe webhook, the live updates and the background work, with PostgreSQL for data and S3-compatible storage for files. Voice and video run on your own LiveKit server, so no call provider bills you per minute.

How it fits together

Everything except the two apps runs on your server with one docker compose up -d: PostgreSQL, MinIO (file storage) and the Seerline program, plus Caddy for HTTPS and LiveKit for calls when you turn them on. The outside services (Stripe, Firebase, an email provider) use your own accounts, and each one is optional until you need it.

What is in the download

Folder or fileWhat it is
apps/backend/The server in Rust (Axum): the API, the billing engine, the background work and the built web pages, compiled into one program called seerline.
apps/frontend/The web app: the admin panel, the public website, sign-in and the install wizard (React, React Router, Vite, Tailwind CSS).
seerline_mobile_flutter/The two Flutter apps from one codebase, as the flavours user and expert.
migrations/The PostgreSQL schema, applied by the server when it starts.
docker/, compose.yamlThe Dockerfile, the Docker Compose stack, the Caddy HTTPS file and the LiveKit server (docker/livekit/).
.env.exampleEvery server setting with a comment. seerline_mobile_flutter/.env.example has the apps' settings.
tools/rename.mjsOne command that gives the apps and the web app your name, ids, link scheme, colour and icons.
docs/This guide as HTML and PDF, and the list of third-party licences.
README.md, CHANGELOG.md, LICENSE.txtThe short version of this guide, 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, including the billing races; web app tests in three browsers; Flutter widget and flow tests; and both apps driven on a phone against a running server) and integrated by us.
  • Documentation: Yes. Drafted with Claude by Anthropic and checked against the code and the running apps.
  • Graphics: Yes. The screen designs, the two app icons and the layouts of the preview images were made with Claude by Anthropic working in a design tool and in code. No image was made with an AI image generator: every screenshot in the documentation and the item's previews is a capture of the running apps, and the demo's expert photos are Pixabay photos shown on the demo only (not in the download).
  • Demo audio: Yes. The demo call partner's four short spoken greetings were made with the open Kokoro text-to-speech model. They are used on the demo only and are not in the download.
  • Demo text: Yes. The sample experts, clients, reviews and chat lines and the starter legal texts were written with Claude by Anthropic and edited by us. The starter legal texts are a starting point, not legal advice.

AI-powered features: No. Seerline has no AI features and calls no AI service. The experts are people.

Screenshots

The main screens of the two apps, the admin panel and the public website. More screenshots sit in the chapters that explain each screen.

The user app

Home: categories, online now and top-rated experts
Home: categories, online now and top-rated experts
An expert's profile with rates for chat, voice and video
An expert's profile with rates for chat, voice and video
The request: mode, rate and what is held
The request: mode, rate and what is held
The waiting room while the expert answers
The waiting room while the expert answers
A live chat with the per-minute meter
A live chat with the per-minute meter
A video session on your own LiveKit server
A video session on your own LiveKit server
"2 minutes left": top up and keep talking
"2 minutes left": top up and keep talking
The wallet: balance, held money and top-up packs
The wallet: balance, held money and top-up packs

The expert app

After applying: what was sent and what happens next
After applying: what was sent and what happens next
Today: the online switch, earnings and minutes
Today: the online switch, earnings and minutes
An incoming request with its countdown
An incoming request with its countdown
Earnings: pending, available and paid
Earnings: pending, available and paid

The admin panel

The overview: revenue, minutes, live sessions, online experts and what needs you
The overview: revenue, minutes, live sessions, online experts and what needs you
Live sessions, each with its meter and a force-end button
Live sessions, each with its meter and a force-end button
Expert applications with their documents
Expert applications with their documents
Payout requests: mark paid with a reference, or send back
Payout requests: mark paid with a reference, or send back

The website

The public home page
The public home page
A public expert page with "Open in the app"
A public expert page with "Open in the app"

Requirements

To run the server (recommended: Docker)

  • A 64-bit Linux server (or your own computer for testing) with Docker Engine 24 or newer and Docker Compose 2.20 or newer. Docker Desktop on macOS and Windows works for testing.
  • For the first build: 2 processor cores, 4 GB of memory (or 2 GB plus swap) and about 6 GB of free disk for Docker's build cache. The build compiles the server and the web app from source; docker builder prune frees the cache afterwards. A smaller server can run a build made elsewhere (chapter 8).
  • For a live platform: a domain name pointing at the server and ports 80 and 443 open, so the apps and Stripe can reach it over https://. For voice and video also 7881/tcp and 7882/udp (chapter 16).

To build the mobile apps

  • Flutter 3.35 or newer (stable channel, Dart 3.9 or newer).
  • Android: Android Studio with the Android SDK and Java 17. The apps target Android SDK 36 and run on Android 7.0 (SDK 24) and newer.
  • iOS: a Mac with Xcode and CocoaPods, and an Apple developer account to install on a phone or publish.

To build or change the server without Docker

  • Rust 1.90 or newer (stable), Node.js 24 with pnpm 11 (corepack enable), and PostgreSQL 15 or newer.

Accounts you need

AccountNeeded forRequired?
StripeWallet top-ups by card, and refunds to the cardYes, to take money. Without it, top-ups are off.
Apple Developer ProgramPublishing the iOS apps; push on iOSFor iOS
Google Play ConsolePublishing the Android appsFor Google Play
Firebase (Google)Push notifications to locked phonesOptional: without it the apps still update live while open
An email provider (SMTP)Password resets and expert decisionsOptional at first: emails are written to the server log until it is set
S3-compatible storageExpert documents, chat pictures, profile photosOptional: the bundled MinIO keeps files on your server
LiveKitVoice and video sessionsOptional: your own server needs no account; chat works without it

Third-party services and costs

Seerline itself has no running fee. The outside services below are run by other companies: each one has its own pricing, plans and terms, and you are responsible for any costs they charge. Check each provider's current pricing page before you go live; prices change.

ServiceWhat forWho pays and how
StripeCard top-ups, refunds to the cardStripe takes a fee on every successful card payment and may charge for refunds, disputes and currency conversion. You pay it from your Stripe balance. Stripe pricing
LiveKit (your own server)Voice and videoThe bundled LiveKit server is open source (Apache 2.0) and has no licence fee; you pay your server provider for the processor time and the bandwidth calls use (video uses roughly 1 to 2 Mbit/s per person). If you use LiveKit Cloud instead, LiveKit bills you by its own plans. LiveKit pricing
Firebase (Google)Push notificationsFirebase is a third-party service with its own pricing, and you are responsible for any Firebase costs. Cloud Messaging itself has no charge per message today. Firebase pricing
Email provider (SMTP)Password resets, expert decisions, staff invitesProviders such as Amazon SES, Postmark or Brevo charge per message or per month above a free allowance. Amazon SES pricing · Postmark pricing · Brevo pricing
File storageDocuments, chat pictures, photosThe bundled MinIO costs only your server's disk. Outside storage such as AWS S3 or Cloudflare R2 charges for space and requests (AWS also for downloads). AWS S3 pricing · Cloudflare R2 pricing
Server and domainRunning everythingAny provider that sells Linux servers (VPS) works, for example DigitalOcean or Hetzner Cloud; you pay them monthly. A domain name is a yearly fee at your registrar.
App storesPublishing the two appsApple charges a yearly developer fee (Apple Developer Program); Google Play charges a one-time registration fee (Google Play Console). Seerline does not sell through in-app purchase, so neither store takes a cut of top-ups (chapter 15).

All money that users pay goes to your Stripe account. Seerline never routes payments through anyone else.

Install in 10 minutes with Docker

On your own computer or a fresh server, in the unzipped seerline/ folder:

  1. Copy the settings file:
    cp .env.example .env
  2. Open .env in a text editor and set at least these four:
    APP_URL=http://localhost:8080          # your https:// address on a server
    APP_SECRET=                            # paste the output of: openssl rand -hex 32
    POSTGRES_PASSWORD=                     # a long password, letters and digits only
    S3_SECRET_ACCESS_KEY=                  # another password, at least 8 characters
    Leave DATABASE_URL empty: it is only for running the server without Docker. Keep DEMO_MODE="false" and DEMO_PAYMENTS="false".
  3. Start the stack (the first build takes several minutes):
    docker compose up -d --build
    This starts PostgreSQL, MinIO (file storage, with its bucket created by a one-off minio-init step) and the app. The app applies the database migrations when it starts.
  4. Find the install token in the app's log:
    docker compose logs app | grep -i "install token"
    It prints Install token: sl-install-… (open /install and paste it). Without INSTALL_TOKEN in .env, a new token is printed on every start until the install is finished.
  5. Open http://localhost:8080 (or your address). The first visit opens the install wizard (chapter 6).
Want to see it full of data first?

Load the sample platform (25 experts in six categories, about 1,900 users with their sessions minute by minute, wallets, reviews, refunds and payouts): docker compose exec app seerline seed-demo --confirm. Remove it later in Admin → Settings → Site & apps → Remove demo data (chapter 40).

Useful commands, all from the seerline/ folder: docker compose logs -f app shows what the app is doing; docker compose ps shows what runs; docker compose down stops everything (your data stays in Docker volumes).

Install wizard

The wizard runs once, on the first visit, and is locked afterwards. It has five steps:

  1. Database. Paste the install token from the log. The wizard checks the database, file storage and the server's address, and lists anything that must be fixed in red before you can go on.
  2. Admin account. Your name, email, a password (10 characters or more) and the platform name people see. This creates the first super admin and signs you in.
  3. Payments. Paste your Stripe publishable key, secret key and webhook signing secret; the step shows the webhook address to add in Stripe (chapter 10). You can skip it and add the keys later in Settings.
  4. Calls. Your LiveKit address, API key and API secret (chapter 16). Skip it to start with chat only.
  5. Finish. A summary of what is set and what is left, with links to the admin panel and the setup check.

Closing the tab after step 2 is safe: signing in again as that super admin picks the wizard up at Payments, as long as neither payments nor calls were saved.

Step 1: the install token and the server checks
Step 1: the install token and the server checks
Step 4: connect your LiveKit server for voice and video
Step 4: connect your LiveKit server for voice and video

Setup check

Admin → Setup check lists everything you set up, each with a plain status (green, amber or red), what was found and where to fix it. Run all checks tests each outside service for real: it connects to the database and storage, signs in to your SMTP server, reads your Stripe balance, asks LiveKit for its open rooms, asks Google to accept your Firebase service account (no message is sent), and calls the server's own health address through APP_URL. A row that needs a look has a button that opens the settings tab where it is fixed; the LiveKit, storage, email and push cards in Settings also have their own test button.

RowWhat it shows
DatabaseReachable, with the number of migrations applied.
File storageS3 bucket or local folder.
Email (SMTP)The sender and server, or "not set up" (emails then go to the app's log).
StripeKeys set, test or live mode.
Stripe webhookThe last event received from Stripe, or a warning when none has arrived yet.
App addressAPP_URL, and whether it is https.
Visitor addressesHow many proxies are trusted (TRUSTED_PROXY_HOPS, chapter 8).
Background jobsJobs that failed in the last 24 hours, or jobs waiting over 10 minutes. See jobs opens the list with Retry per job and Retry all.
InstallWhether the wizard has finished.
Admin accountsHow many active super admins there are.
Billing clockRed when a live session is more than 90 seconds late for its next minute: the minute loop is not running.
Earnings releaseWhen the next pending earnings become available.
Legal pagesPages still empty, or the expert agreement still the starting text.
App linksHow many of the four store links are set (the website hides a missing badge).
Voice and video callsYour LiveKit address, or "not set up: chat sessions work".
Push messagesYour Firebase project, or "off".
Setup check: each service with its status and where to fix it
Setup check: each service with its status and where to fix it

Put it online

For real sessions, Seerline must be reachable at a public https:// address: the two apps talk to it, Stripe sends its payment webhook to it and users come back to it after paying.

1. Pick a server (VPS)

SizeGood for
2 cores, 4 GB memory, 40 GB diskBuilding on the server and running the app, the database, file storage and LiveKit for a platform with dozens of experts and a few simultaneous video calls.
1 to 2 cores, 1 to 2 GB memoryRunning a build made on another computer (see "Build on another computer" below), chat-only or few calls.
4+ cores, 8+ GB memory, a fast networkMany video calls at once. Video is the heaviest part: LiveKit forwards each person's video to the other, so bandwidth grows with the number of live calls. You can also run LiveKit on a server of its own (chapter 16).

2. DNS

At your domain registrar, add an A record for the address you want (for example app for app.yourbrand.com) pointing at your server's IP address. Wait until ping app.yourbrand.com shows that IP.

3. Settings

In .env:

APP_URL=https://app.yourbrand.com
APP_DOMAIN=app.yourbrand.com
TRUSTED_PROXY_HOPS=1

4. Start with HTTPS (the bundled Caddy)

When nothing else on the server uses ports 80 and 443, the bundled Caddy does it all. Open both ports in your server's firewall, then:

docker compose --profile https up -d --build
# with voice and video as well:
docker compose --profile https --profile calls 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://app.yourbrand.com; the first visit takes a few seconds while the certificate is issued. Caddy passes the live update stream through unbuffered (flush_interval -1), replaces any X-Forwarded-For a visitor sends with the real address, and sends /livekit/… to the LiveKit server for calls.

Already running a proxy?

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 Seerline, 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. For calls, point /livekit/ at http://127.0.0.1:7880 (LIVEKIT_BIND), with WebSocket upgrades allowed.
  • In a Docker container (Traefik, Nginx Proxy Manager, an Nginx container): it cannot use 127.0.0.1, because inside a container that address is the container itself. Put the app (and LiveKit) on the proxy's Docker network instead, with a compose.override.yaml file next to compose.yaml. Docker Compose reads it by itself on every docker compose command. docker network ls shows the proxy's network name; the examples call it proxy.

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). The livekit part is only needed with --profile calls; it sends /livekit to LiveKit's signalling port without the prefix, as the bundled Caddy does.

# compose.override.yaml: Seerline 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
      - traefik.http.routers.seerline.rule=Host(`app.yourbrand.com`)
      - traefik.http.routers.seerline.entrypoints=websecure
      - traefik.http.routers.seerline.tls.certresolver=letsencrypt
      - traefik.http.services.seerline.loadbalancer.server.port=8080
  livekit:
    networks: [default, proxy]
    labels:
      - traefik.enable=true
      - traefik.docker.network=proxy
      - traefik.http.routers.seerline-livekit.rule=Host(`app.yourbrand.com`) && PathPrefix(`/livekit`)
      - traefik.http.routers.seerline-livekit.entrypoints=websecure
      - traefik.http.routers.seerline-livekit.tls.certresolver=letsencrypt
      - traefik.http.routers.seerline-livekit.middlewares=seerline-livekit-strip
      - traefik.http.middlewares.seerline-livekit-strip.stripprefix.prefixes=/livekit
      - traefik.http.services.seerline-livekit.loadbalancer.server.port=7880

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: Seerline on the network of an Nginx container
services:
  app:
    networks:
      default:
      proxy:
        aliases: [seerline]

networks:
  proxy:
    external: true
    name: proxy

Then send the traffic to http://seerline:8080. In Nginx:

location / {
    proxy_pass http://seerline: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
    proxy_read_timeout 1h;            # keep the live stream open
    client_max_body_size 21m;         # PDF documents go up to 20 MB
}

In Nginx Proxy Manager, add a Proxy Host with scheme http, forward hostname seerline and port 8080, turn on WebSockets support, request its SSL certificate, and paste the buffering, timeout and body-size lines into the Advanced tab. Keep TRUSTED_PROXY_HOPS=1: Traefik, Nginx and Nginx Proxy Manager each add one address, as the next section explains.

5. Visitor addresses and rate limits

Seerline limits sign-ins, sign-ups and password resets per visitor address, so nobody can guess passwords at speed. It reads the visitor's address from the X-Forwarded-For header only behind the number of proxies you trust, set with TRUSTED_PROXY_HOPS. A visitor can type any X-Forwarded-For they like, so trusting it without a proxy would let them make up a new address for every try.

Your setupSetting
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 (above)TRUSTED_PROXY_HOPS=1 and keep APP_BIND=127.0.0.1. Turn off response buffering so the live updates work.
A load balancer or CDN in front of your proxy (for example Cloudflare, then Caddy)TRUSTED_PROXY_HOPS=2: one hop for each proxy that adds an address. Never set a higher number than the proxies really in front of the app.
No proxy at all (app port open to the internet)TRUSTED_PROXY_HOPS=0 and APP_BIND=0.0.0.0. No header is trusted, the per-address limits are off and only the per-account limits apply. The apps and Stripe need HTTPS, so this suits only testing.

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 seerline folder (use --platform linux/arm64 for an ARM server)
docker build -f docker/Dockerfile --target pack -t seerline-pack --platform linux/amd64 .
docker create --name seerline-pack-copy seerline-pack
mkdir -p prebuilt
docker cp seerline-pack-copy:/seerline prebuilt/seerline
docker rm seerline-pack-copy

# copy prebuilt/seerline 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 --locked -p seerline-server
./target/release/seerline pack apps/frontend/dist/client ./seerline
# .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 ./seerline serve

Keep it running with a service manager such as systemd. The server applies the migrations when it starts; ./seerline migrate applies them on their own. For calls, run LiveKit from docker/livekit/ or use LiveKit Cloud.

Other hosts

  • Platforms that run a Docker image (most cloud container services): build the image with docker build -f docker/Dockerfile -t seerline ., give it a PostgreSQL 15+ database through DATABASE_URL, an S3 bucket through the S3_* keys (or STORAGE_DRIVER=local with a persistent volume at /app/storage), and set APP_URL, APP_SECRET and TRUSTED_PROXY_HOPS for the platform's own proxy. The app listens on port 8080. Calls need a LiveKit server with its media ports open, which most container platforms cannot give: use LiveKit Cloud or a separate VPS for it.
  • Managed PostgreSQL works through DATABASE_URL.
  • Shared web hosting (cPanel, PHP hosting) cannot run Seerline: it needs a server that runs Docker or a Linux program.

Two copies on one server

To run a staging copy next to the live one, unzip Seerline into a second folder and give each copy its own .env:

# .env of the live copy
COMPOSE_PROJECT_NAME=seerline
APP_PORT=8080
APP_URL=https://app.yourbrand.com

# .env of the staging copy
COMPOSE_PROJECT_NAME=seerline-staging
APP_PORT=8081
APP_URL=https://staging.yourbrand.com
SEARCH_INDEXING=off

COMPOSE_PROJECT_NAME keeps each copy's containers, database, files, network, image and build cache apart. Left empty, it is the folder's name, so two folders with the same name would share everything: always set it when you run two copies. Give each copy its own passwords and its own APP_SECRET. Only one copy can run the bundled Caddy (ports 80 and 443) and only one the bundled LiveKit (ports 7881 and 7882), so put both copies behind one proxy you run yourself and let them share one LiveKit server with the same keys. SEARCH_INDEXING=off keeps search engines away from the staging copy.

Several servers

One server is enough for most platforms. When you outgrow it, you can run several copies of the app behind one load balancer, all pointing at one PostgreSQL database. This chapter says what stays correct, and what you must share.

What stays correct with several copies

  • The minute loop. Every copy runs it every 2 seconds. Each pass locks a session's row with FOR UPDATE SKIP LOCKED: while one copy moves a session on, the others skip it for that pass. Each charged minute is also its own row with a unique (session, minute) key, and each wallet movement has its own unique key (minute:<session>:<n>, hold:…, release:…), so even two copies that reach the same minute can never charge it twice: the second insert finds the key and moves no money. The billing tests run two tickers at once to prove it.
  • Background jobs (the daily purge, hourly housekeeping, Stripe card details): a worker claims a job with FOR UPDATE SKIP LOCKED, so no job runs twice. The scheduled ones are queued with a key per hour or day (purge:2026-12-01), so however many copies queue them, each runs once. A job a dead worker left running is handed back after 10 minutes.
  • Earnings, top-ups and card refunds move on in single guarded updates (a pending earning becomes available in one statement; a top-up is credited under a unique ledger key; a card refund is claimed before it is sent, with an idempotency key at Stripe).
  • Live updates are published with PostgreSQL NOTIFY. Every copy listens, so a person's open app or page gets its events from whichever copy it is connected to. No sticky sessions are needed: sign-ins are kept in the database.
  • Settings saved on one copy reach the others at once (the same NOTIFY).
  • Sign-in, sign-up and reset limits are counted in PostgreSQL, so they hold across copies. The other per-person allowances are kept in each copy's memory, so with three copies a person can make up to three times as many calls a second.

What you must share or set

  • One database for all copies (DATABASE_URL).
  • Shared file storage: use S3-compatible storage (MinIO on its own server, AWS S3, Cloudflare R2). STORAGE_DRIVER=local keeps files on one machine and does not work with several.
  • The same .env on every copy, above all the same APP_SECRET (it decrypts saved keys) and the same APP_URL.
  • The install token: each copy makes its own token until the install is done. Set INSTALL_TOKEN in .env, or run the install wizard while only one copy runs.
  • One LiveKit server for all copies (the same LIVEKIT_* keys). Any copy can hand out call tokens and close rooms.

Database connections

Each copy opens up to 20 connections to PostgreSQL, plus 1 that listens for live updates. PostgreSQL allows 100 connections by default, so up to four copies fit; for more, raise max_connections or use a bigger managed database. Connect the app straight to PostgreSQL or through a pooler in session mode: a pooler in transaction mode breaks the live update listener and the prepared statements the server uses.

The load balancer

  • It must add the visitor's address to X-Forwarded-For; set TRUSTED_PROXY_HOPS to the number of proxies in front of the app (chapter 8).
  • It must not buffer responses: GET /api/v1/events is a live stream that stays open.
  • Health check: GET /api/health answers 200 while a copy serves and 503 while it is stopping. With DRAIN_SECS set to a few seconds, a stopping copy reports itself unhealthy first, so the balancer moves people to another copy before it exits.
  • JOB_WORKERS (default 4) sets how many job workers each copy runs.
Part 02

Money and calls

Wallet top-ups (Stripe)

Users put money in their wallet by card through Stripe Checkout, on your own Stripe account, and spend it minute by minute in sessions. Without Stripe keys, top-ups are off and the app says so.

Stripe costs

Stripe is a third-party service with its own pricing: it takes a fee on each card payment and may charge for refunds, disputes and currency conversion. You are responsible for any Stripe costs. See stripe.com/pricing for your country.

1. Keys

  1. Create or open your account at dashboard.stripe.com and finish its business verification so it may take live payments.
  2. Developers → API keys: copy the publishable key (pk_test_… or pk_live_…) and the secret key (sk_test_… or sk_live_…).
  3. Paste them in Admin → Settings → Payments & calls → Stripe payments (or in the install wizard). The secret key is stored encrypted and shown afterwards only as "set" with its last four characters. You can put them in .env instead (STRIPE_PUBLISHABLE_KEY, STRIPE_SECRET_KEY); a value saved in the admin wins over .env.

2. The webhook

Seerline credits a wallet only when Stripe confirms the payment, through a signed webhook (or the re-checks in chapter 38). The admin shows the exact address under "Webhook address".

  1. Stripe → Developers → Webhooks → Add endpoint. Endpoint URL: https://app.yourbrand.com/api/v1/webhooks/stripe (your APP_URL followed by /api/v1/webhooks/stripe).
  2. Select these events: checkout.session.completed, checkout.session.async_payment_succeeded, checkout.session.async_payment_failed, checkout.session.expired and payment_intent.payment_failed.
  3. Copy the endpoint's signing secret (whsec_…) into Settings → Payments & calls → Webhook signing secret (or STRIPE_WEBHOOK_SECRET).
  4. Make a test top-up. The "Webhook address" line then says "Receiving · last event …", and the setup check's Stripe webhook row turns green.

Every webhook is checked against its signature (a request more than 5 minutes old is refused), and each Stripe event is applied once: its id is stored before it is applied. If applying fails, the id is removed again and Stripe's next delivery applies it.

3. Test, then go live

  • With sk_test_… keys no real money moves. Pay with the test card 4242 4242 4242 4242, any future date and any CVC; 4000 0000 0000 0002 is declined.
  • To go live, switch the Stripe dashboard to live mode, copy the live keys, and add a second webhook endpoint in live mode with the same address and events: it has its own signing secret. Paste all three live values.
  • Keep DEMO_PAYMENTS="false" in .env. Set to "true", it replaces Stripe with a demo checkout page that credits wallets without any real payment: it is meant only for a public demo or a private test copy, never a live site.

4. How a top-up works

  1. In the wallet (or the "2 minutes left" card during a session) the user picks a pack or types an amount between the smallest and largest top-up (default $10 to $500), and optionally a promo code.
  2. The server writes a pending top-up (TU-…) and opens a Stripe Checkout page for it, valid for 31 minutes; the app opens it in the browser.
  3. The user pays on Stripe's own page. Card numbers never touch your server or the app.
  4. Stripe sends the user back to /pay/return on your website and calls the webhook. The webhook credits the wallet once, with the promo bonus if any. The app watches the top-up and updates the balance as soon as it is credited.
  5. A background job then reads the card's brand and last four digits from Stripe for the receipt and the admin.

5. Other payment settings

  • Currency: Settings → Platform & billing → Currency, one 3-letter code per install (default USD). Every price is in whole cents of it. Pick a currency your Stripe account can charge.
  • Top-up packs and limits: Settings → Platform & billing → Wallet: the pack buttons (up to eight), the smallest and the largest top-up.
  • Statement name: Settings → Payments & calls: up to 22 letters, digits and spaces (at least one letter) that Stripe adds to what users see on their card statement, after your Stripe account's prefix and an asterisk ("YOURBRAND* SEERLINE"). When you save, Seerline asks Stripe for that prefix and refuses a name that would not fit in 22 characters in all. Empty shows only your Stripe account's own name.
  • Refund unspent money to card: on by default; it allows staff to send unspent top-up money back to the card (chapter 12).
Settings → Payments &amp; calls: Stripe keys, the webhook address and its last event, card refunds, and LiveKit
Settings → Payments & calls: Stripe keys, the webhook address and its last event, card refunds, and LiveKit

The billing engine

How a paid session is charged, minute by minute, from the request to the expert's payout, and what happens on every failure path. All amounts are whole cents; the defaults below are settings you can change (chapter 33).

The happy path, step by step

  1. Request. The user picks chat, voice or video on an expert's profile. The server checks, in one transaction: the expert is approved, online and offers that mode; neither person is blocked by the other; neither the user nor the expert has another open request or session; and the user's available balance covers the rate × hold at request minutes (default 5). That amount moves from available to held in one guarded update. The rate and the commission are copied onto the session, so later changes never touch it. The expert's other incoming requests are refused with "busy".
  2. Ring. The expert's app rings (a live event, and a push when Firebase is set up) with a countdown of the answer window (default 60 seconds). The user waits in the waiting room, which sends a heartbeat every 10 seconds.
  3. Accept. The expert accepts within the window. If the user's waiting-room heartbeat is fresh (less than 30 seconds old), the session starts at once.
  4. Minute 1 is charged at the start. Every minute is charged when it starts, so the expert is never short for time already given.
  5. Heartbeats. While the session is open, both apps send a heartbeat every 10 seconds. A minute is charged only while both heartbeats are fresh.
  6. Each minute. The minute loop runs every 2 seconds on the server. For every minute whose start has come, it writes one session_minutes row (unique per session and minute) and takes the rate: first from what is still held, then from the available balance with a guarded update that never lets it go below zero. The minute is split into the platform's commission, rounded half up to the cent, and the expert's share, which is the rest; the two always add up to the rate.
  7. Low balance. When the held money plus the wallet pays for only the low-balance warning minutes (default 2), the meter shows "2 minutes left" with Add $10 and Other amount (the session keeps going while they pay), and they get a push if that push kind is on. The apps read the number from Settings, so it follows your choice.
  8. Top-up during the session. The user can top up from that card without hanging up. The top-up opens Stripe Checkout in the browser; the session keeps running.
  9. Credited. When Stripe's webhook confirms the payment, the wallet is credited, and the next minutes are paid from it.
  10. End. Either person ends the session. The minute in progress was already charged at its start and is not charged again.
  11. Automatic end. The session also ends by itself when the money for the next minute is not there (balance), or when one side has been gone longer than the reconnect grace (disconnect, below).
  12. Release. Whatever is still held goes back to the user's available balance at the end, under its own key, once.
  13. Earnings. The expert's share of the whole session becomes one pending earning. It becomes available after the refund window (default 3 days after the session ended), the time in which the user may ask for a refund.
  14. Payout. From available earnings the expert asks for a payout of at least the payout minimum (default $50); you send the money and mark it paid (chapter 13).

A worked example

Voice at $1.80 a minute, 30% commission. The request holds 5 × $1.80 = $9.00. Each minute: commission round(180 × 3000 / 10000) = 54 cents, expert 126 cents. Minutes 1 to 5 come from the hold; from minute 6 they come from the wallet. After 14 minutes the user ends it: charged $25.20, commission $7.56, the expert's pending earning $17.64, nothing left held.

Every failure path

What happensWhat the engine doesMoney
Not enough money for the holdThe request is refused with 402 insufficient_balance, with how much is missing; the app offers a top-up first.Nothing moves.
The expert is in another session, or the user has one open409 expert_busy or 409 session_open. Two requests sent at the same moment are stopped by a unique index in the database, not only by a check.Nothing moves.
The expert is offline, does not offer the mode, or you switched voice or video off409 expert_offline, 422 mode_not_offered or 422 mode_off.Nothing moves.
The expert declinesEnds as declined; the user sees it at once.The whole hold returns.
Nobody answers within the answer windowEnds as timeout. The expert is taken offline and told "Missed request", so the next user does not wait in vain.The whole hold returns.
The user cancels while waitingEnds as cancelled.The whole hold returns.
The expert goes offline while a request waitsEnds as expert_offline.The whole hold returns.
Accepted, but the user left the waiting roomThe session stays accepted and starts when both heartbeats are fresh. If that does not happen within the reconnect grace, it ends as disconnect.Nothing charged; the hold returns.
One side loses the connection mid-sessionWhen a heartbeat is more than 30 seconds old, billing pauses (status reconnecting, both apps show it). Back within the reconnect grace (default 120 seconds): the session goes on and the next minute moves later by the paused time, so the pause is not billed. Not back in time: it ends as disconnect.Minutes already charged stay; the rest of the hold returns.
The money runs outThe minute that cannot be paid is not written; the session ends as balance. The "minutes left" warning came before.Nothing charged for the unpaid minute.
Staff end itAdmin → Live sessions → Force end (it asks first); ends as admin.Charged minutes stay (refund them separately); the hold returns.
The top-up during a session fails or the card is declinedThe top-up is marked failed with the bank's words; the session goes on until the existing money runs out.Nothing credited.
Stripe's webhook is lateThe app keeps asking about the top-up, and each ask re-checks it with Stripe (chapter 38).Credited once, whichever way it arrives first.
Two server copies, or a retry, reach the same minuteThe unique (session, minute) key and the wallet movement's unique key let only one through (chapter 9).Charged once.
The server restartsEverything is in the database. The next pass of the minute loop picks each session up where it stood; heartbeats that went stale meanwhile pause billing as above.Each started minute charged once.
The user asks for money back laterA refund request within the refund window (chapter 12).Back to the wallet; the expert's pending share shrinks.
Tested

The rules above are covered by the server's tests in apps/backend/src/billing.rs (commission rounding for every rate and percentage, the hold with free minutes, heartbeat freshness) and apps/backend/tests/api/billing.rs, races.rs and money.rs (requests, accepts, minutes, pauses, ends, races between tickers, refunds and payouts against a real PostgreSQL). See chapter 43.

Admin → Sessions → a session: every billed minute with what it cost, where it came from and the split
Admin → Sessions → a session: every billed minute with what it cost, where it came from and the split

Refunds and money back to the card

Seerline has two kinds of money back. A session refund puts money back in the user's wallet. A card refund sends unspent top-up money back to the card it came from, through Stripe.

Session refunds (to the wallet)

  1. The user asks from the session's receipt in the app, within the refund window (default 3 days after the session ended): a reason, then all of what is left, a part of it, or a range of billed minutes, plus an optional note. One open request per session.
  2. You decide in Admin → Refunds: approve all, approve a part (never more than what was charged minus what was already refunded), or reject with a note the user sees.
  3. On approval, in one transaction under the request's and the session's row locks: the request is decided once, the wallet is credited once (its ledger key is refund:<request>), and the expert's pending earning shrinks by the expert's share of the refunded part, rounded half up. If the expert's earning is already available (the window has passed), the platform absorbs the refund and the expert keeps their share.
  4. The user gets a notification (and a push if that kind is on).

Staff can also give back billed minutes nobody asked about: on a session's page, Refund minutes (from minute, to minute), with the same split. Deciding a report with "refund" does the same (chapter 32).

Card refunds (unspent top-up money)

  • Admin → Top-ups → a paid top-up → Refund to card. At most the part of that top-up not refunded before, and at most what the user still has available in the wallet.
  • The refund is claimed first: the wallet goes down and a claim row is written in one transaction. Then it is sent to Stripe with the claim's own idempotency key. If Stripe refuses, the claim is undone and the money goes back to the wallet; if Stripe does not answer, the minute loop sends it again after 2 minutes with the same key, so it can never be refunded twice.
  • Settings → Payments & calls → Refund unspent money to card switches this button off for staff.
  • When a user deletes their account, the unspent top-up money goes back to their cards by itself, newest top-up first. Promo bonuses and manual credits cannot go to a card and are lost; the app warns before deleting.

Manual adjustments

Admin → Ledger → Manual adjustment: add to or take from a user's available balance with a reason (goodwill, correction, refund, promo, other) and a note the user sees with the entry. A debit never takes the balance below zero. Every adjustment is in the ledger and the audit log.

Refund costs

Stripe has its own pricing for refunds: it does not return its original card fee on a refunded payment in most countries, and disputes carry their own fee. You are responsible for these Stripe costs.

A refund request: the session, what was asked, the decision and what happens to the expert's share
A refund request: the session, what was asked, the decision and what happens to the expert's share

Commission, earnings and payouts

Commission

  • Settings → Platform & billing → Commission: the platform's share of each billed minute (default 30%). The expert keeps the rest.
  • Per expert: Admin → Experts → an expert → Commission → Custom commission, with an optional Until date. While it runs it replaces the platform's percentage for that expert.
  • A new commission applies to sessions that start after it is saved. Each session keeps the commission it started with.
  • Per minute: commission = round(rate × percentage), half up to the cent; the expert's share = rate − commission. So $1.99 at 30% is 60 cents to the platform and $1.39 to the expert.

Earnings

When a session ends, the expert's share becomes one earning, pending until the refund window ends (Settings → Platform & billing → Earnings and refunds, default 3 days), then available. The minute loop moves due earnings every 2 seconds, rows and balances together, and the expert hears how much they can now pay out. The expert app shows pending, available and paid, with the commission of each session.

Payouts

  1. In the expert app, the expert saves where they want the money (a label such as "Bank" and the details as they type them), then asks for a payout of at least the payout minimum (default $50) from their available balance. The amount leaves "available" at once, in one guarded update. One open payout request per expert.
  2. In Admin → Payouts, open the request. Send the money yourself, outside Seerline (a bank transfer, PayPal or whatever you agreed with your experts).
  3. Mark it paid with the transfer's reference and the day it was sent. The expert gets a notification with the reference.
  4. Or send it back with a note (for example wrong bank details): the money returns to the expert's available balance.
Payouts are manual

Seerline does not move payout money by itself and does not use Stripe Connect. You pay experts with your own bank or payment service, which has its own pricing; you are responsible for those transfer costs.

A payout request: the expert's details, the checks, the bank reference and Send back
A payout request: the expert's details, the checks, the bank reference and Send back

Free first session and promo codes

Free first session

Settings → Platform & billing → Sessions → Free first session (off by default) with Free minutes (default 5).

  • A new user's first session that starts gets its first free minutes at no cost to them. The request holds only the rate × (hold minutes − free minutes), so a new user with an empty wallet can still start; after the free minutes the session needs money like any other, or ends on balance.
  • The expert is paid as usual for the free minutes; the platform records what they cost it on the session.
  • It is used once per account: when a session that had billed minutes ends. A declined or timed-out request does not use it up.

Promo codes

Admin → Promo codes → New promo code. A promo code adds a bonus to a paid top-up.

FieldWhat it does
CodeLetters and numbers, no spaces; users type it on the top-up screen.
BonusA percentage of the top-up, or a fixed amount.
Biggest bonus per useA cap on a percentage bonus.
Minimum top-upSmaller top-ups get no bonus.
Starts, EndsWhen the code works (empty = now, and no end).
Total uses, Uses per personLimits across everyone and per user.
Allow with the free first sessionOff: a new user can use the code only after their free first session.
First top-up onlyOnly a person's first paid top-up gets it.
Show a banner in the user appWhile the code runs, the user app's Home shows it as a banner: the description you typed (or the bonus in words, such as "+10% on top-ups") with Copy code and Top up, which opens the top-up with the code applied. When several codes have a banner, the newest running one shows. Switch it later from the code's row: Show a banner / Hide the banner.

The offer notice. When a code starts running (created to run now, resumed, or when its start time comes), every active user who wants offers gets one notification about it, once per code: an in-app notice, and a push when Settings → Push, email & legal → Push → Promos is on and the user has not turned offers off in the app. Tapping it opens the top-up with the code applied. Pausing and resuming a code never sends it twice.

The code is checked when the top-up starts, so the app shows the bonus, and applied when the payment settles: under the code's row lock its limits are checked again, the redemption is written once per top-up and the bonus credited once. You can pause and resume a code; a code nobody used can be deleted. A bonus is wallet credit: it cannot be refunded to a card.

Apple and Google payment rules

Why the apps take top-ups through Stripe and not through Apple's or Google's in-app purchase, and what keeps it that way.

Apple (App Store Review Guideline 3.1.3(d))

Apple's guideline 3.1.3(d), "Person-to-Person Services", says that an app enabling the purchase of real-time person-to-person services between two individuals (its examples are tutoring, medical consultations, real estate tours and fitness training) may use purchase methods other than in-app purchase. One-to-few and one-to-many real-time services must use in-app purchase. Apple has also said that asynchronous services (a question answered later) are not real-time. Read the guideline: App Store Review Guidelines, 3.1.3(d).

Seerline is built to fit that rule:

  • Every paid session is live and one-to-one: one user and one expert, by chat, voice or video, billed by the minute only while both are connected (both heartbeats fresh).
  • The wallet can be spent only on those live sessions. There are no paid questions answered later, no group or broadcast sessions, and no digital goods, subscriptions or unlocks for sale.
  • Top-ups go through Stripe Checkout on Stripe's own page, on your account.
Keep it that way

If you add anything users pay for that is not a live one-to-one session (recorded readings, written reports, horoscopes for sale, group classes, gifts, a subscription), Apple will require in-app purchase for it. Write your App Review notes so the reviewer sees that sessions are live between two people; a demo account for a user and one for an expert helps.

Google Play

Google Play's Payments policy requires Google Play's billing for digital goods and services used inside the app, and lists cases where it is not required. Live one-to-one services with a real person are commonly paid outside Play billing, but Google decides for each app: read the Google Play Payments policy before you publish, and describe the live sessions in your store listing and review notes.

Neither store takes a share of Stripe top-ups. Store rules change: check them again before each submission.

Voice and video calls (LiveKit on your own server)

Voice and video sessions run on LiveKit, an open-source media server (Apache 2.0) that you run next to Seerline. No call provider bills you per minute. Chat sessions work without it.

Calls cost bandwidth

The bundled LiveKit server has no licence fee, but your server provider has its own pricing for processor time and traffic, and you are responsible for those costs. Video uses roughly 1 to 2 Mbit/s per person in each direction, voice far less. If you use LiveKit Cloud instead, it bills you under its own plans: livekit.io/pricing.

How calls work

  • Each session has its own room, named after the session id, for at most 2 people.
  • Only the session's user and expert can get a join token, and only while the session is accepted or live. A token works for 10 minutes and says what each may send: nothing for chat, the microphone for voice, the microphone and camera for video. The apps ask for a new token when they rejoin.
  • When the session ends, the server deletes the room, which disconnects anyone still in it. Calls are never recorded.
  • The apps reach LiveKit's signalling through your HTTPS address (wss://app.yourbrand.com/livekit) and send audio and video straight to the LiveKit server on 7881/tcp and 7882/udp.

1. Choose the keys

The API key and secret are any long random strings you choose; LiveKit and Seerline use the same pair. In .env:

LIVEKIT_API_KEY=                  # e.g. the output of: openssl rand -hex 12
LIVEKIT_API_SECRET=               # e.g. the output of: openssl rand -hex 24
LIVEKIT_URL=wss://app.yourbrand.com/livekit   # ws://localhost:7880 on your own computer
LIVEKIT_API_URL=http://livekit:7880           # where the server closes rooms (the bundled LiveKit)

2. Start it

docker compose --profile https --profile calls up -d

The calls profile adds the livekit service from docker/livekit/. Its signalling port 7880 is open on the server itself only (LIVEKIT_BIND=127.0.0.1); the bundled Caddy sends /livekit/… to it. The service is limited to 2 processor cores and 1 GB of memory; change cpus and mem_limit in docker/livekit/docker-compose.yml for a bigger server.

3. Open the media ports

In your server's firewall (and your provider's cloud firewall, if it has one), allow 7881/tcp and 7882/udp from anywhere. Example with ufw: ufw allow 7881/tcp and ufw allow 7882/udp. LiveKit finds the server's public address by itself (use_external_ip: true in docker/livekit/livekit.yaml); on a private network set node_ip there instead.

4. Connect Seerline

Restart the app (docker compose up -d) so it reads the keys, or paste them in Admin → Settings → Payments & calls → LiveKit calls and press Test the connection. The setup check's "Voice and video calls" row turns green. Then make a voice call between the two apps on two real phones.

Strict networks (TURN)

Some office, hotel and mobile networks block UDP and unusual ports. LiveKit then falls back to 7881/tcp. For networks that allow only HTTPS, LiveKit has a built-in TURN server that can carry media over TLS on port 443 or another port. Turn it on in docker/livekit/livekit.yaml with a domain of its own that points at the server:

turn:
  enabled: true
  domain: turn.yourbrand.com
  tls_port: 5349          # open 5349/tcp, or use 443 if nothing else on the server uses it
  udp_port: 3478          # open 3478/udp
  cert_file: /certs/turn.crt
  key_file: /certs/turn.key

Mount the certificate files into the livekit service, publish the TURN ports in docker/livekit/docker-compose.yml, and open them in the firewall. If a proxy in front already ends TLS for that domain, use external_tls: true instead of the certificate files. LiveKit's own guide explains every option: docs.livekit.io, self-hosting.

LiveKit on its own server, or LiveKit Cloud

  • Own server: copy docker/livekit/ to it, put LIVEKIT_API_KEY and LIVEKIT_API_SECRET in a .env next to it, publish port 7880 behind HTTPS on that server, run docker compose --profile calls up -d there, and set LIVEKIT_URL (its wss:// address) and LIVEKIT_API_URL (its https:// address) in Seerline.
  • LiveKit Cloud: create a project, copy its URL, API key and secret into the same settings, and leave LIVEKIT_API_URL empty (Seerline then uses LIVEKIT_URL with wss changed to https).

Switches

Settings → Payments & calls → Calls: Voice calls and Video calls switch each mode off for everyone (new requests for that mode are refused; running sessions go on). Per expert, Admin → Experts → an expert → Can take video sessions takes video away from one expert. Video quality (720p, 540p or 360p) sets what the apps send.

Part 03

Connect services

Push notifications (your own Firebase project)

Push notifications reach a locked phone: a new request rings on the expert's phone, and users hear when their session is accepted or declined, when minutes run low, when a refund is decided and when a favourite expert comes online. They go through Firebase Cloud Messaging in your own Firebase project. Without it, the apps still show every update live while they are open, and the in-app notification list still fills.

Firebase costs

Firebase is a third-party service run by Google with its own pricing, and you are responsible for any Firebase costs. Cloud Messaging has no charge per message today; other Firebase products you turn on yourself may be billed under Google's plans: firebase.google.com/pricing.

There are two halves: the apps need your project's ids (so each phone can get a push token), and the server needs a service account key (so it can send). One Firebase project serves both apps.

Not in the download

No Firebase file of ours ships with Seerline: there is no google-services.json, no GoogleService-Info.plist, no firebase_options.dart, no service account JSON and no .env with ids. Push stays off until you connect your own project.

1. Create the Firebase project

  1. Open the Firebase console, choose Create a project, name it after your platform and finish (Google Analytics is not needed).
  2. For iOS: in Firebase → Project settings → Cloud Messaging → Apple app configuration, upload an APNs authentication key (.p8). Make it in your Apple Developer account under Certificates, Identifiers & Profiles → Keys with "Apple Push Notifications service" ticked, and note its Key ID and your Team ID. One key serves both apps.

2. Register the two apps

Each app has its own ids (set them first, chapter 22): by default com.seerline.user and com.seerline.expert. Register an Android app and an iOS app for each, four in all, in one of two ways:

  • In the console: Project settings → Add app → Android, with the package name; then Add app → iOS, with the bundle id. Download each app's google-services.json or GoogleService-Info.plist: they hold the values for the next step.
  • With flutterfire configure: install the Firebase CLI (npm install -g firebase-tools, then firebase login) and the FlutterFire CLI (dart pub global activate flutterfire_cli). In seerline_mobile_flutter/, run it once per app:
    flutterfire configure --project=your-firebase-project --platforms=android,ios \
      --android-package-name=com.seerline.user --ios-bundle-id=com.seerline.user \
      --out=lib/firebase_options_user.dart --yes
    # the same with com.seerline.expert and --out=lib/firebase_options_expert.dart
    Each run registers the Android and iOS app in your project and writes the values into that lib/firebase_options_*.dart file.

The apps start Firebase from the values in their .env, not from these files: once the values are copied (next step) you can delete the generated files. If you prefer to keep Google's config files in the project, put each google-services.json in android/app/src/user/ and android/app/src/expert/: as soon as one real file is there, the build turns on Google's services plugin, so do it for both flavours.

3. Put the ids in each app's .env

Each of the two apps has its own Firebase app ids, so keep one settings file per app, for example .env.user and .env.expert (copies of .env.example), and fill in:

Key in the app .envWhere the value is
FIREBASE_API_KEYThe Android API key: apiKey of the android options, or current_key in google-services.json.
FIREBASE_PROJECT_IDprojectId / project_id
FIREBASE_MESSAGING_SENDER_IDmessagingSenderId / project_number
FIREBASE_ANDROID_APP_IDThe Android app's id (1:…:android:…)
FIREBASE_IOS_APP_IDThe iOS app's id (1:…:ios:…)
FIREBASE_IOS_BUNDLE_IDThe iOS bundle id
FIREBASE_STORAGE_BUCKETstorageBucket (optional)

Then build each app with its own file, for example flutter run --flavor expert --dart-define-from-file=.env.expert. Until the keys are there, the app writes "push is off" to its debug log and goes on without it.

4. The service account for the server

  1. In Firebase → Project settings → Service accounts, choose Generate new private key. A JSON file downloads. Anyone with it can send pushes as your project, so keep it safe.
  2. In Admin → Settings → Push, email & legal → Push (Firebase), paste the file's text and its project id, then save. The key is stored encrypted and never shown again. (In .env instead: FCM_PROJECT_ID and FCM_SERVICE_ACCOUNT_JSON as one line of JSON.)
  3. Send a test push asks Google to accept the service account (no message is sent). The setup check's Push row turns green.

5. Which pushes go out

Settings → Push, email & legal → Push has a switch for each kind: New request (experts), Minutes running low (users, during a session), Payout sent (experts), Refund decided (users) and Promos (users who want offers). Other notices always go. Each person can also turn kinds off in their app's settings. The in-app notification list keeps every notice either way.

6. Test it

Install the expert app on a real phone (the iOS simulator does not receive pushes), sign in as an approved expert, allow notifications, go online and lock the phone. Request a session from the user app on another phone: the expert's phone rings within a few seconds. Device tokens that Firebase reports as gone are removed by themselves. On the public demo (DEMO_MODE) no push is ever sent.

Settings → Push, email &amp; legal: the Firebase service account, the push kinds, the mail server and the legal pages
Settings → Push, email & legal: the Firebase service account, the push kinds, the mail server and the legal pages

Email (SMTP)

Seerline sends a few emails: password reset links, expert application decisions (approved, not approved, a change asked), report outcomes and staff invitations. Until you set up a mail server, each email is written to the app's log instead (docker compose logs app | grep "email not sent"), so the first super admin can still use a reset link.

Email costs

Your email provider is a third-party service with its own pricing (per message or per month above a free allowance), and you are responsible for those costs.

  1. Get SMTP details from your provider (for example Amazon SES, Postmark, Brevo, or your own mail host): host, port, username, password, and a sender address on a domain you verified with them.
  2. Admin → Settings → Push, email & legal → Mail server: host, port, security (starttls for port 587, tls for 465, none only for a local relay), username, password and the sender (Your Brand <hello@yourbrand.com>). Or the SMTP_* keys in .env.
  3. Send a test email to yourself.

Under "Emails this server sends", the super admin can reword the password reset and the expert approved / not approved emails; {{brand}}, {{name}} and the other placeholders shown there are filled when each email goes out. Each email has a plain text and an HTML part in your brand colour. Set up SPF and DKIM for your sending domain as your provider explains, or emails may land in spam.

File storage

Files are expert documents (ID and certificates, photos or PDFs), pictures sent in chat, profile photos and your logo. Files are private: the server hands each one only to the people allowed to see it, through short-lived signed links. JPEG, PNG and WebP pictures may be up to 5 MB and PDFs up to 20 MB; every upload's real type is read from its first bytes, not from its name. By default each person may keep up to 100 MB of uploads (Settings → Site & apps → Room per person, MB; 0 = no limit).

ChoiceHow
MinIO (the default)Runs in the Docker stack and keeps files in the minio-data volume on your server. Nothing to set beyond S3_SECRET_ACCESS_KEY.
AWS S3Create a private bucket and an access key with read and write rights on it. In .env: S3_ENDPOINT= (empty), S3_REGION, S3_BUCKET, S3_ACCESS_KEY_ID, S3_SECRET_ACCESS_KEY.
Cloudflare R2 or another S3-compatible serviceS3_ENDPOINT = the service's S3 address (for R2, https://<account id>.r2.cloudflarestorage.com), S3_REGION=auto for R2, plus bucket and keys.
A folder on the serverSTORAGE_DRIVER=local: files go to the app-storage volume (/app/storage). Fine for one server, not for several.

You can also switch in Admin → Settings → Site & apps → Where files are kept, with Test storage. Switching does not move existing files: copy them to the new place first (for example with the mc mirror or rclone tools). The page also shows how much is stored, by kind.

Storage costs

Outside storage providers such as AWS S3 and Cloudflare R2 are third-party services with their own pricing for the space used, requests and (AWS) downloads; you are responsible for those costs. MinIO on your own server costs only its disk.

Part 04

The mobile apps

Run the two apps

One Flutter project, seerline_mobile_flutter/, builds two apps. The flavour picks which one: user builds the user app (com.seerline.user, "Seerline"), expert builds the expert app (com.seerline.expert, "Seerline Expert"). Each has its own name, id, icon and link scheme, so both can sit on one phone.

First run

  1. Install Flutter and check it: flutter doctor should be green for Android and (on a Mac) iOS.
  2. Make the settings file:
    cd seerline_mobile_flutter
    cp .env.example .env
    Set API_BASE_URL to your server: https://app.yourbrand.com, or http://10.0.2.2:8080 for a server on your computer from the Android emulator (http://localhost:8080 from the iOS simulator).
  3. Get the packages and run:
    flutter pub get
    flutter run --flavor user --dart-define-from-file=.env
    flutter run --flavor expert --dart-define-from-file=.env
Always both flags

Every run and build needs --flavor and --dart-define-from-file. Without the flavour the build does not know which app to make; without the file the app has no server address.

Each app accepts only its own kind of account: an expert who signs in to the user app is told to use the expert app (wrong_app), and staff accounts sign in only on the web.

User app: sign in or create an account
User app: sign in or create an account
Expert app: sign in or apply
Expert app: sign in or apply

Every key in the app .env

KeyWhat it does
API_BASE_URLYour Seerline server, without /api/v1. Use https for a store build.
FIREBASE_*Seven keys for push (chapter 17). Empty = push off; the app still updates live while open.
DEMO_LOGINStrue shows one-click demo sign-ins on the sign-in page; they work only against a server in demo mode. Keep false for your store builds.
SUPPORT_EMAILHelp's "Email support" address, used only while the server's support email (Settings → Platform & billing → Platform) is empty (optional).
APP_ROLEOnly for builds without --flavor (web, tests): user or expert.
SAMPLE_DATAtrue runs the app on its own built-in sample data, with no server (sign-in, experts, sessions, wallet and live events are simulated). Handy to look at every screen or work on the design. Keep false for your store builds.

These values are compiled into the app. After a change, run or build again. To change every outside key of the whole platform, see the summary in chapter 41: the server's keys live in the server's .env or Admin → Settings, never in the apps. The apps hold no secret: Stripe's secret key, the Firebase service account and the LiveKit secret stay on the server.

Make the apps yours

Before your first store upload, give the apps your name, your ids, your link scheme, your colour and your icons. A published app's id can never change.

The quick way: one command

From the seerline/ folder (on a copy you have backed up or committed to Git):

node tools/rename.mjs --name "Starline" --id com.acme.starline --color "#2563EB" --icon icon.png --dry
node tools/rename.mjs --name "Starline" --id com.acme.starline --color "#2563EB" --icon icon.png
  • --name: the brand people see. The user app becomes "Starline" and the expert app "Starline Expert"; emails, legal pages and the web app's default name follow.
  • --id: the base of both app ids. com.acme.starline gives com.acme.starline.user and com.acme.starline.expert on Android and iOS.
  • --scheme (optional): the link scheme that brings users back from Stripe and opens the app from the website's "Open in the app". It defaults to the name in lower case without spaces; the expert app gets <scheme>-expert. The web app's links change with it.
  • --color: the brand colour of the apps and the web app's default.
  • --icon: a square PNG of at least 1024 pixels, no transparency: the icon of both apps, or of the user app only when you also give --expert-icon expert.png. Android 8 and newer draw the same picture on a background colour: give the icon's own background with --icon-bg "#2563EB". It runs dart run flutter_launcher_icons for you, so Flutter must be installed.
  • --dry shows every change without writing anything. Run it again with new values whenever you like.

Folder, package and database names (seerline_mobile_flutter, seerline-server, POSTGRES_DB) stay as they are: nobody sees them.

By hand: names, ids and link schemes on Android

In android/app/build.gradle.kts:

val apps = mapOf(
    "user" to Pair("com.acme.starline.user", "Starline"),
    "expert" to Pair("com.acme.starline.expert", "Starline Expert"),
)
val urlSchemes = mapOf("user" to "starline", "expert" to "starline-expert")
// and in defaultConfig: applicationId = "com.acme.starline.user", appUrlScheme = "starline"

Leave namespace as it is: it is only the code's package, not the store id.

By hand: names, ids and link schemes on iOS

Open ios/Runner.xcworkspace in Xcode → the Runner target → Build Settings. For each configuration (Debug, Release and Profile of user and of expert) set PRODUCT_BUNDLE_IDENTIFIER, APP_DISPLAY_NAME and APP_URL_SCHEME. Info.plist reads the name and the scheme from them.

By hand: the links that open the app

The website's "Open in the app" and the Stripe return page use the user app's scheme: change APP_LINKS in apps/frontend/src/routes/paths.ts and rebuild the server image. The apps understand <scheme>://wallet, <scheme>://expert/<id> and <scheme>://session/<id>.

Logo and app icons

  • App icons: replace assets/icon/user.png and assets/icon/expert.png (1024 × 1024, no transparency) and the *_foreground.png files (the Android 8+ adaptive icon, artwork inside the middle 60%), set adaptive_icon_background in flutter_launcher_icons-user.yaml and flutter_launcher_icons-expert.yaml, then run dart run flutter_launcher_icons.
  • The web logo and colour: Admin → Settings → Site & apps → Brand (no rebuild needed). The default mark is apps/frontend/src/layout/Logo.tsx and apps/frontend/public/favicon.svg.

By hand: colours and fonts

  • Every colour of the apps is in one file, lib/core/theme/app_theme.dart: AppColors.light, AppColors.dark and FixedColors. Screens read colours only through it, so changing brand there changes every button and link. Violet is for anything you can press; brass only for the meter, balances and stars.
  • Fonts: titles use Cormorant Garamond and everything else Plus Jakarta Sans, both in assets/fonts/ and listed in pubspec.yaml. To change them, add your font files there, list them under fonts:, and change AppText.display and AppText.family in app_theme.dart.
  • The web app: Settings → Brand sets the main colour without a rebuild; the defaults are in apps/frontend/src/styles.css.

Change every API key

KeyWhere it goes
Server addressApp .env: API_BASE_URL
Firebase app idsApp .env.user / .env.expert: FIREBASE_*
Firebase service accountAdmin → Settings → Push, or server .env: FCM_*
Stripe keys and webhook secretAdmin → Settings → Payments & calls, or server .env: STRIPE_*
LiveKit address, key and secretAdmin → Settings → Payments & calls, or server .env: LIVEKIT_*
SMTPAdmin → Settings → Push, email & legal, or server .env: SMTP_*
StorageAdmin → Settings → Site & apps, or server .env: S3_*, STORAGE_DRIVER
Store links on the websiteAdmin → Settings → Site & apps → App links

Build and publish under your name

Each app is published under your own Google Play and Apple developer accounts, with your name, ids and icons. Point API_BASE_URL at your https:// server, keep DEMO_LOGINS=false and SAMPLE_DATA=false, and raise the version in pubspec.yaml (version: 1.0.0+1: the part after + must go up with every upload).

Android: sign, then build

  1. Make an upload key once (keep the file and its passwords safe; you need them for every update):
    keytool -genkey -v -keystore upload-keystore.jks -keyalg RSA -keysize 2048 -validity 10000 -alias upload
  2. Create android/key.properties (it is never shipped and should never be committed):
    storePassword=your-store-password
    keyPassword=your-key-password
    keyAlias=upload
    storeFile=../upload-keystore.jks
    storeFile is read relative to android/app/; an absolute path to wherever you keep the key also works. Without this file, release builds are signed with the debug key and Google Play refuses them.
  3. Build an App Bundle for each app:
    flutter build appbundle --flavor user --dart-define-from-file=.env.user
    flutter build appbundle --flavor expert --dart-define-from-file=.env.expert
    The files are in build/app/outputs/bundle/userRelease/ and expertRelease/. (flutter build apk makes an APK to install directly.)

The apps target Android SDK 36 (compileSdk and targetSdk are set to 36 in android/app/build.gradle.kts) and run on Android 7.0 and newer.

iOS: sign, archive and upload

  1. Run flutter build ios --flavor user --dart-define-from-file=.env.user once, so CocoaPods and the build settings are in place.
  2. Open ios/Runner.xcworkspace in Xcode, select the Runner target → Signing & Capabilities. Signing is set to Automatically manage signing and no team is filled in: choose your own Team for each configuration. Xcode makes the certificates and profiles. Keep the Push Notifications and Background Modes (audio, remote notifications) capabilities.
  3. Choose the user scheme, then Product → Archive, and Distribute App → App Store Connect. Repeat with the expert scheme.

Google Play

  1. In the Play Console, create one app per flavour with your package names, and upload each App Bundle (Play App Signing keeps the final signing key).
  2. Fill in the store listing, content rating, the Data safety form (accounts, email, name, optional birth details, photos, messages, purchase history, device ids for push) and your privacy policy address (https://app.yourbrand.com/legal/privacy).
  3. Declare the foreground service types the apps use to keep a call running when the screen is off (microphone, camera and media playback), as the Play Console asks.
  4. Explain how top-ups work in the review notes (chapter 15) and give a test account for each app.

App Store

  1. In App Store Connect, create two apps with your bundle ids, upload a build of each from Xcode, and fill in the listing and the App Privacy answers.
  2. In the review notes, say that every paid session is a live one-to-one session between two people paid under guideline 3.1.3(d), and give a user and an expert test account so the reviewer can see a session from both sides.
  3. Users can delete their account inside both apps (Settings → Delete account), which Apple requires.

Links to your apps

Once live, paste the four store links in Admin → Settings → Site & apps → App links; the website's download buttons, the "become an expert" page and the setup check use them.

The user app

  1. Welcome and sign in. Onboarding, sign in, create an account, forgot password. Optional birth details and question (name, date, time and place of birth): kept on the user's account, and shared with an expert only for a session where the user ticks "share", after they consented.
  2. Find an expert. Home shows categories, who is online now, top-rated experts and a banner back to an open session. Explore and search filter by category, language, price a minute, rating and online only, and sort. An expert's profile has the bio, skills, languages, rates per mode, the rating breakdown, reviews and working hours (shown as information: sessions are on demand). Favourite an expert and ask to be told when they come online.
  3. Request. Pick chat, voice or video; the sheet shows the rate and the amount that will be held. Short of money, the app offers a top-up first.
  4. Wait. The waiting room counts down the answer window; the user can cancel. Declined, timed out and busy each say what happened, and the hold goes back.
  5. Talk. Chat with pictures, or a voice or video call. The meter shows the minutes, what was charged and how long the money lasts; when it runs low, a card offers a top-up without hanging up. A lost connection shows "reconnecting" while billing is paused.
  6. After. A summary of what was paid, a rating and review, then the receipt in history. From the receipt: ask for a refund within the refund window, or report the session (and block the expert).
  7. Wallet. Balance and held money, top-up packs or a custom amount, promo codes, and every transaction.
  8. Account. Notifications, favourites, profile, theme (light, dark, system), push choices, Help (common questions, then your support email, documentation and support links from Settings), legal pages, Download my data, and account deletion (unspent top-ups go back to the card).
Search with filters
Search with filters
The summary: what was paid, then the rating
The summary: what was paid, then the rating
A receipt with refund and report
A receipt with refund and report
Top-up packs and a promo code
Top-up packs and a promo code

The expert app

  1. Apply. Sign up in the expert app, then fill in the application: headline and bio, categories, languages, skills, years of experience, proposed rates per mode, and documents (an ID and certificates, as photos or PDFs). Send it; the app shows "in review", "a change asked" (with your note) or "not approved" until you decide (chapter 28).
  2. Today. The online switch, today's earnings and minutes. After a missed request the expert shows as Away until they switch back on.
  3. Incoming request. A full-screen ring with the client's name, the mode and a countdown; accept, or decline with a private reason and, if they like, 10 minutes away (the server switches them back on afterwards). A request left to run out takes the expert offline.
  4. Session. The same chat, voice and video screens, plus the client's shared birth details and question, and what the expert earns as it goes.
  5. Money. Earnings by period with pending, available and paid, the commission of each session, payout requests from the minimum, payout history with references, and where to be paid.
  6. Practice. Rates per mode inside the limits you set, working hours, reviews with replies, profile edits (categories too), notifications and settings, Help with your support links, Download my data and account deletion.
A session with the client's shared details
A session with the client's shared details
Payouts: the open request, then each one paid with its bank reference
Payouts: the open request, then each one paid with its bank reference
Rates per mode inside the platform's limits
Rates per mode inside the platform's limits
Reviews with a reply
Reviews with a reply

How the app code is organised

Everything is in seerline_mobile_flutter/lib/. State flows through Riverpod providers, routes through go_router, and long lists use Flutter's lazy .builder lists. main.dart only starts the app.

FolderWhat is in it
main.dart, app.dartStart-up, then the app widget with the theme and the router.
domain/models/The models: users, experts, sessions, wallet, money, notifications, paging, each with its JSON reading.
domain/billing/, domain/expert/Pure logic: the session meter (minutes left, low balance) and the expert application rules. Unit-tested.
core/providers/The providers: the API client, the signed-in session, market data, theme, connectivity, push registration.
core/services/The API client and paths (api/), the repositories that call it (data/), calls with LiveKit (calls/), live updates (realtime/), push (firebase/), and the built-in sample server for sample mode (api/sample/).
core/router/The routes of both apps, the sign-in gates and the link handling.
core/theme/app_theme.dart: every colour, size and text style, light and dark.
core/constants/The .env values (app_env.dart) and which app this build is (app_role.dart).
components/The shared components: bars, controls, display parts, feedback (toasts, banners, empty states) and marketplace parts (expert rows and tiles, the meter, rate rows).
features/user/The user app's pages, one folder per area: home, explore, experts, session request, sessions, wallet, account, onboarding.
features/expert/The expert app's pages: application, today, incoming, sessions, money, practice, profile, reviews.
features/session/The live session screen both apps share (chat, voice, video, the meter, reconnecting).
features/common/Sign-in and sign-up, and the debug pages (only in debug builds).

The platform folders: android/app/build.gradle.kts (flavours, ids, SDK levels, signing), android/app/src/user|expert/res (each app's icons), ios/Runner.xcodeproj (the user and expert schemes and configurations), ios/Runner/Info.plist (permissions texts). Tests are in test/ (chapter 43).

Part 05

Run the platform

The admin panel

Staff sign in at https://app.yourbrand.com/signin; the admin is under /admin. Users and experts never sign in on the web: they use the apps, and the website has no sign-up.

Staff roles

RoleWhat it can do
Super adminEverything.
SupportDay-to-day work: sessions (force end, message both), refund requests, reports, reviews, users, applications. It cannot open settings, staff, payouts, money moves (adjustments, card refunds), experts' commission and terms, categories or promo codes.
Read-only (viewer)Sees every page, changes nothing and cannot export CSV. People's emails, phones, users' names (first name and initial) and birth details are masked in every answer it reads. Experts' names stay, as they are public.

Overview

Today at a glance: charged today, platform fees, minutes billed, live sessions, expert applications, refund requests, payout requests and open reports, a chart of what was charged per day, and a Needs you list (failed background jobs, setup problems, items waiting). A banner warns while Stripe is in test mode. The search box finds sessions (SL-…), people (name or email), top-ups (TU-…), refunds (RF-…), payouts (PO-…) and reports (RP-…).

Live sessions

Every open request and live session, refreshed every 5 seconds: who with whom, the mode and rate, the meter, the next charge, a reconnecting countdown when someone dropped, and the call room. Message both puts a message from support in the session's chat. Force end ends it after asking (chapter 11).

The lists have filters, a search, paging and (except for the read-only role) Export CSV of the ticked rows or the whole filter, up to 10,000 rows.

Experts and applications

How an expert joins

  1. The expert installs the expert app, signs up and fills in the application (chapter 25). Settings → Site & apps → Sign-ups → Expert applications can close new applications.
  2. The application appears in Admin → Expert applications, with the profile, categories, languages, proposed rates and documents. Open each document; mark it Readable, Checked, Matches or Unreadable (only staff see the mark).
  3. Decide, with a note the expert receives by email and in the app:
    • Approve expert: the expert is listed, may go online and gets a public page address (/experts/<name>).
    • Ask for a change: the application stays waiting and the expert sees what to fix.
    • Reject: the expert can change the application and send it again.

Experts

Admin → Experts lists approved and suspended experts with their status (online, in a session, offline), rating, sessions and money. An expert's sheet shows pending and available earnings and their rates, and lets you:

  • set a custom commission with an optional end date (chapter 13);
  • switch Featured on the home screen and Can take video sessions;
  • suspend for a number of days or until reinstated (the expert goes offline and a live session ends), and reinstate. Suspensions with an end date are lifted by themselves.

Experts set their own rates in the app, inside the per-mode limits of Settings → Platform & billing → Commission and rate limits.

An application with its documents, proposed rates and the three decisions
An application with its documents, proposed rates and the three decisions

Categories

Categories are only data. Seerline starts with astrology and related categories, but nothing in the code is tied to astrology: add lawyers, tutors, coaches or any other kind of expert.

Example: add a category for lawyers

  1. Admin → Categories → New category.
  2. Name: Legal advice. Slug: legal-advice (letters, digits and dashes; it becomes the website address /categories/legal-advice and cannot change later). Description: one line people see, for example "Talk to a qualified lawyer about your question". Icon: pick the scales; the apps and the website show it with the category.
  3. Save. The category is added at the end of the list; drag it (or use Move up and Move down in its menu) to where it should appear. Its switch shows or hides it in the apps and on the website; a hidden category keeps its experts.
  4. Lawyers now pick "Legal advice" in the expert app when they apply (or later in their profile). As soon as an approved lawyer is listed, the category shows them in the apps, on the website and in the directory filters.
  5. Check your legal pages and the expert agreement for the new kind of expert (Settings → Push, email & legal), and set rate limits that suit them (Settings → Platform & billing).

A category no expert and no session uses can be deleted; otherwise hide it.

Categories: drag to reorder, show or hide, and a new one
Categories: drag to reorder, show or hide, and a new one

Sessions

Admin → Sessions: every session, live and past, filtered by day, mode, category, status and how it ended. A session's page shows:

  • who, the mode, the rate and commission it started with, when it was requested, accepted and connected, and how and by whom it ended;
  • what was charged, the platform fee, what the expert earns and the hold at request;
  • Billing, minute by minute: each minute with its time, cost, whether it came from the hold or the wallet, whether it was free, and its split;
  • the chat (for support), refunds and reports on the session;
  • the main action: Force end while live, the open refund request to decide, or Refund minutes.

How each session ended: declined, timeout, cancelled, expert_offline (requests that never started), user, expert, admin, balance (money ran out) or disconnect (a side gone past the grace).

Money pages

PageWhat it shows and does
Wallet ledgerEvery cent in and out of user wallets: top-ups, promo bonuses, holds, releases, session charges, refunds, adjustments and card refunds. Entries are never edited: a fix is a new entry. Manual adjustment credits or debits a user with a reason (chapter 12).
Top-upsPaid, pending, declined and expired top-ups with the card's brand and last four digits. Refund to card on a paid top-up with unspent money; Re-check with Stripe on a pending one (chapter 38).
RefundsRefund requests to approve (all or part) or reject, each with the session, what was asked and what happens to the expert's share.
PayoutsPayout requests to mark paid with a bank reference, or send back (chapter 13).
The wallet ledger: every entry with its reason
The wallet ledger: every entry with its reason
Top-ups with card refunds and re-checks
Top-ups with card refunds and re-checks

Reports, reviews and users

Reports

Either person can report a session from the app (abuse, fraud, quality, technical, other), and may block the other at the same time: neither then sees or meets the other again. Admin → Reports → decide: dismiss, warn (the person is told the rule), suspend for some days, remove (suspended until staff lift it) or refund the user. Both people get an email with the outcome.

Reviews

One review per session, by its user, with stars, words and tags; the expert can reply. Admin → Reviews → Hide a review that breaks your rules, with a reason (and show it again). An expert's rating counts only visible reviews.

Users

Admin → Users: everyone with an account, their wallet, sessions, refunds and reports. A user's sheet: send a password reset email, suspend (signs them out everywhere) or reinstate, Adjust wallet, and Export data (chapter 37).

A report with the session's chat and the decisions
A report with the session's chat and the decisions

Settings: every setting and what it changes

Admin → Settings has four tabs. Edits stay across tabs until Save changes, which saves every changed section at once; every server copy picks the change up at once. A session keeps the rate, the commission and the free minutes it started with; the reconnect grace, the low-balance warning and the refund window follow the current setting. Super admins change settings; the support role cannot open them and the read-only role only reads them.

Platform & billing

SettingDefaultWhat it changes
NameSeerlineThe platform name on the website, in the admin, in emails and in the legal pages.
Support emailemptyThe address people are told to write to, on the website and in emails.
CurrencyUSDThe one currency of every price, rate and balance (3 letters).
Time zone for reportsAmerica/New_YorkWhere "today" starts in the admin's figures.
Commission30%The platform's share of each billed minute (0 to 100%), for sessions that start after the change.
Chat, voice and video rate$0.50–$5.00, $0.80–$6.00, $1.00–$8.00The lowest and highest price a minute an expert may set for each mode.
Top-up packs$10, $25, $50, $100The pack buttons on the top-up screen (up to eight).
Smallest / largest top-up$10 / $500The range of a top-up, packs and custom amounts alike.
Low-balance warning2 minutes"Add money and keep talking" appears, and the push goes out, when the money left covers this many minutes (1 to 30).
Hold at request5 minutesThe rate × this many minutes is held when a user asks for a session; also the least a user needs to start (1 to 120).
Answer window60 secondsHow long the expert has to accept; then the request times out and the hold is released (15 to 600).
Reconnect grace120 secondsHow long billing stays paused for a dropped side before the session ends (30 to 900).
Free first session, Free minutesoff, 5A new user's first session has this many free minutes, paid to the expert by the platform (1 to 60).
Refund window and earnings hold3 daysHow long users can ask for a refund after a session, and how long the expert's earning stays pending (0 to 90).
Payout minimum$50The smallest payout an expert can ask for.

Payments & calls

SettingWhat it changes
Publishable key, Secret key, Webhook signing secretYour Stripe account (chapter 10). Secrets are stored encrypted. Empty = top-ups off.
Webhook addressThe address to add in Stripe (copy it), with the last event received.
Refund unspent money to cardOn: staff can send unspent top-up money back to the card.
Statement nameWords Stripe adds to the card statement after your account's prefix (letters, digits and spaces; 22 characters with the prefix).
LiveKit server URL, API key, API secretYour LiveKit server (chapter 16), with Test the connection.
Voice calls, Video callsOff: users cannot start sessions in that mode.
Video quality720p (default), 540p or 360p: what the apps' camera captures and sends. LiveKit lowers it further on a weak network.
Record callsAlways off: calls are never recorded.

Push, email & legal

SettingWhat it changes
Push (Firebase)The service account and project id (chapter 17), and the five push kinds: New request, Minutes running low, Payout sent, Refund decided, Promos.
Mail serverHost, port, security, username, password, sender; Send a test email (chapter 18).
Emails this server sendsThe wording of the password reset and the expert approved / not approved emails.
Legal pagesTerms of use, Privacy policy, Cookies, Refund policy, Expert agreement and Community rules, in Markdown, shown on the website (/legal/terms, /legal/privacy, …) and in the apps. A new install starts with sample texts for all six (loaded at the first start; a page you have saved is never replaced): have them checked by a lawyer for your country. Write {{commission}}, {{holdDays}}, {{refundDays}}, {{payoutMin}}, {{topupMin}} or {{topupMax}} and the page shows the current setting, so the text always matches what the platform does.

Site & apps

SettingWhat it changes
Brand: logo, colour, documentation and support linksThe website's and the admin's logo and main colour (lighter and darker shades are worked out for light and dark mode), shown on the next page load without a rebuild. The documentation and support links also appear in both apps' Help page under Contact ("Help centre", "Support page") as soon as the app next loads its settings. The apps' name, colour and icons are set when you build them (chapter 22).
Sign-ups: users, expert applicationsOpen or closed: closed refuses new accounts of that kind in the apps.
App linksThe App Store and Google Play links of both apps (the website's download buttons), and optional direct APK links for a demo build.
Where files are kept, Room per personStorage (chapter 19) and each person's upload allowance.
Maintenance mode, messageEveryone except staff sees the maintenance page on the website, and the apps get your message instead of starting anything.
Demo dataRemove demo data deletes only rows marked as demo: the sample experts, users, sessions and demo accounts (chapter 40).
Settings → Platform &amp; billing: every money rule is a setting
Settings → Platform & billing: every money rule is a setting
Settings → Site &amp; apps: brand, sign-ups, app links, storage and maintenance
Settings → Site & apps: brand, sign-ups, app links, storage and maintenance

Staff and the audit log

  • Admin → Staff → Invite: an email and a role (super admin, support or read-only). The person gets an email with a link, valid for 7 days, to choose a password.
  • Change a person's role, or remove their access (it signs them out). You cannot change or remove yourself, and a super admin cannot delete their own account: make someone else super admin first.
  • The audit log under it lists every change staff made, in words, with who and when: decisions, refunds, payouts, adjustments, settings saves, staff changes. Entries are never edited.

The website

The public website is part of the same server and needs no setup. Its pages:

AddressPage
/Home: what the platform is, categories, experts online now, how a session works, the app download links.
/expertsThe expert directory with search and filters (category, mode, language), pages of results.
/experts/<name>An expert's public page: bio, rating, reviews, rates, hours, and "Talk to … in the app" with Open in the app and a QR code. Sessions happen only in the app.
/categories, /categories/<slug>Every category, and one category with its experts.
/become-an-expertWhy and how to join, with the expert app's download links.
/downloadBoth apps' store links (and APK links if set).
/legal/<page>Your legal pages from Settings.
/pay/returnWhere Stripe sends users after paying; it shows the top-up's result and opens the app again.

Home, the directory, categories, become an expert and download are pre-rendered to HTML when the web app is built, so search engines can read them; /sitemap.xml lists the public pages, categories and experts. SEARCH_INDEXING=off closes them to search engines (for a staging copy). The website follows the brand name, logo and colour from Settings.

The expert directory with filters
The expert directory with filters
The "become an expert" page
The "become an expert" page
Part 06

Operations

Background work: what runs, how often, how to check

All background work runs inside the app program; there is no separate worker container. Two loops start with it:

WhatHow oftenWhat it does
Minute loop: billingevery 2 secondsTimes out unanswered requests, starts accepted sessions, charges every minute that has started, pauses on a lost heartbeat, resumes, and ends sessions on balance or after the grace (chapter 11).
Minute loop: paymentsevery 2 secondsAsks Stripe once more about top-ups whose checkout ran out, then marks them expired; sends again card refunds that were claimed but not confirmed after 2 minutes.
Minute loop: earningsevery 2 secondsMoves earnings whose refund window passed from pending to available and tells each expert.
Minute loop: suspensions, breaksevery 2 secondsLifts suspensions whose time is up; brings experts back online after a 10-minute break.
Job queue: housekeepinghourlyDeletes expired sign-ins, ended rate-limit windows, expired reset links and finished job rows older than 14 days.
Job queue: purgedailyRemoves or blanks accounts deleted more than 30 days ago (chapter 37).
Job queue: card detailsafter each paid top-upReads the card's brand and last four digits from Stripe.
Job queue: demo resetdaily at 03:00 UTC, only with DEMO_MODE="true"Puts the sample data back.

Jobs are rows in the jobs table. Workers (JOB_WORKERS, default 4) claim them one at a time; a job that fails is tried again after 20 seconds, then twice as long each time (at most an hour), up to 5 tries. A job may run for 5 minutes; one a stopped worker left running is handed back after 10 minutes.

How to check it runs

  • Admin → Setup check: Billing clock turns red when a live session is more than 90 seconds late for its next minute; Background jobs warns about jobs that failed in the last 24 hours and turns red when jobs wait over 10 minutes. See jobs lists them with the error, Retry and Retry all. The overview's "Needs you" list repeats failed jobs.
  • The log: docker compose logs -f app. A part of the minute loop that fails writes ops pass failed with the part's name; a failing job writes job failed.
  • From a terminal: docker compose exec postgres psql -U seerline -d seerline -c "select kind, status, attempts, last_error from jobs order by id desc limit 20" (with your POSTGRES_USER and POSTGRES_DB).

Personal data and deletion

What Seerline keeps about people, how deletion works from start to end, and how to answer a request for a person's data. You are the controller of this data: write your privacy policy (Settings → Push, email & legal) to match your country's law.

Tables that hold personal data

TableWhat it holds
usersName, email, phone, password hash (Argon2id), profile photo, push choices, last seen.
user_intakesThe optional birth details (name, date, time and place of birth) and question, with when the user consented to share them.
sessionsWho talked to whom, when, for how long and the money; a copy of the intake the user shared with that expert.
messagesChat messages and pictures sent in sessions.
experts, expert_documents, mediaExpert profiles, payout details as typed, ID and certificate files, uploaded photos.
wallets, wallet_tx, topups, card_refundsBalances, every movement, top-ups with the card's brand and last four digits (never full card numbers: those stay at Stripe).
earnings, payoutsWhat experts earned and were paid, with payout destinations and references.
reviews, reports, refund_requestsWhat people wrote about a session.
favourites, category_follows, blocks, notificationsChoices and the in-app notification list.
auth_sessions, push_tokens, password_resetsSign-ins (only a hash of each token), device push tokens, reset links.
audit_logWhat staff did, in words.

Calls are never recorded: voice and video pass through LiveKit and are not stored. Visitor addresses are kept only as keyed hashes in the rate-limit table, for the length of a limit window.

Deletion, end to end

  1. The person deletes their account in the app (Settings → Delete account; Apple and Google require it). Not while a session is open. At once: unspent top-up money goes back to their cards through Stripe (newest top-up first), an expert goes offline, the account is marked deleted, and every sign-in on every device ends. The email address is free to sign up again.
  2. 30 days later, the daily purge job takes the account. Sign-ins, push tokens, reset links and the person's uploaded files (from storage too) go.
  3. An account with no money history is deleted completely.
  4. An account with paid sessions, wallet entries, earnings or payouts is kept for your books but blanked: the name becomes "Deleted account", the email an unusable placeholder, and phone, password and photo go. Its birth details, favourites, follows, blocks, notifications and expert profile are deleted, and every piece of free text about the person in the kept rows is removed: the birth details shared in sessions, the chat (a "[removed]" marker stays), review words and replies, refund and report texts and the staff notes on them, payout bank details and notes, the card's brand and digits, and the notes on wallet entries. What stays: dates, amounts, minutes and references, which tax and accounting rules usually require.
  5. Each account is purged in its own transaction; one that fails is logged and tried again the next day.
  6. Experts' application papers (ID and certificates, with their files) are needed only while you decide: the same daily job deletes them 30 days after you approve, reject or suspend the expert. An application you sent back for a change keeps its papers until you decide again.
  7. The audit log is kept as written. It is your record of which staff member changed what with money and accounts (refunds, payouts, adjustments, suspensions), which you may need to answer a dispute or an audit, so the purge does not change it.

A request for a person's data (access or portability)

  • GET /api/v1/me/export, called with the person's own sign-in, gives everything Seerline keeps about them in one JSON file: profile and expert profile, birth details, wallet and ledger, top-ups, sessions with their minutes, the messages they sent, reviews, reports, refund requests, earnings and payouts, favourites, follows, blocks, notifications and signed-in devices. Other people appear only as the apps show them ("Maya O.").
  • In the apps, Settings → Download my data (user app: under Account; expert app: Account, under Expert help) fetches that file and opens the phone's share sheet with seerline-my-data-YYYY-MM-DD.json, so people serve their own request.
  • For a request by email or in the app's help: Admin → Users → the person → Export data downloads the same file (super admins only; it is written to the audit log). Send it to the account's email address.

Requests that reach you outside the app

If someone asks you by email to delete their account, check it is really them (reply to the account's email address). Then a super admin opens Admin → Users → the person → Delete account and types the reason, which is kept in the audit log. An open request or session ends first (as an admin end); then it does what Delete account in the app does: money back to the card, signed out everywhere, purged after 30 days. It is not for staff accounts (remove them under Staff) or your own. Tell the person the 30-day schedule above.

Missed webhook recovery

A wallet is credited only when Stripe confirms the payment. If Stripe's webhook does not arrive (your server was down, the signing secret was wrong, a firewall blocked it), the money is not lost. Four paths credit it, each once (the credit has a unique ledger key, whichever path comes first):

  1. Stripe retries. Stripe sends a webhook again for up to three days when your server did not answer 2xx. Seerline applies each event once.
  2. The app and the return page re-check. After paying, the user's app (and the website's /pay/return page) keeps asking about the top-up. Each time it is still pending or failed, the server asks Stripe about its checkout and credits it if Stripe says it was paid.
  3. The minute loop re-checks expired checkouts. When a checkout page's 31 minutes have run out and the top-up is still pending, the server asks Stripe one last time: paid is credited, unpaid is closed at Stripe and marked expired.
  4. Staff re-check. Admin → Top-ups → a pending top-up → Re-check with Stripe.

To find the cause, look at the setup check's Stripe webhook row (the last event received) and, in Stripe → Developers → Webhooks → your endpoint, the failed deliveries and their answers. After fixing the address or the secret, Stripe's Resend button on a failed event delivers it again.

Security notes

Accounts and sign-in

  • Passwords (10 to 200 characters) are hashed with Argon2id. A password change or reset signs the person out on every other device. Five wrong passwords make an account wait, even for the right one.
  • On the web, the sl_session cookie is HttpOnly, SameSite=Lax and Secure on https; it lasts 30 days with "keep me signed in" (renewed while used), otherwise until the browser closes. Every change made with the cookie must carry the header x-seerline: 1, which other sites cannot add, so they cannot act for a signed-in person.
  • The apps sign in with a token sent as Authorization: Bearer. It lasts 90 days, is renewed while the app is used, and is kept in the phone's secure storage (iOS Keychain, Android Keystore). A request with a Bearer token is judged by that token alone.
  • Session tokens, reset links and invitations are stored only as SHA-256 hashes.
  • Roles are checked by the server on every request: a user route refuses an expert (wrong_role), an expert route refuses an expert still in review, and the admin refuses everyone without a staff role. The screens only hide what a role cannot use.

Money

  • Wallet money comes only from a Stripe payment confirmed by its signed webhook or by Stripe's own answer, from an approved refund, or from a staff adjustment with a reason. Nothing the app sends can add money.
  • Every wallet movement is one guarded update with a unique key: balances never go below zero, a retry changes nothing, and two requests at once cannot both spend the same money.
  • The demo checkout runs only with DEMO_PAYMENTS="true", which the shipped .env.example sets to "false".
  • Saved secrets (Stripe, SMTP, storage, LiveKit, the Firebase service account) are encrypted with a key from APP_SECRET and never sent back to the browser, only "set" and the last four characters.

Calls and files

  • Call tokens are only for the session's two people, only while it is open, and last 10 minutes; each says what that person may send. Rooms hold 2 people and are deleted when the session ends.
  • Uploaded files are private, checked by their content (JPEG, PNG, WebP, PDF), size-limited, and served only to the people allowed to see them through short signed links. Expert documents are seen only by the expert and staff.
  • The read-only admin role sees people's personal data masked.

Rate limits

LimitAllowedWhat it counts
Sign-in, per address20 per 15 minutesSign-in attempts from one address
Sign-in, per account5 per 15 minutesWrong passwords for one account; after five the account waits, even for the right password
Sign-up, per address5 per hourNew accounts from one address
Password reset, per address5 per hourPassword reset emails asked for from one address
Password reset, per account3 per hourPassword reset emails sent to one account
Reset and invite links, per address20 per hourTries at a reset or invite link from one address
Demo sign-in, per address60 per hourPublic demo sign-ins from one address

These limits are counted in PostgreSQL, so they hold across restarts and server copies; the keys are keyed hashes, never plain addresses or emails. Every other API call takes from short-term allowances in memory: each signed-in person may make 240 calls at once and then 20 a second, and all calls from one visitor address together (counted only behind a trusted proxy) 1,200 at once and then 60 a second. The Stripe webhook is never limited. A refused call answers 429 with a Retry-After header.

What loads from other servers

Nothing on the website or the admin loads from another server: fonts and scripts are part of the build, so visitors' addresses are not shared with font or script hosts. The apps talk only to your server, your LiveKit server, Stripe's checkout page (in the browser) and, for push, Google's Firebase.

Keep it safe

  • Keep .env private and backed up; never change APP_SECRET after the install (saved keys could no longer be read).
  • Keep APP_BIND=127.0.0.1 and let only your HTTPS proxy reach the app. Open only 80, 443, and for calls 7881/tcp and 7882/udp.
  • Update Seerline, Docker and your server's system regularly; back up the database (chapter 47).

Demo mode and the sample data

The sample data

docker compose exec app seerline seed-demo --confirm loads a sample platform into your install: 25 experts in six categories (Vedic and Western astrology, tarot, numerology, relationship and career coaching), about 1,900 users with their sessions minute by minute, wallets, top-ups, reviews, refunds, reports and payouts, dated around the day you load it. Every sample row is marked as demo. Without --confirm, the command refuses a database that already has real accounts. Remove all of it in Admin → Settings → Site & apps → Remove demo data: real users, payments and sessions stay. The sample experts get drawn initials as their pictures.

Demo mode

DEMO_MODE="true" turns the whole install into a public demo, for showing the product: it loads the sample data at start, shows one-click demo sign-ins (a user, an expert, an applicant and a read-only admin) on the web sign-in page and, with DEMO_LOGINS=true in the app .env, in the apps; it keeps the shared demo accounts from changing what the next visitor would find (birth details, an application's papers, a public reply, a password: the apps answer "Shared demo account: this change is turned off. Sign up to try it with your own account."), while sessions, money, reviews and favourites still work; it sends no push messages, and puts the sample data back every night at 03:00 UTC. The install wizard is off in demo mode. Keep DEMO_MODE="false" on a live platform. Demo mode does not turn on the demo checkout: only DEMO_PAYMENTS="true" does.

Two more commands: seerline reset-demo removes and reloads the sample data on a database with only demo accounts; seerline migrate applies the migrations and stops.

The demo's sign-in page with its one-click sign-ins
The demo's sign-in page with its one-click sign-ins
Part 07

For developers

Every server key

Every setting in the server's .env, section by section as in .env.example. This table is made from .env.example and the server's own settings code when the release is built, so it matches this version. The Required column says when a key must be set: "Yes" for every install, otherwise the case that needs it ("For wallet top-ups", "With Caddy"…). Keys "Set by Docker" are filled in by the Docker image or the Compose file; set them only when you run the program without Docker.

The outside-service keys (Stripe, email, file storage, LiveKit and push) can also be saved in Admin → Settings. A value saved there wins over .env; secret fields are stored encrypted and are never sent back to the browser (it only shows that a value is set and its last four characters). A service whose keys are empty in both places stays off, and the setup check (chapter 7) says so.

KeyRequiredWhat it does
Required
APP_URLYesThe public address of the app, without a trailing slash, for example https://app.example.com. Links in emails, the Stripe webhook address and secure cookies come from it. Use https on a public server.
APP_SECRETYesA long random string of at least 32 characters (openssl rand -hex 32). It encrypts saved keys and keys the hashed visitor addresses of the rate limits. Never change it after the install: saved keys could no longer be read.
POSTGRES_DBNoThe name of the database the stack creates. Default seerline.
POSTGRES_USERNoThe database user the stack creates. Default seerline.
POSTGRES_PASSWORDYesThe database password. Letters and digits only, because it goes into a connection address.
DATABASE_URLOutside DockerThe 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_TOKENNoThe token the install wizard asks for. Empty: a new one is printed in the app's log on first start.
File storage (expert documents, chat pictures, profile photos, logo)
STORAGE_DRIVERNos3 (the bundled MinIO, AWS S3 or Cloudflare R2) or local (files in a Docker volume). Default in Docker s3.
S3_ENDPOINTWith s3The storage address. The bundled MinIO is http://minio:9000; for R2 use your account's S3 address; for AWS S3 leave it empty.
S3_REGIONNoThe bucket's region. Default us-east-1; R2 uses auto.
S3_BUCKETNoThe bucket name. Default seerline; the stack creates it in MinIO.
S3_ACCESS_KEY_IDWith s3The storage access key. With the bundled MinIO this is also its admin user.
S3_SECRET_ACCESS_KEYYesThe storage secret, at least 8 characters. With the bundled MinIO this is also its admin password, so Docker refuses to start without it.
LOCAL_STORAGE_DIRSet by DockerThe folder for files with STORAGE_DRIVER=local (/app/storage in Docker, a volume).
Payments (Stripe; empty = card payments off)
STRIPE_SECRET_KEYFor wallet top-upsYour platform's Stripe secret key (sk_live_…, or sk_test_… while testing). Users top up their wallets through Stripe Checkout. Empty: top-ups are off (sessions still run on the money already in wallets).
STRIPE_WEBHOOK_SECRETFor wallet top-upsThe signing secret (whsec_…) of the webhook endpoint you add in Stripe for APP_URL/api/v1/webhooks/stripe.
STRIPE_PUBLISHABLE_KEYFor wallet top-upsYour Stripe publishable key (pk_live_… or pk_test_…).
Voice and video calls (LiveKit; empty = chat sessions only)
LIVEKIT_URLFor voice and videoThe address the apps connect to for voice and video calls: wss://APP_DOMAIN/livekit behind the bundled Caddy with --profile calls, ws://localhost:7880 on your own computer, or your LiveKit Cloud address. Empty: chat sessions only. Super-admin → Settings → Calls takes precedence.
LIVEKIT_API_KEYFor voice and videoThe LiveKit API key: any long random string you choose for the bundled server (it reads the same key from .env), or the one LiveKit Cloud gives you.
LIVEKIT_API_SECRETFor voice and videoThe LiveKit API secret that signs every call token (openssl rand -hex 24 for the bundled server). Stored encrypted when set in Super-admin → Settings → Calls.
LIVEKIT_API_URLNoWhere the server calls LiveKit's room API to close each session's room when it ends. Empty: LIVEKIT_URL with ws turned into http. With the bundled server: http://livekit:7880.
LIVEKIT_BINDNoHost address of the bundled LiveKit's signalling port 7880 (127.0.0.1 = this server only; Caddy reaches it as livekit:7880). Media always uses 7881/tcp and 7882/udp: open both in the firewall.
Push messages (Firebase Cloud Messaging; empty = push off)
FCM_PROJECT_IDFor pushYour Firebase project id, with FCM_SERVICE_ACCOUNT_JSON. Empty: no push messages (the apps still update while open).
FCM_SERVICE_ACCOUNT_JSONNoYour Firebase service account key (Firebase console → Project settings → Service accounts → Generate new private key) as one line of JSON, with FCM_PROJECT_ID. Empty: no push messages. Easier: paste the file in Super-admin → Settings → Push, which takes precedence and stores it encrypted.
Email (SMTP; empty = emails are written to the app's log)
SMTP_HOSTFor emailYour email provider's SMTP server. Empty: emails are written to the app's log instead of being sent.
SMTP_PORTNoThe SMTP port. Default 587.
SMTP_USERNAMEFor emailThe SMTP user name.
SMTP_PASSWORDFor emailThe SMTP password or API key.
SMTP_SECURENostarttls (port 587, the default), tls (port 465) or none.
SMTP_FROMFor emailThe sender, for example Seerline <hello@example.com>. Use an address on a domain your provider has verified.
Network
APP_PORTNoThe port on this server where the app answers. Default 8080.
APP_BINDNoWhich 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_DOMAINWith CaddyThe domain Caddy gets an HTTPS certificate for: the host of APP_URL, for example app.example.com.
TRUSTED_PROXY_HOPSNoHow many reverse proxies in front of the app add the visitor's address to X-Forwarded-For. 1 = the bundled Caddy (the default in Docker); 0 = trust no proxy. Never set it higher than the proxies really in front of the app.
Advanced
COMPOSE_PROJECT_NAMENoOnly 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 Seerline folder.
SEARCH_INDEXINGNoon (the default): search engines may index the public pages (home, legal, sign-in), never the app or the API. off, for a staging copy: /robots.txt closes every page and every answer carries X-Robots-Tag: noindex, nofollow.
JOB_WORKERSNoBackground job workers in this server, 1 to 32. Default 4.
DRAIN_SECSNoFor zero-downtime deploys: seconds a stopping server reports itself unhealthy, so a proxy moves visitors to the new copy, before it exits. Default 0.
DEMO_MODENoOnly for a public demo: "true" adds the sample marketplace (25 experts, about 1,900 users with their sessions, money, reviews and reports) with one-click sign-ins (a user, an expert, an applicant and the read-only super-admin), makes sign-ups demo accounts and resets the data every night at 03:00 UTC. It does not turn on demo payments (see DEMO_PAYMENTS). Keep "false" on a live site.
DEMO_PAYMENTSNo"true" replaces Stripe with a demo checkout page (4242 4242 4242 4242 pays, 4000 0000 0000 0002 is declined), so wallet top-ups work without Stripe. Only this key turns it on. Never on a live site; the download ships "false".
DEMO_PHOTOSNoOptional sample art for the demo: a folder of expert portraits named <slug>.webp (elena-varga.webp, …). Not shipped with the item; when it is empty, or a portrait is missing, the demo draws an initials tile for that expert.
RUST_LOGNoHow much the server logs: info (the default), warn, error or debug.
Set by Docker, or for development
ASSET_ARCHIVENoFor your own zero-downtime deploys: a folder that keeps older builds' files, so pages still open in a browser keep working.
BINDNoThe address the server listens on. Default 0.0.0.0: plus PORT.
BUILD_TARGETNoHow Docker gets the program: built (the default, built on this server) or prebuilt (uses prebuilt/seerline, built elsewhere).
PORTSet by DockerThe port the server listens on inside its container (8080).
READY_FILENoFor your own zero-downtime deploys: the health check passes only once this file exists.
STRIPE_API_URLNoFor tests only: another address for Stripe's API. Default https://api.stripe.com.
WEB_DISTSet by DockerWhere the built web app is, when it is not packed into the program.

After you change .env, run docker compose up -d: Compose recreates the app container with the new values.

Server and web files

What is in the download. The apps' own folders are in chapter 26.

Folder or fileWhat it holds
apps/backend/The Rust server: one program, seerline, with the API, the billing engine, the background jobs and the built web app attached to it.
apps/frontend/The web app (React, React Router, Vite, Tailwind CSS): the public website, the install wizard and the admin panel.
migrations/The database schema as plain SQL files. The server applies new ones in name order when it starts (they are compiled into the program).
docker/The Dockerfile, docker-compose.yml (PostgreSQL, MinIO, the app, LiveKit and Caddy), the Caddyfile and livekit/livekit.yaml.
compose.yamlLets you run docker compose from the top folder, with the .env next to it.
Cargo.toml, Cargo.lock, rust-toolchain.toml, clippy.toml, deny.tomlThe Rust workspace, the exact versions of every crate, the compiler channel, the lint rules and the licence and advisory check (cargo deny check).
seerline_mobile_flutter/The two apps (chapter 20).
tools/rename.mjsGives the apps and the web app your name, ids, link scheme, colour and icons (chapter 22).
docs/This guide.

Inside the server (apps/backend/src)

FileWhat it does
main.rs, lib.rsThe commands (serve, migrate, health, seed-demo, reset-demo, pack) and the router: API, web app, health check and limits.
config.rs, settings.rsThe .env keys, and the admin's saved settings on top of them (kept in memory on every copy, reloaded when any copy saves).
billing.rs, ops.rsThe billing engine minute by minute, and the loop that runs it every two seconds on every server (chapter 11).
wallet.rs, payments.rs, stripe.rs, promos.rsWallets (available and held money, one ledger row per change), top-ups through Stripe Checkout, card refunds and promo codes.
earnings.rs, refunds.rsExpert earnings, payouts and refunds on sessions.
sessions.rs, experts.rs, directory.rs, calls.rsSessions as the apps read them, expert profiles and rates, the public directory, and LiveKit rooms and tokens.
auth.rs, crypto.rs, rate_limit.rsSign-in sessions and roles, passwords and secrets at rest, request limits.
jobs.rs, push.rs, email.rs, purge.rs, export.rsThe job queue, push and email, the daily purge and the personal-data export.
storage.rs, uploads.rs, realtime.rs, setup_check.rsFile storage, uploads with their limits, live updates, and the setup check.
demo.rs, demo/, sim.rsThe sample data and the public demo's simulator (chapter 40).
api/The /api/v1 routes, one file per area: auth, me, wallet, sessions, expert, public, events, webhooks and the admin_* files.

The API tests are in apps/backend/tests/api/, one file per area, with the shared helpers in harness.rs.

Inside the web app (apps/frontend/src)

FolderWhat it holds
routes.ts, routes/Every address and the page that draws it; routes/paths.ts holds the links used in code (and the app store links), routes/public.ts the pages built as HTML ahead of time.
pages/public/The public website.
pages/admin/The admin panel, one folder per area (experts, sessions, money, trust, users, settings…).
pages/install/, pages/auth/The install wizard, and staff sign-in and password pages.
api/, auth/, realtime/The API client (cookie, the x-seerline header, errors), who is signed in, and the live updates.
layout/, ui/, components/ui/The admin shell (sidebar, top bar), the shared parts (tables, sheets, fields, toasts) and the shadcn/ui blocks under them.
styles.cssColours, sizes and fonts as CSS variables for light and dark mode.

Working on the code

Without Docker you need Rust (the version in rust-toolchain.toml installs itself), PostgreSQL 15 or newer, and Node.js 24 with pnpm. Put APP_SECRET and DATABASE_URL in .env, then:

cd apps/backend && cargo run -- serve          # the API on http://localhost:8080
cd apps/frontend && pnpm install && pnpm dev   # the web app on http://localhost:5173, /api goes to 8080

To change the database, add a new file to migrations/ with a later timestamp in its name (YYYYMMDDHHMMSS_name.sql). Never edit a file that has already run on a server.

Run the tests

Seerline ships with its tests. Run them after any change and before you deploy it.

Server (Rust)

From the top folder:

cargo clippy --workspace --all-targets -- -D warnings
cargo test --workspace

The unit tests run anywhere. The API tests (more than 100 of them) run the whole server inside the test program against a real PostgreSQL. Without one they print "TEST_DATABASE_URL is not set: skipping" and pass. To run them, give them a login that may create databases. A throwaway one with Docker:

docker run -d --name seerline-test-db -e POSTGRES_PASSWORD=secret -p 127.0.0.1:5433:5432 postgres:17-alpine
TEST_DATABASE_URL=postgres://postgres:secret@127.0.0.1:5433/postgres cargo test --workspace
docker rm -f seerline-test-db

Each test makes its own database (named sl_t_…) and drops it at the end. A stand-in for Stripe answers on a local port, so no test reaches the internet. They cover sign-in and roles, the billing engine minute by minute (including several servers ticking the same session at once, which must charge each minute exactly once), the hold, refunds, payouts, top-ups and the Stripe webhook, uploads, settings, the purge, the export and the demo data. To run one test, add part of its name: cargo test -p seerline-server --test api my_stats.

Web app

In apps/frontend:

pnpm install
pnpm typecheck    # TypeScript
pnpm lint         # Biome
pnpm test         # unit tests (Vitest)

pnpm e2e runs the Playwright tests against a real server, never against your live one. Build the web app first (pnpm build), install the browsers once (pnpm exec playwright install), and start a server with DEMO_MODE=true on an empty database of its own, serving apps/frontend/dist/client (WEB_DIST). The tests use http://127.0.0.1:8080, or the address in E2E_BASE_URL: they check the public site, the read-only admin and the one-click sign-in inside a preview frame. A second, optional server (E2E_OWNER_URL: no demo mode, an empty database, INSTALL_TOKEN set to E2E_INSTALL_TOKEN and DEMO_PAYMENTS=true) runs the install wizard and the admin's own work: settings, categories, promo codes, staff, legal pages, a top-up re-check, a data export and an account deletion.

Apps (Flutter)

In seerline_mobile_flutter:

flutter analyze
flutter test

flutter test runs the models, the billing meter, the API client, the sample server and the screens of both apps, without a server. Two more test files talk to a real server in demo mode (DEMO_MODE and DEMO_PAYMENTS on) and are skipped unless you name it:

flutter test test/live_server_test.dart --dart-define=SEERLINE_LIVE_URL=http://127.0.0.1:8080
flutter test test/live_expert_test.dart --dart-define=SEERLINE_LIVE_URL=http://127.0.0.1:8080

The user test bills real minutes, so it takes about 75 seconds.

Extend it: a new endpoint and a new screen

A worked example, tested end to end: My stats, a screen in the user app showing how many sessions the user had, their paid minutes and what they spent. It takes one new API endpoint with its test, then a model, a screen and a test in the app.

1. The endpoint

Add the route to apps/backend/src/api/me.rs:

// apps/backend/src/api/me.rs, in routes(), under the other /me routes:
        .route("/me/stats", get(stats))

And the handler at the end of the same file. The Customer extractor lets only a signed-in user call it (anyone else gets 403 wrong_role); the query is one SQL statement that returns the JSON as it is.

/// `GET /api/v1/me/stats`: the user's ended sessions, their paid minutes and what they spent after refunds:
/// `{ sessions, minutes, spentCents }`.
async fn stats(State(state): State<AppState>, Customer(ctx): Customer) -> ApiResult<Json<Value>> {
    let v: Value = sqlx::query_scalar(
        "select json_build_object('sessions', count(*), 'minutes', coalesce(sum(minutes), 0),
                'spentCents', coalesce(sum(charged_cents - refunded_cents), 0))
         from sessions where user_id = $1 and status = 'ended'",
    )
    .bind(ctx.user.id)
    .fetch_one(&state.db)
    .await?;
    Ok(Json(v))
}

2. Its test

Add this test to apps/backend/tests/api/account.rs. It checks the empty answer, one real session (requested, accepted, one minute charged at $1.99, ended), and that an expert is refused:

// apps/backend/tests/api/account.rs (change the first import to: use crate::harness::{app, start};)
/// `GET /me/stats` counts the user's ended sessions only, and only a user may ask.
#[tokio::test]
async fn my_stats_count_ended_sessions() {
    let Some(t) = app().await else { return };
    let (mut ava, ava_id, _) = t.customer("ava@example.com").await;
    let none = ava.app_json(Method::GET, "/me/stats", json!(null)).await;
    assert_eq!(none.status, StatusCode::OK, "{}", none.json);
    assert_eq!(none.json, json!({ "sessions": 0, "minutes": 0, "spentCents": 0 }));

    let (mut mira, mira_id) = t.expert("mira@example.com", (199, 0, 0)).await;
    t.fund(ava_id, 2_000).await;
    let id = start(&mut ava, &mut mira, mira_id, "chat").await;
    let end = ava.app_json(Method::POST, &format!("/sessions/{id}/end"), json!({})).await;
    assert_eq!(end.status, StatusCode::OK, "{}", end.json);
    let one = ava.app_json(Method::GET, "/me/stats", json!(null)).await;
    assert_eq!(one.json, json!({ "sessions": 1, "minutes": 1, "spentCents": 199 }));

    let expert = mira.app_json(Method::GET, "/me/stats", json!(null)).await;
    assert_eq!(expert.status, StatusCode::FORBIDDEN);
    assert_eq!(expert.code(), "wrong_role");
    t.finish().await;
}
TEST_DATABASE_URL=postgres://postgres:secret@127.0.0.1:5433/postgres cargo test -p seerline-server --test api my_stats
test account::my_stats_count_ended_sessions ... ok

3. The model and the call in the app

In seerline_mobile_flutter, a model that reads the answer (the json_read helpers turn a missing key into 0):

// lib/domain/models/my_stats.dart (and add: export 'my_stats.dart'; to lib/domain/models/models.dart)
import 'package:seerline/domain/models/json_read.dart';

/// The user's totals (`GET /me/stats`): ended sessions, paid minutes and what they spent after refunds.
class MyStats {
  const MyStats({this.sessions = 0, this.minutes = 0, this.spentCents = 0});

  factory MyStats.fromJson(Object? json) {
    final j = asJson(json);
    return MyStats(
      sessions: readInt(j, 'sessions'),
      minutes: readInt(j, 'minutes'),
      spentCents: readInt(j, 'spentCents'),
    );
  }

  final int sessions;
  final int minutes;
  final int spentCents;
}

Then the address, a repository method and a provider, each next to its neighbours:

// lib/core/services/api/api_paths.dart, next to intake:
  static const meStats = '/me/stats';

// lib/core/services/data/account_repository.dart, in AccountRepository:
  /// The user's totals (`GET /me/stats`).
  Future<MyStats> stats() async => MyStats.fromJson(await api.get(ApiPaths.meStats));

// lib/core/providers/market_providers.dart, under intakeProvider:
final myStatsProvider = FutureProvider.autoDispose<MyStats>((ref) => ref.watch(accountRepositoryProvider).stats());

4. The screen

// lib/features/user/account/pages/my_stats_page.dart
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:lucide_icons_flutter/lucide_icons.dart';

import 'package:seerline/components/components.dart';
import 'package:seerline/core/providers/market_providers.dart';
import 'package:seerline/core/theme/app_theme.dart';
import 'package:seerline/domain/models/models.dart';
import 'package:seerline/features/user/common/user_kit.dart';

/// "My stats": how many sessions the user had, their paid minutes and what they spent.
class MyStatsPage extends ConsumerWidget {
  const MyStatsPage({super.key});

  @override
  Widget build(BuildContext context, WidgetRef ref) {
    final stats = ref.watch(myStatsProvider);
    return UserPage(
      title: 'My stats',
      body: switch (stats) {
        AsyncData(:final value) => ListView(
          padding: AppSpacing.screen,
          children: [
            RowsCard(
              children: [
                SlListRow(icon: LucideIcons.messagesSquare, title: 'Sessions', value: '${value.sessions}', showChevron: false),
                SlListRow(icon: LucideIcons.clock, title: 'Paid minutes', value: '${value.minutes}', showChevron: false),
                SlListRow(icon: LucideIcons.wallet, title: 'Spent', value: Money.format(value.spentCents), showChevron: false),
              ],
            ),
          ],
        ),
        AsyncError() => SlErrorState(onRetry: () => ref.invalidate(myStatsProvider)),
        _ => const Center(child: CircularProgressIndicator()),
      },
    );
  }
}
// lib/core/router/app_router.dart: import the page, then add it to the user app's routes,
// next to page('/favourites', ...):
        page('/stats', (_) => const MyStatsPage()),

Open it from anywhere in the user app with context.push('/stats'), for example from a new row on the Profile tab.

5. The app test

// test/my_stats_test.dart
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_test/flutter_test.dart';

import 'package:seerline/core/providers/market_providers.dart';
import 'package:seerline/core/theme/app_theme.dart';
import 'package:seerline/domain/models/models.dart';
import 'package:seerline/features/user/account/pages/my_stats_page.dart';

void main() {
  test('MyStats reads the server answer, and zeros when a key is missing', () {
    final s = MyStats.fromJson({'sessions': 3, 'minutes': 42, 'spentCents': 7560});
    expect((s.sessions, s.minutes, s.spentCents), (3, 42, 7560));
    expect(MyStats.fromJson(const {}).minutes, 0);
  });

  testWidgets('My stats shows the three totals', (tester) async {
    await tester.pumpWidget(
      ProviderScope(
        overrides: [myStatsProvider.overrideWith((ref) async => const MyStats(sessions: 3, minutes: 42, spentCents: 7560))],
        child: MaterialApp(theme: AppTheme.light(), home: const MyStatsPage()),
      ),
    );
    await tester.pump();
    expect(find.text('3'), findsOneWidget);
    expect(find.text('42'), findsOneWidget);
    expect(find.text(Money.format(7560)), findsOneWidget);
  });
}
flutter test test/my_stats_test.dart
00:00 +2: All tests passed!
Sample mode

With SAMPLE_DATA=true the app answers from its built-in sample server, which does not know /me/stats (it answers 404 "No such endpoint in sample mode"). Point the app at your server, or add the address to the route table in lib/core/services/api/sample/sample_backend.dart.

The same steps add anything else: a route and handler in the right api/ file (with Customer, ExpertCtx or Platform deciding who may call it), a test with the harness, then a model, a repository method, a provider and a page in the app. For the web admin, add a page under apps/frontend/src/pages/admin/ and its address in src/routes/admin.ts.

API reference

The website, the admin panel, both apps and your own tools use the same API under /api/v1. These 147 addresses are listed from the server code when the release is built.

  • JSON in and out, with camelCase keys. Times are ISO 8601 in UTC, money is whole cents of the platform currency (the keys end in Cents), ids are UUIDs.
  • The web signs in with the sl_session cookie (HttpOnly). Every change made with that cookie must carry the header x-seerline: 1, which another site cannot add; the web app sends it for you.
  • The apps send "client": "app" and "role": "user" or "expert" to POST /api/v1/auth/login (and register). The answer carries a token (with tokenExpiresAt), sent on every later call as Authorization: Bearer <token>. An account for the other app gets 403 wrong_app.
  • Errors look like {"error": {"code": "insufficient_balance", "message": "…", "details": {…}}}. The code never changes and is safe to branch on; the message can be shown as it is. Common codes: bad_request (400; details.field names the field), unauthorized (401), wrong_role and forbidden (403), not_found (404), conflict (409), rate_limited (429, with a Retry-After header), maintenance and unavailable (503). The money refusals (402 insufficient_balance, 409 expert_busy…) are in chapter 11.
  • Admin lists take ?page= and ?size= (50 by default, up to 200) and answer rows and total.
  • Live updates: GET /api/v1/events is a Server-Sent Events stream of the signed-in person's sessions, chat messages, wallet and notifications, so open screens update at once. Every server copy delivers to every open screen.
  • Health: GET /api/health answers 200 while the server is serving (Docker and your proxy use it).

Who may call it: User and Expert are app accounts (some expert routes need an approved expert). Admin is staff, with the limits of each platform role in chapter 34; rows marked "the demo viewer reads" are also open to the read-only role.

MethodAddressWho may call itWhat it does
System
GET/api/healthAnyone200 while the server runs, 503 while it hands over to a new copy during a deploy
GET/api/app-versionAnyoneThe running build's version; open pages compare it with their own to offer a reload after a deploy
GET/robots.txtAnyoneTells search engines which pages they may index and where the sitemap is: the public pages, or none with SEARCH_INDEXING=off
GET/sitemap.xmlAnyoneThe public pages for search engines: the fixed pages, filled legal pages, categories and listed experts by their page slug (404 with SEARCH_INDEXING=off)
Public pages, install and inbound webhooks
GET/api/v1/public/configAnyoneThe brand, sign-up modes, demo sign-ins, the money rules the apps show (currency, top-up packs, minimum minutes, free first session), the running promo code's banner (promoBanner, see [crate::promos::banner]), the app links and whether calls are set up (installed: false sends every page of the web app to the install wizard)
GET/api/v1/public/categoriesAnyoneThe active categories with how many listed experts each has, how many are online now and the lowest rate a minute among them (minRateCents, null when none)
GET/api/v1/public/expertsAnyoneThe public expert directory: search, category, mode, language, price, online and rating filters, four sorts and paging; a signed-in user also sees their favourites
GET/api/v1/public/experts/{id}AnyoneOne listed expert's card (by id or page slug) with bio, skills, hours, location, timezone and ratingBreakdown
GET/api/v1/public/experts/{id}/reviewsAnyoneA listed expert's visible reviews (by id or page slug), newest first: { items, next }
GET/api/v1/public/legal/{slug}AnyoneOne legal page, with when the legal pages were last saved
GET/api/v1/install/statusAnyone, until the install is done (install token)Whether the install wizard has run, and its steps (database, admin account, payments and calls, both optional and set from the admin's settings once the admin exists, finish) with the Stripe webhook address to paste into Stripe
POST/api/v1/install/checkAnyone, until the install is done (install token)Checks the install token and the setup before the wizard's last step
POST/api/v1/install/completeAnyone, until the install is done (install token)Finishes the install: the super-admin, the brand and (when none are saved) the starter legal texts (runs once)
GET/api/v1/public/homeAnyone{ stats { experts, online, reviews, ratingAvg }, online: ExpertCard[] (4, free first), categories (as /public/categories), reviews (the 3 newest five-star reviews with words), spotlight }
GET/api/v1/public/categories/{slug}AnyoneOne active category as /public/categories lists it (404 otherwise)
GET/api/v1/public/topups/{id}AnyoneThe page a card payment returns to (the top-up id is long and random, so no sign-in): { ref, status, amountCents, bonusCents, promoCode, cardLabel, paidAt, walletCents (the balance now), emailMasked, currency }
GET/api/v1/public/logo/{file}AnyoneThe uploaded brand logo (no sign-in; long cache, the name changes with the file)
POST/api/v1/webhooks/stripeStripe (signed webhook)Stripe's signed events: a paid top-up is credited once, an expired one is closed
Sign-in and account
POST/api/v1/auth/registerAnyoneCreates an account from an app ("client": "app", role: user or expert) with a session token; an expert starts with a draft application. The web admin has no sign-up
POST/api/v1/auth/loginAnyoneSigns in with email and password; "client": "app" (with role: user or expert) answers a session token for the apps instead of a cookie
POST/api/v1/auth/logoutSigned inSigns out of this browser or app (the session and its push token go)
GET/api/v1/auth/meSigned inThe signed-in person, their expert application (expert, and its state alone as expertStatus) and what they may do
GET/api/v1/auth/sessionAnyoneThe signed-in person like /auth/me, or { me: null } when signed out (always 200)
POST/api/v1/auth/forgotAnyoneEmails a password reset link when the email belongs to an account
POST/api/v1/auth/resetAnyoneSets a new password with a reset link and signs in (each link works once)
GET/api/v1/auth/reset/{token}AnyoneWhose link this is (404 when it expired or was used)
POST/api/v1/auth/passwordSigned inChanges the password (the current one is asked for); other sessions end
POST/api/v1/auth/demoAnyone, public demo onlyOne-click demo sign-in as the user, the expert, the applicant or the read-only super-admin; "client": "app" answers a session token
POST/api/v1/me/push-tokenSigned inSaves this device's push token (token, platform: android, ios or web, app: user or expert), one per session
DELETE/api/v1/me/push-tokenSigned inStops push messages to this device (the person turned them off)
GET/api/v1/meSigned inThe signed-in person's profile: name, email, phone, photo, push choices (notifications: {sessions, chat, wallet, offers, favourites}) and whether the free first session is used
PATCH/api/v1/meSigned inChanges any of name, phone, avatarUrl and notifications (booleans per kind); answers the profile
DELETE/api/v1/meSigned inDeletes the person's own account (password asked, or the typed word DELETE in the apps); not while a session is open; unspent top-ups go back to the card, it signs out everywhere and is purged after 30 days
GET/api/v1/me/intakeUserThe user's intake (birth details and question), or null when there is none
PUT/api/v1/me/intakeUser{ fullName?, birthDate? (YYYY-MM-DD), birthTime? (HH:MM:SS), birthPlace?, question?, consent } saves the intake
GET/api/v1/me/exportSigned inEverything Seerline keeps about the signed-in person, in one JSON object (see [crate::export])
GET/api/v1/me/favouritesUser?cursor= → { items, next }, the user's favourite experts newest first, 20 a page (online and busy now, rates, languages, categories, whether they notify)
PUT/api/v1/me/favourites/{expert}User{ notifyOnline? } keeps an approved expert as a favourite (and whether to tell the user when they come online)
DELETE/api/v1/me/favourites/{expert}UserStops keeping an expert as a favourite
GET/api/v1/me/followsUserThe categories the user follows ("tell me when one joins"): { categories: [{ id, slug, name, icon, since }] }
PUT/api/v1/me/follows/categories/{category}UserPUT /api/v1/me/follows/categories/{category} (id or slug): the user hears once, in the inbox and by push, about each new expert approved in this category
DELETE/api/v1/me/follows/categories/{category}UserStops following a category
Wallet and top-ups (user app)
GET/api/v1/walletUser{ availableCents, heldCents, currency, packs, minCents, maxCents, entries, next }: the balances, the top-up choices and a page of the ledger, newest first
GET/api/v1/wallet/topupsUserThe user's top-ups, newest first
POST/api/v1/wallet/topupsUserOpens a Stripe Checkout page for a top-up; the wallet is credited only when Stripe confirms the payment
GET/api/v1/wallet/topups/{id}UserOne top-up (the return page polls it)
POST/api/v1/wallet/promoUser{ code, amountCents? } checks a promo code for this user: { code, bonusBps, bonusCents, minTopupCents, maxBonusCents, endsAt, perUserLimit, usesLeft } or 422 promo_invalid (for a code that has ended, details.suggest names a live one, or null)
GET/api/v1/pay/demo/{session}AnyoneThe demo checkout page (DEMO_PAYMENTS="true" only): a test card form that pays with 4242 4242 4242 4242 and declines 4000 0000 0000 0002
POST/api/v1/pay/demo/{session}Anyone{ card } pays a demo checkout with a test card (402 card_declined for the declined card)
Sessions, chat and calls
GET/api/v1/sessionsUserThe user's sessions, newest first (status=open|ended, 30 a page with cursor)
POST/api/v1/sessionsUserRequests a session with an online expert: the minimum session's cost is held in the wallet first (402 with the missing amount), one open session per user and per expert
GET/api/v1/sessions/{id}The session's user or expertOne session as the signed-in person sees it (the user's side with their wallet and minutes left; the expert's side with their share and the shared intake)
POST/api/v1/sessions/{id}/cancelUserThe user cancels a request (or an accepted session that has not started): nothing is charged and the hold goes back
POST/api/v1/sessions/{id}/heartbeatThe session's user or expertEach person's app says it is there every 10 seconds; minutes are charged when both are, billing pauses when one drops and the session ends after the reconnect grace
POST/api/v1/sessions/{id}/endThe session's user or expertEither person ends the session (a waiting request: the user cancels, the expert declines)
GET/api/v1/sessions/{id}/messagesThe session's user or expertThe chat of a session, oldest first (after = only newer ones), for its two people
POST/api/v1/sessions/{id}/messagesThe session's user or expert{ body } or { mediaId } (a picture the sender uploaded) while the session is accepted or live
POST/api/v1/sessions/{id}/call-tokenThe session's user or expertA LiveKit token for one of the session's two people, for its room only, with microphone and camera as the mode allows (10 minutes)
POST/api/v1/sessions/{id}/reviewUser{ rating: 1–5, body?, tags? }, the user's one review of an ended session that was billed (409 already_reviewed the second time)
POST/api/v1/sessions/{id}/reportThe session's user or expert{ reason: abuse|fraud|quality|technical|other, details?, block? } from either person of a session, once each (409 already_reported); block also blocks the other person
POST/api/v1/sessions/{id}/refund-requestUser{ reason, amountCents?, minutesFrom?, minutesTo?, details? }, the user asks for money back (all, part of what is left, or what a range of billed minutes cost) within the refund window (422 refund_window_closed, nothing_to_refund, refund_too_large; 409 refund_open)
Expert app
GET/api/v1/expert/profileExpert (any application state)The expert's whole profile and application (status, rates, categories, documents, rating, presence)
PATCH/api/v1/expert/profileExpert (any application state)Any of headline, bio, skills, languages, experienceYears, categoryIds, rates { chat, voice, video } (whole cents per minute inside the admin's limits, null = not offered; 422 rate_out_of_range) and hours
POST/api/v1/expert/documentsExpert (any application state){ mediaId, kind: id|certificate|selfie|other, label?, replaces? } adds one of the expert's own uploads to the application, or puts it in place of document replaces (a sharper ID photo: the staff mark starts over)
DELETE/api/v1/expert/documents/{id}Expert (any application state)Removes a document from the application (the file stays uploaded)
POST/api/v1/expert/application/submitExpert (any application state)Sends a draft (or rejected) application to the admin (422 application_incomplete lists the missing parts)
POST/api/v1/expert/onlineExpert (approved){ online: true|false }
GET/api/v1/expert/sessionsExpert (any application state)The expert's sessions and requests, newest first (status=open|ended, period in the expert's time zone), with the period's totals { sessions, minutes, chargedCents, commissionCents, expertCents } over billed sessions
POST/api/v1/expert/sessions/{id}/acceptExpert (approved)The expert accepts a waiting request; billing starts when the user is still in the waiting room
POST/api/v1/expert/sessions/{id}/declineExpert (approved){ reason?: notes|topic|break|other, awayMinutes? } declines a waiting request (the user's hold goes back; only the expert and staff see the reason)
GET/api/v1/expert/earningsExpert (any application state)Pending, available and paid balances, the payout minimum and the earnings of the period (in the expert's time zone, all without one), 50 a page, each with its session, client, minutes, fee and what a refund took back, and the period's totals
GET/api/v1/expert/payoutsExpert (any application state)?cursor= → the expert's payout requests newest first, 20 a page (items, next), and on every page what was paid out in all and since when, what is available now, the minimum, and where payouts go (payoutMethod)
POST/api/v1/expert/payoutsExpert (any application state)The expert asks for a payout of available earnings (one open request at a time)
GET/api/v1/expert/todayExpert (any application state)The Today screen
GET/api/v1/expert/ratesExpert (any application state)The expert's rates, the admin's limits per mode, the fee they pay (feeBps), which modes they may offer (modes), and what experts in their first category with a similar rating charge (peers { category, ratingNear, chat|voice|video: { lowCents, highCents, count } | null }, the middle half of at least three rates; null when the expert has no category)
GET/api/v1/expert/reviewsExpert (any application state)The expert's visible reviews, newest first, 20 a page (filter: needs_reply, low = 1–3 stars, else all): { items: [{ id, authorName, rating, body, tags, reply, repliedAt, replyEditableUntil, mode, minutes, sessionId, sessionRef, createdAt }], next, counts { needsReply, all, low }, ratingAvg, ratingCount, fiveStarPct }
POST/api/v1/expert/reviews/{id}/replyExpert (approved){ reply }, the expert's one public answer to a review (409 already_replied the second time; change it with PUT for a day)
PUT/api/v1/expert/reviews/{id}/replyExpert (approved){ reply } writes the reply, or changes it within 24 hours of when it was first written (409 reply_locked after that)
Files, live events and demo
GET/api/v1/notificationsSigned inThe person's notifications, newest first (30 a page), with the unread count
POST/api/v1/notifications/readSigned in{ ids? } marks notifications read (all without ids)
GET/api/v1/eventsSigned inLive updates (Server-Sent Events): session requests and changes, chat messages, wallet changes and notifications, a ping every 25 seconds and refetch when a screen fell behind
POST/api/v1/mediaSigned inUploads one of the person's own files (multipart file; typed by content, size limits per kind): an expert's ID or certificate, a chat picture, a profile photo
GET/api/v1/media/{id}AnyoneA file, to its owner, to platform staff, to the other person of a session whose chat shows it, or to anyone with a signed link (?exp=&sig=) that has not ended
GET/api/v1/media/{id}/linkSigned inA signed address for the file that works without a sign-in for [LINK_MINUTES] (only for someone who may open the file)
Admin
GET/api/v1/admin/settingsAdmin (the demo viewer reads)The platform settings (secrets masked), server facts and storage stats
POST/api/v1/admin/settings/branding/logoAdminThe brand logo (PNG, SVG or WebP up to 1 MB, checked by content), served publicly as the logo and favicon
PUT/api/v1/admin/settings/{section}AdminSaves one settings section (secrets are sealed; an empty secret keeps .env)
GET/api/v1/admin/emailsAdmin (the demo viewer reads)The platform emails with their built-in and saved wording, for the email editor
GET/api/v1/admin/setup-checkAdmin (the demo viewer reads)The setup check rows
POST/api/v1/admin/setup-check/{id}/testAdminTests one setup check row against the real service
GET/api/v1/admin/jobsAdmin (the demo viewer reads)Background jobs (status and kind filters) with counts per status
POST/api/v1/admin/jobs/{id}/retryAdminQueues a failed job again
POST/api/v1/admin/demo-data/removeAdminRemoves the demo data (demo-marked rows only)
GET/api/v1/admin/applicationsAdmin (the demo viewer reads)Every expert who applied (status=submitted|approved|rejected|all, q, category), oldest waiting first: { rows, total, page, size, counts { waiting, approved, rejected, all } }
GET/api/v1/admin/expertsAdmin (the demo viewer reads)Approved (and suspended) experts (status=all|online|suspended, q, category, minRating), online first then by rating: { rows, total, page, size, counts { all, online, suspended }, summary { approved, online, inSession } }
GET/api/v1/admin/experts/{id}Admin (the demo viewer reads)An expert's sheet (see [sheet])
PATCH/api/v1/admin/experts/{id}Admin{ commissionBps (0–10000, null = the platform's), commissionUntil (a date; null = no end), featured, videoAllowed, rates? }
POST/api/v1/admin/experts/{id}/decisionAdminApproves, rejects, asks an applicant for a change, suspends (for some days or until reinstated) or reinstates an expert; a suspension takes them offline and ends their live session, and an approval tells the category's followers once
POST/api/v1/admin/documents/{id}/reviewAdmin{ review: readable|checked|matches|unreadable|"" } marks one application paper (only staff see it)
GET/api/v1/admin/overviewAdmin (the demo viewer reads){ today, daily, live { count, rows }, experts { total, online, inSession }, waiting, needsAttention, commissionBps, stripeMode, currency, timezone } (see the API contract); format=csv downloads the daily rows (not for the read-only viewer)
GET/api/v1/admin/countsAdmin (the demo viewer reads)The badges in the admin's menu: expert applications, refund and payout requests waiting, open reports, live sessions and online experts
GET/api/v1/admin/searchAdmin (the demo viewer reads)Up to 10 matches across sessions (SL-…), people (name or email), top-ups (TU-…), refunds (RF-…), payouts (PO-…) and reports (RP-…): { items: [{ kind, id, title, detail, href }] }
GET/api/v1/admin/ledgerAdmin (the demo viewer reads)Every cent in and out of user wallets, newest first (kind=all|top_up|session|refund| adjustment, q, user, period=today|yesterday|7d|month|all, group=none lists each billed minute): { rows, total, page, size, counts { all, top_up, session, refund, adjustment, openRefunds }, stats }; format=csv downloads the rows
GET/api/v1/admin/wallets/{user}Admin (the demo viewer reads)A user's balances and ledger as the user app shows it (cursor pages)
POST/api/v1/admin/wallets/{user}/adjustAdmin{ amountCents (signed: credit or debit), reason: goodwill|correction| refund|promo|other, note?, key? } adds to or takes from a user's available balance (never below zero: 422 insufficient_balance)
GET/api/v1/admin/topupsAdmin (the demo viewer reads)Top-ups, newest first (period=today|7d|all, status=paid|pending|failed|expired, q = user, card's last 4 or TU number, user): { rows, total, page, size, counts { today, last7, all }, stats }
POST/api/v1/admin/topups/{id}/refundAdminRefunds unspent top-up money to the card (claimed first; undone when Stripe refuses; refused while Settings switch card refunds off)
POST/api/v1/admin/topups/{id}/recheckAdminAsks Stripe about a pending (or failed) top-up now and settles it the way the webhook would: paid → credited once (the same path, so asking again changes nothing), ended unpaid → expired, still open → left pending
GET/api/v1/admin/refundsAdmin (the demo viewer reads)Refund requests, waiting first then newest (status=waiting|decided|approved| rejected|all, q = user, expert, RF or SL number, expert): { rows, total, page, size, counts { waiting, decided, all }, stats }
GET/api/v1/admin/refunds/{id}Admin (the demo viewer reads)One refund request (as in the list) with preview: what approving amountCents (default: what was asked) would move: the user's wallet before and after, the part taken back from the expert's pending earning (none once it is available: the platform pays it all), the fee given back and what the session has charged after
POST/api/v1/admin/refunds/{id}/approveAdminApproves all or part of a refund request; the wallet is credited once and the expert's pending share shrinks
POST/api/v1/admin/refunds/{id}/rejectAdmin{ note? } rejects a refund request (the note is sent to the user)
GET/api/v1/admin/payoutsAdmin (the demo viewer reads)Payout requests, waiting first then newest (status=requested|paid|rejected|all, period=month|all, q = expert or PO number, expert): { rows, total, page, size, counts { requested, paid, rejected, all }, stats }; format=csv is the export for the bank (admins only)
GET/api/v1/admin/payouts/{id}Admin (the demo viewer reads)One payout with the checks staff make before sending it: the expert's balances and first paid payout, what was available when they asked, the last three paid payouts (and whether they went to the same account) and refund requests still open on the expert's sessions
POST/api/v1/admin/payouts/{id}/paidAdmin{ reference, sentOn? (date), note? } marks a payout as sent; the expert gets a push with the reference (409 already_decided)
POST/api/v1/admin/payouts/{id}/rejectAdmin{ note? } sends a payout back: the money returns to the expert's available balance and the note tells them why
GET/api/v1/admin/sessionsAdmin (the demo viewer reads)Sessions, newest first, paged (q = session number, client or expert; mode, category slug, expert; status=live|reconnecting|ended|lost|user|expert|balance|admin|missed; period=today|yesterday|7d|all)
GET/api/v1/admin/sessions/{id}Admin (the demo viewer reads)One session with every billed minute (billing), the wallet entries it made (walletEntries: the hold, each minute, the release, top-ups made in it, refunds), the user's email, the expert's rating and categories, the call room and how many chat messages it has
POST/api/v1/admin/sessions/{id}/endAdminEnds a live session or request now (admin); the hold left goes back
POST/api/v1/admin/sessions/{id}/noticeAdmin{ body } puts a message from support in the session's chat and tells both people (409 session_ended once it has ended)
GET/api/v1/admin/sessions/{id}/messagesAdmin (the demo viewer reads)The chat of a session that has a refund request or a report (403 not_disputed otherwise), with each sender's name; phone numbers and emails are masked for every reader
POST/api/v1/admin/sessions/{id}/refundAdmin{ fromMinute, toMinute, note? } gives back what those billed minutes cost when nobody asked (the same split as approving a request); answers the session in full
GET/api/v1/admin/reportsAdmin (the demo viewer reads)Reports, open first then newest (status=open|closed|all, q = a name, RP or SL number, reason): { rows, total, page, size, counts { open, closed, all } }
GET/api/v1/admin/reports/{id}Admin (the demo viewer reads)One report with the record of the person it is about: since when, categories and rating (experts), their reports in the last 90 days with the outcomes, refunds on their sessions and their pending earnings
POST/api/v1/admin/reports/{id}/decisionAdmin{ action: dismiss|warn|suspend|remove|refund, days?, note?, amountCents? } closes an open report: dismiss (no action), warn (the person is told the rule), suspend for days (offline, no requests until then), remove (suspended until staff lift it), or refund the user (the open refund request on the session is approved, else a new one is made and approved)
GET/api/v1/admin/reviewsAdmin (the demo viewer reads)Reviews, newest first (filter=all|low|hidden, q = text, author or expert, expert): { rows, total, page, size, counts { all, low, hidden } } (low = 1 or 2 stars)
POST/api/v1/admin/reviews/{id}/hideAdmin{ hidden: true|false, reason? } hides a review that breaks the rules (it stays in the log) or shows it again; the expert's rating is kept from the visible ones
GET/api/v1/admin/promosAdmin (the demo viewer reads)Promo codes, newest first (status=active|scheduled|ended|paused|all, q = code): { rows, total, page, size, counts, stats } (this month's bonus, share of top-ups with a code, free first sessions and what they cost, today's most used code)
POST/api/v1/admin/promosAdmin{ code, bonusBps (1–10000) | bonusCents (fixed), maxBonusCents?, minTopupCents?, maxRedemptions?, perUserLimit?, startsAt?, endsAt?, firstTopupOnly?, banner?, withFreeSession?, description? } adds a promo code (409 when the code exists); a running one is offered once to the users who want offers
PATCH/api/v1/admin/promos/{id}AdminAny of active (pause or resume; resuming offers a code not offered yet), endsAt (null = no end), banner, description, maxRedemptions, perUserLimit, withFreeSession
DELETE/api/v1/admin/promos/{id}AdminRemoves a code nobody used (409 promo_used: pause it instead)
GET/api/v1/admin/categoriesAdmin (the demo viewer reads)Every category in its order: { items, summary { shown, hidden } }
POST/api/v1/admin/categoriesAdmin{ name, slug?, description?, icon?, active? } adds a category at the end
POST/api/v1/admin/categories/orderAdmin{ ids: [...] } puts the categories in this order (others keep theirs after them)
PATCH/api/v1/admin/categories/{id}AdminAny of name, description, icon, sortOrder, active (hidden categories keep their experts but disappear from the apps and the website)
DELETE/api/v1/admin/categories/{id}AdminRemoves a category no expert and no session uses (409 category_used: hide it instead)
GET/api/v1/admin/usersAdmin (the demo viewer reads)People, newest first (kind=user|expert|staff, role=platform, status=active| suspended|in_session, wallet=positive|zero, q = name, email or id): { rows, total, page, size, counts { all, inSession, suspended, joinedWeek, users, experts, staff, platform } } (all, inSession, suspended and joinedWeek count the chosen kind; the kind counts count everyone); format=csv downloads (not for the viewer)
GET/api/v1/admin/users/{id}Admin (the demo viewer reads)A person's sheet: the account, birth details (masked for the viewer), wallet and totals (topped up, bonus, spent, refunded, sessions, minutes), the open refund, the 10 newest sessions, the 5 newest wallet lines (a session's minutes as one line) and the top-ups whose unspent money can go back to the card
PATCH/api/v1/admin/users/{id}Admin{ status: active|suspended, days?, reason?, name? }
POST/api/v1/admin/users/{id}/reset-passwordAdminEmails the person a link to choose a new password (works for an hour)
GET/api/v1/admin/users/{id}/exportAdmin (the demo viewer reads)Everything kept about one person, as GET /me/export gives them, for a super admin only (403 for support and the read-only viewer); kept in the audit log
POST/api/v1/admin/users/{id}/deleteAdmin{ reason } (required, kept in the audit log), for a deletion asked for by email
GET/api/v1/admin/staffAdmin (the demo viewer reads)The people who can open the admin: { rows: [{ user, platformRole, can, lastActiveAt, invitedAt, invitedBy, invitePending, isDemo }] } (super admins first)
POST/api/v1/admin/staff/inviteAdmin{ email, name?, role: admin|support|viewer } gives a person admin access: an existing account gets the role; a new address gets a staff account and an email with a link to choose a password (works for 7 days)
PATCH/api/v1/admin/staff/{id}Admin{ role } changes a staff member's role (not your own)
DELETE/api/v1/admin/staff/{id}AdminRemoves a person's admin access (not your own; signs them out)
GET/api/v1/admin/auditAdmin (the demo viewer reads)Every change staff made, newest first (q = who, what or where): { rows: [{ id, at, actor { id, name }, action, text, target }], total, page, size }

Database

PostgreSQL (version 17 in the Docker setup; 15 or newer works). The schema is the SQL in migrations/, applied by the server when it starts. These 35 tables are listed from the migrations when the release is built.

  • Ids are UUIDs, times are stored in UTC, and money is whole cents.
  • Money is never edited in place. Every wallet change is a row in wallet_tx with its own unique key, so a retried step can never apply twice; each paid minute is one row in session_minutes, keyed by session and minute number.
  • A deleted account keeps its row, marked deleted, for 30 days; then the daily purge deletes it or blanks it (chapter 37). Sessions, ledger rows and payouts stay for your accounts.
TableWhat it holdsKeysPoints to
Accounts and sign-in
usersEvery person: users (the Seerline app), experts (the expert app) and platform staff, with their super-admin role (none, admin or viewer), push choices and whether the free first session is usedprimary key id; unique email (any case), when deleted_at is null–
auth_sessionsSigned-in browsers and apps (only a hash of the cookie or Bearer token is stored), with the app they signed in fromprimary key id; unique token_hashusers
push_tokensThe push token of the device each app session runs on (user or expert app), removed with the sessionprimary key id; unique auth_session_id; unique tokenauth_sessions, users
password_resetsPassword reset links (hashed, valid for one hour, used once)primary key id; unique token_hashusers
rate_limitsFixed-window counters for sign-in, sign-up and password reset limits (keyed by a hash)primary key key–
notificationsThe in-app notification list of each person (requests, chat, wallet, payouts), read or notprimary key idusers
Experts and categories
categoriesThe marketplace's categories (astrology, tarot and so on): data, edited by the super-adminprimary key id; unique slug–
expertsEach expert's profile and application (draft, submitted, approved, rejected, suspended), rates per minute for chat, voice and video, commission override, presence and ratingprimary key user_id; unique slug, when slug <> ''users
expert_categoriesWhich categories an expert works inprimary key expert_id + category_idexperts, categories
expert_documentsThe ID and certificates an expert sent with the application (private files, opened by the super-admin through expiring links)primary key id; unique expert_id + media_idexperts, media
user_intakesA user's birth details and question, shared with an expert only when a request says so and the user consentedprimary key user_idusers
favouritesA user's favourite experts, and whether to tell the user when one comes onlineprimary key user_id + expert_idusers
category_followsCategories a user follows to hear once about each new expert approved in themprimary key user_id + category_idusers, categories
category_follow_noticesWhich user was already told about which new expert (once per expert)primary key user_id + expert_idusers
Sessions
sessionsEvery request and session between a user and an expert: mode, rate and commission fixed at the request, status, the money held, charged, refunded and split, and the presence times billing runs onprimary key id; unique expert_id, when status <> 'ended'; unique user_id, when status <> 'ended'; unique ref_nousers, categories
session_minutesEach billed minute once (one row per session and minute number): charged, commission, the expert's share, promo cost and how much came from the holdprimary key session_id + minute_nosessions
messagesThe chat of a session (text, pictures, system lines)primary key idsessions, users, media
reviewsA user's one review of a billed session, the expert's reply, hidden or notprimary key id; unique session_idsessions, users
reportsReports about a session from either person, once eachprimary key id; unique session_id + reporter_id; unique ref_nosessions, users
blocksBlocks between two people (made with a report): neither sees or meets the other againprimary key blocker_id + blocked_idusers
Wallets and top-ups
walletsEach user's wallet: money available and money held for open sessionsprimary key user_idusers
wallet_txEvery change to a wallet with its balances after it (top-ups, promo bonuses, holds, releases, minute charges, refunds, adjustments, card refunds); a unique key applies each one onceprimary key id; unique idem_keyusers, sessions, topups
topupsWallet top-ups through Stripe Checkout: pending until Stripe confirms the payment, then paid (credited once)primary key id; unique stripe_session_id; unique ref_nousers, promo_codes, sessions
promo_codesTop-up promo codes: bonus percentage and cap, minimum top-up, limits and datesprimary key id–
promo_redemptionsEach promo bonus given, one per top-upprimary key id; unique topup_idpromo_codes, users, topups
card_refundsUnspent top-up money refunded to the card: claimed first, then done at Stripe or undone when Stripe refusesprimary key idtopups, users
Earnings, payouts and refunds
earningsThe expert's share of each ended session: pending through the refund window, then availableprimary key id; unique session_idusers, sessions
expert_balancesEach expert's pending, available and paid-out totalsprimary key expert_idusers
payoutsPayout requests (one open per expert), paid with a reference or rejected by the super-adminprimary key id; unique expert_id, when status = 'requested'; unique ref_nousers
refund_requestsA user's refund requests on ended sessions (one open per session), approved in full or part, or rejectedprimary key id; unique session_id, when status = 'requested'; unique ref_nosessions, users
Files
mediaEvery uploaded file, owned by the person who sent it (expert documents, chat pictures, profile photos)primary key id; unique storage_keyusers
Payments
stripe_eventsEvery Stripe event already applied, so a repeated delivery changes nothingprimary key id–
Platform
platform_settingsThe super-admin settings by section, which take precedence over .env (secrets stored encrypted)primary key keyusers
jobsThe durable background job queue: the nightly housekeeping and purge, and the demo resetprimary key id; unique dedupe_key, when dedupe_key is not null and status in ('queued', 'running')–
audit_logActions taken by the super-admin (decisions, refunds, payouts, settings)primary key idusers
Part 08

Help

Updating and backups

What to back up

Your platform lives in three places: the database, the uploaded files (experts' papers, profile and chat pictures, your logo) and your .env. Back them up on a schedule and before every update. In your seerline/ folder:

# the database
docker compose exec -T postgres pg_dump -U seerline -Fc seerline > seerline-$(date +%F).dump

# the uploaded files (MinIO; with STORAGE_DRIVER=local copy app:/app/storage instead)
docker compose cp minio:/data ./files-$(date +%F)

Use your own POSTGRES_USER and POSTGRES_DB if you changed them, and copy both backups off the server. A managed database or an outside S3 bucket has its own backups: turn them on there.

Keep your .env safe

Keep a copy of .env off the server, in a password manager. The keys you save in Settings are stored encrypted with a key made from APP_SECRET; with a different APP_SECRET they can no longer be read and must be entered again.

Restore

docker compose stop app
docker compose exec -T postgres pg_restore -U seerline -d seerline --clean --if-exists < seerline-2026-12-01.dump
docker compose cp ./files-2026-12-01/. minio:/data
docker compose restart minio
docker compose start app

Update to a new version

  1. Read the new version's changelog (chapter 51) for any step to take by hand.
  2. Back up, as above.
  3. Unpack the new download somewhere else and copy its seerline/ folder over yours. Your .env is not in the download, so it stays. Your data stays too: it is in Docker volumes named after the folder, so keep the same folder.
    unzip -q seerline-1.1.0.zip -d ~/seerline-new
    rsync -a ~/seerline-new/seerline/ ~/seerline/
    This also puts back the original version of every file you edited (for example the Caddyfile or the apps' names). If you change the code, keep it in git with each release as its own commit, so an update becomes a merge.
  4. Look for new keys:
    cd ~/seerline
    diff <(grep -o '^[A-Z0-9_]*=' .env.example | sort) <(grep -o '^[A-Z0-9_]*=' .env | sort)
    Lines that start with < are keys your .env does not have yet; their comments in .env.example say what they do.
  5. Build and start, with the profiles you use:
    docker compose --profile https --profile calls up -d --build
    The new server applies the new migrations when it starts. The old container finishes the requests in flight first (up to 30 seconds), so expect a short break.
  6. Open Admin → Setup check and see that every row is as it was.
  7. If the apps changed, run tools/rename.mjs again with your name, ids, colour and icon (the copy put back the original names), then build and publish an app update (chapter 23).

Troubleshooting

Start with Admin → Setup check and the server's log: docker compose logs app --tail 100.

What you seeWhat to do
docker compose up stops with "required variable POSTGRES_PASSWORD is missing a value"Set POSTGRES_PASSWORD in .env (chapter 5).
The app container restarts again and againThe last lines of docker compose logs app say why, for example "APP_SECRET must be at least 32 characters (generate one with: openssl rand -hex 32)".
The log says "password authentication failed for user"POSTGRES_PASSWORD was changed after the first start, but the database keeps the first one. Put the old one back, or set the new one inside PostgreSQL: docker compose exec postgres psql -U seerline -d seerline -c "alter user seerline password 'the-new-one'".
The install page asks for a tokendocker compose logs app | grep -i "install token" shows it (chapter 6).
Port 8080 is already in useSet another APP_PORT in .env.
The browser shows a certificate errorThe domain's DNS record must point at this server and ports 80 and 443 must be open, so Caddy can get the certificate. docker compose logs caddy says what failed.
Everyone hits "too many requests", or the audit log shows one address for everybodyThe server reads visitor addresses from the wrong place: set TRUSTED_PROXY_HOPS for your setup (chapter 8).
A top-up stays pendingThe Setup check row "Stripe webhook" says whether Stripe's events reach you. Add the endpoint https://your-domain/api/v1/webhooks/stripe with its events and save its signing secret (chapter 10). Admin → Top-ups → Re-check with Stripe asks Stripe at once (chapter 38).
Calls ring, but there is no sound or pictureOpen 7881/tcp and 7882/udp to the server, check LIVEKIT_URL, and use the LiveKit test on the setup check. Some office and mobile networks need TURN (chapter 16).
No push messagesUse the push test in Settings. Check the app has your Firebase files and, for iOS, that your APNs key is uploaded in Firebase (chapter 17). The person must allow notifications and keep that kind of message on.
Emails do not arriveWithout SMTP, emails are only written to the server log with their link. Send a test email from Settings → Push, email & legal, and check your sender domain's SPF and DKIM records (chapter 18).
The "Billing clock" row is redLive sessions are late for their next minute: the server was stopped or is overloaded. Read the log, then docker compose restart app. Minutes are never charged twice when it catches up (chapter 11).
Background jobs failSetup check → Background jobs → See jobs shows each error. Fix the service it names, then Retry all (chapter 36).
The apps say they cannot reach the serverAPI_BASE_URL in the app's .env must be an address the phone can reach: your https:// domain, never localhost on a real phone (chapter 21).
A session ended with "disconnect"One side's app stopped reporting for longer than the reconnect grace (2 minutes by default). Billing paused at once, so the gap was not charged (chapter 11).
An expert no longer gets requestsWhen an expert lets a request time out, Seerline takes them offline ("Missed request") so users do not wait in vain. They go online again in the expert app.

FAQ

Do users pay with Apple or Google in-app purchases?

No. They top up a wallet by card through your Stripe account, and sessions are paid from the wallet. Live one-to-one sessions between two people are allowed outside in-app purchase; chapter 15 explains the rules and what to keep that way.

Can I run it without voice and video?

Yes. Leave the LiveKit keys empty and Seerline offers chat sessions only. You can also switch voice or video off for everyone in Settings, or for one expert.

Are calls recorded?

No. Calls go straight between the two apps through your LiveKit server and are never recorded. Chat messages are kept with the session.

Who sets the prices?

Each expert sets a per-minute rate for chat, voice and video inside the limits you set in Settings. A session keeps the rate it started with.

Can one expert pay a different commission?

Yes: Admin → Experts → the expert → Custom commission, with an end date if you like (chapter 13).

What if a user's connection drops?

Billing pauses at once. If the user is back within the reconnect grace (2 minutes by default) the session goes on; otherwise it ends and nothing more is charged.

Is it only for astrology?

No. The categories are yours: lawyers, tutors, coaches, doctors, anything sold by the minute (chapter 29). Check your legal pages for each new kind of expert.

Which currency?

One currency per install, set in Settings (default USD). Pick it before the first top-up, and pick one your Stripe account can charge.

Can users take sessions on the website?

No. The website shows your experts, categories and expert pages and sends people to the apps; sessions happen in the apps.

Is it translated?

The apps, the website and the admin are in English. Their words are in the code, so a translation means editing those texts.

Do I need a Mac?

Only to build the iOS app (Xcode runs on macOS). The server runs on any Linux server with Docker; the Android app builds on Windows, macOS or Linux.

Can I host it on shared hosting?

No. It needs a server where you can run Docker, or the program and PostgreSQL yourself (chapter 3).

Credits and licences

Seerline is built with these open-source projects, each under its own licence:

Every server and web package

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 each one by name, version and licence; the Flutter packages and their versions are in seerline_mobile_flutter/pubspec.lock.

LicenceRust cratesnpm packages
MIT53271
Apache-2.0 OR MIT2132
Unicode-3.018–
ISC210
Apache-2.0110
MIT OR Unlicense5–
OFL-1.1–4
(MIT OR Apache-2.0) AND Unicode-3.03–
Apache-2.0 OR MIT OR Zlib3–
Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT3–
BSD-3-Clause12
0BSD11
Apache-2.0 OR BSD-2-Clause OR MIT2–
Apache-2.0 OR BSL-1.0 OR MIT2–
Apache-2.0 OR ISC OR MIT2–
Apache-2.0 OR LGPL-2.1-or-later OR MIT2–
BSD-2-Clause–2
CDLA-Permissive-2.02–
MPL-2.0–2
Zlib2–
(Apache-2.0 OR MIT) AND BSD-3-Clause1–
0BSD OR Apache-2.0 OR MIT1–
Apache-2.0 AND ISC1–
Apache-2.0 OR BSL-1.01–
BlueOak-1.0.0–1
CC-BY-4.0–1
LicenseRef-Envato-Regular-or-Extended1–
MIT AND BSD-3-Clause1–
MIT-0–1
Unlicense–1
Total321308

Every licence above allows use in a commercial product. cargo deny check licenses checks the Rust crates against the allowed list in deny.toml.

Images

The logo, the app icons and the interface are original designs, drawn as vectors. The download has no stock photos: the sample experts get drawn initials as their pictures, and every picture on your platform is one your experts or you upload. The images in this guide are screenshots of Seerline itself.

Changelog

1.0.0 (November 2026)

First release.

  • Two Flutter apps from one codebase: the user app and the expert app, as two flavours with their own name, app id, icon and link scheme; light and dark themes; a sample mode that runs every screen without a server.
  • Live sessions by chat, voice or video: a request with an answer window, birth details and a question shared with the expert, a live meter of minutes and money, a low-balance warning with a top-up that keeps the session going, chat with pictures, and a summary and receipt at the end.
  • Billing by the minute: a hold on request, each minute charged once (also with several servers), billing paused while one side reconnects, the session ended when the money runs out or a person drops for good, and the platform's commission taken from each minute.
  • Wallet: card top-ups through Stripe Checkout with a signed webhook and recovery of missed events, top-up packs, promo codes that add a bonus, an optional free first session, and unspent money refunded to the card.
  • Refunds and trust: refund requests for a range of minutes decided by staff, reports with block, reviews, warnings and suspensions.
  • Experts: an application with documents, approval by staff, categories, per-minute rates inside the platform's limits, going online and offline, earnings held for a set number of days, payouts above a minimum, and a custom commission per expert.
  • Admin (web): an overview with today's money and live sessions, sessions with their minute-by-minute billing and a force end, applications, experts, users, categories, the wallet ledger, top-ups with a re-check at Stripe, refunds, payouts, reports, reviews, promo codes, settings in four tabs, staff in three roles (super admin, support, read-only) with an audit log, CSV export, and a setup check that tests every outside service.
  • Website: the expert directory with search and filters, expert and category pages, "become an expert", app downloads, legal pages and the page people return to after paying.
  • Calls on your own LiveKit server: an optional Docker profile, one private room per session, TURN support for strict networks, and a video quality setting.
  • Push notifications through your own Firebase project, emails over your SMTP with wording you can edit, and file storage on MinIO, any S3-compatible service or a local folder.
  • Personal data: "Download my data" in both apps, an admin export, account deletion with unspent money back to the card, and a purge 30 days later.
  • Install and hosting: an install wizard, one Docker Compose stack (PostgreSQL, MinIO, the app, optional LiveKit and Caddy HTTPS), several server copies behind one address, a sample platform with 25 experts and their history, and a public demo mode with one-click sign-ins.
  • Security: Argon2id passwords, secure web sessions and app tokens, secrets encrypted at rest, rate limits, a CSRF header on every web change, uploads checked by their content, and masked personal data for read-only staff.

Support and licence

Questions, bug reports and help with installation: use the Support tab on the item's page on the marketplace. Please include your Seerline version, how you host it, which app and phone it is about, and what you see (a screenshot, or the lines from docker compose logs app). Never send your .env, keys, tokens, the Firebase service account or passwords.

Support covers questions about the item's features, help with bugs, and help with installing it as this guide describes. It does not cover custom changes to the code, publishing the apps under your developer accounts, or the setup and review of your accounts at Stripe, Apple, Google, Firebase and other outside services, which those companies handle.

Licence

The Regular Licence covers one product whose end users are not charged. Seerline takes money from users (wallet top-ups paid by card), so to run it for real you need the Envato Extended Licence. One licence covers one platform: one brand on one installation, with its two apps. The licences page at codecanyon.net/licenses/standard explains both.

Seerline is not affiliated with, endorsed by or sponsored by Stripe, Apple, Google, Firebase or LiveKit. Their names are trademarks of their owners.