# bt_app Quick Start ## Pure HTML project Create `index.html` in an empty directory: ```html

Hello BT App

``` Run in this directory: ```bash ./bt_app.exe run ``` When running for the first time, if there is no `app.json` in the directory, bt_app will automatically generate the default `app.json` and add it if it is missing Creates an empty `main.bt` when using `main.bt`. Configurations such as window title, size, entry, and resources are subject to `app.json`. You can also double-click `bt_app.exe` directly, provided that the current working directory is the project directory. ## app.json project creates `app.json`: ```json { "app": { "id": "org.example.hello_app", "name": "HelloApp", "title": "Hello BT App", "mode": "static", "entry": "index.html", "main": "main.bt" }, "window": { "width": 900, "height": 700, "resizable": true }, "dev": { "watch": true, "delay": 500, "devtools": true, "console": true }, "resources": [ "index.html", "main.bt", "assets/**" ], "exclude": [] } ``` creates `main.bt`: ```bt fn hello(args) { return { error:false, message:'ok', data:'Hello ' + args.name } } ``` calls in the page: ```html


```

## Packages
 runs in the project directory:

```bash
./bt_app.exe build
```

 packaging results are output to:

```text
dist/HelloApp.exe
```

 if the user machine is installed bt_app, you can also generate only BTR software without runtime:

```bash
./bt_app.exe pack
./bt_app.exe run ./dist/HelloApp.btr
```

 Windows can execute `bt_app.exe associate` once to establish the `.btr` file association of the current user, and then double-click BTR directly. Adding `PATH` only facilitates command line search and will not automatically establish file associations.

## Notes
- In `static` mode, `entry` must be a relative path within the project.
 - In `server` and `remote` modes `entry` must be the `http://` or `https://` address.
- When `app.main`, `true` or `null` is omitted, it will automatically try to execute `main.bt`; writing `false` or an empty string means not to execute the main script.
- Currently `app.icon` only supports `.ico` files within the project.
 - It is recommended to explicitly configure the stable `app.id`; do not modify it for name changes after release.
- `index.html` no longer provides application configuration; please write `resources` for styles, scripts and images that need to be packaged.
- When the development directory is running, the page will be automatically refreshed after the files in `resources - exclude` are saved; you can also press `F5`, `Ctrl+R` or `Cmd+R` to refresh manually.