Applet Development
An applet is a self-contained web application that the BigLedger shell loads at runtime and mounts inside its own page. Almost every screen a BigLedger user sees is an applet: Chart of Account, Sales Invoice, Cashbook, Point of Sale. They are built, versioned and released independently of the platform, and of each other.
This section documents how to build one.
What an applet actually is
Three things, and nothing else:
- A JavaScript bundle served from any HTTPS URL a browser can reach. It defines one custom element.
- A registration record held by BigLedger, which tells the shell the bundle’s URL, the element name to mount, and the route to mount it at.
- A contract about session state. The shell puts the tenant code, the signed-in user’s token and a per-launch instance number into browser storage before it loads your bundle. Your applet reads them from there.
Everything else — framework, state management, styling, build tooling — is your choice, with one practical constraint: the official client library is an Angular library, so applets that use it are Angular applications.
The runtime contract
These are the four points where your code and the platform have to agree exactly. Get any one of them wrong and the applet loads but never appears.
| # | Contract | Where it lives in your code | Where it lives in the registration |
|---|---|---|---|
| 1 | Bundle URL | your hosting | ES Module Url |
| 2 | Custom element name | customElements.define(...) in your root module | Custom Element Tag |
| 3 | Route prefix | the path of your top-level route | Applet Router |
| 4 | Session keys | sessionStorage / localStorage reads | set by the shell, not configurable |
Applet Structure documents each one in full.
What you need from BigLedger
Two steps in the path are not self-service. Plan for them before you start building.
What is public
| Thing | Where | Status |
|---|---|---|
blg-akaun-ts-lib — the API client library | npm | Public, MIT |
blg-akaun-ng-lib — Angular UI components used by applets | npm | Public, MIT |
| The API host | https://api.akaun.com/ | Public |
| The shell | https://akaun.com/ | Public, sign-in required |