Platform, Architecture & Foundations
How SamvraCore ERP is built, packaged, licensed, isolated per tenant, and internationalised.
2. The Install Wizard and First-Boot Provisioning
Six-step web wizard
On first boot the binary serves a web-based install wizard on port :8080, implemented under internal/installer/. The operator walks through six stages in order: Licence, Database, Admin, Organization, SSL/Port, Review, then Install. During the final step the installer runs the database migrations, creates the first admin user and organization, generates the JWT secret, and writes config.yaml.
Headless provisioning
For unattended or scripted installs there is a headless variant, installer.BootstrapFromEnv, activated by setting BOOTSTRAP_MODE=env (or envwizard). It reads LICENSE_KEY, the DATABASE_* variables, the ADMIN_* variables, and ORG_NAME from the environment and performs the same provisioning without operator interaction. This supports container and automated deployment pipelines.
Idempotency and recovery
A .installed marker file prevents the wizard from running again after a successful install, and the configuration write is atomic. The wizard is also tied into licence recovery. If license.CheckLocalToken fails after installation, the wizard re-launches so the operator can paste a fresh key. A background poller exits once a valid token appears, which lets the Windows SCM or systemd supervisor restart the service into the normal licensed path. A typical workflow is therefore install once, then rely on the marker to keep subsequent restarts going straight to the application.