Chargeline docs
v1.0.0
Get help
● Set up

Configuration
every setting, where it lives.

Two places hold settings: build-time values in the app, and the server's .env file. This page lists all of them.

.envbrand.dartdart-define

01Server environment variables

Copy server/.env.example to server/.env. Never publish this file.

NameDefaultPurpose and where to get it
ADMIN_SECRET_KEYa generated file next to the databaseEncrypts the store keys saved in the console. Make one with openssl rand -hex 32. Back it up: without it the saved keys cannot be read.
ADMIN_SETUP_TOKENa one-time code printed in the logThe code that creates the first console owner. Make one with openssl rand -hex 24 or leave empty. Remove it after the owner exists.
PORT8787HTTP port.
DATABASE_PATHdata/chargeline.sqliteThe SQLite file. The console keeps its own file beside it. In Docker it is /app/data/chargeline.sqlite.
TRUST_PROXY_HOPS0How many reverse proxies you control in front of the server. Use 1 behind Caddy or nginx. Wrong values make rate limits see the wrong address.
ADMIN_DEMO_PASSWORDunsetOnly for a public read-only demo console. Leave empty on a real install.

02App build-time values

ValueWhereMeaning
API_BASE_URL--dart-define=API_BASE_URL=https://... on flutter run / flutter buildYour server's origin. Empty means no server: built-in defaults.
Brand, links, product idsapp/lib/brand.dartSee Rename.

With a server, the app loads GET /v1/config (cached 5 minutes, with an ETag). If the server is unreachable it uses the last copy it saved, then the built-in defaults. Server values override brand.dart values.

03The three server calls

CallWhen
GET /v1/configPublic, no login. Brand, paywall, features, alert limits, announcement, update rule, habit cards.
POST /v1/pingOnly if the user turned on "Share anonymous usage counts" in Settings (off by default). At most once a day.
POST /v1/purchases/verifyOnly if you switch verification on in the console. Otherwise the server answers 501 verification_off and the app trusts the purchase result from the store on the device.

All /v1 routes are limited to 60 requests a minute per address (answer 429). The full request and answer shapes are in contract/CONTRACT.md.