BastraLekha ବସ୍ତ୍ରଲେଖା

Administration

Installation and hosting

For the IT team or data centre running BastraLekha: what it is made of, what it needs, and how to run it safely.

What it is made of

PartWhat it is
Web appA static single-page app, served from any web server or CDN. The till caches the catalogue in the browser to bill offline.
APIA Node.js service, delivered as a container image (Linux amd64, about 80 MB, runs as a non-root user). It holds no state of its own.
DatabasePostgreSQL. All data lives here.

Database requirements

BastraLekha depends on PostgreSQL features that other databases do not have: row-level security, exclusion constraints, deferred constraint triggers and exact NUMERIC arithmetic. A managed PostgreSQL (in an Indian region) or your own server both work; SQLite-style stores do not.

Configuration

The API reads its settings from environment variables and refuses to start, naming the missing field, if any is absent. Secrets belong in a secret manager, never in an image or a file on disk.

VariableMeaning
NODE_ENVproduction for a live installation
PORTPort the API listens on
RUNTIME_MODEserver for a container or VM; serverless for a function platform. Sizes the connection pool.
LOG_LEVELLogging detail
DATABASE_URLConnection string for the application role
DATABASE_POOL_MAXLargest connection pool
JWT_SECRETSigning secret for sessions, at least 32 characters; unique to the installation
ACCESS_TOKEN_TTL_MINUTES, REFRESH_TOKEN_TTL_DAYSHow long a sign-in lasts
LICENCE_PUBLIC_KEYPublic key that licences and rule packs are checked against
LICENCE_SERVICE_URLWhere the licence is activated and renewed
DEPLOYMENT_IDUnique to the installation; part of the licence activation
CORS_ORIGINSAddress the web app is served from

The web app's API address is fixed when the web app is built, so changing where the API lives means rebuilding the web app, not just editing a setting.

Where to run it

The public demo runs on free cloud tiers and is for evaluation only.

Running it