# State DB

All Blocklet Server states are managed by files in this folder.

## blocklet

- `meta` meta of bundle _defined in @blocklet/meta/schema_
  - `did`, `name`: component id, default from source meta, can be changed before install
  - `title`, `description`: component info, default from source meta, can be changed before install
  - `bundleDdid`, `bundleName`: bundle id, copy from source meta
  - `version`: component version
  - `price`: used for charging
  - `logo`: component logo
  - `logoUrl`: component logo (from store)
  - `interfaces`: for resolving: runtime port; service config; web base prefix; api base prefix
  - `environments`: component environment
  - `scripts`: for hook of component lifecycle
  - `engine`, `timeout`, `group`, `main`: related to process startup
  - `dist`: bundle source
  - `theme`: app theme
  - `navigation`: app navigation`
- `source`: type of bundle source
- `bundleSource`: download infomation of bundle srouce
- `deployedFrom`: extra information of bundle source
- `appDid`: app instance id _app only_
- `status`, `startedAt`, `installedAt`, `stoppedAt` app status
- `deletedAt` _component only_
- `mode` app mode
- `ports` runtime port resolved from meta
  - `<ENV_NAME>`: `<port number>`
- `environments[]`: env variables generated by server, e.g. BLOCKLET_APP_SK, BLOCKLET_APP_ID
  - `<key>`: `<value>`
- `children`: component of app, same structure as parent, can be nested
- `mountPoint` mount path of web site. _component only_
- `dynamic` is dynamically added. _component only_
- `controller`
- `tokens`
  - `downloadTokenList`
