# Boomack

![Boomack Logo](artwork/logo-with-name.png)

> web app for displaying hyper-media items in concert with e.g. an IDE

Inspired by ideas from Daniel Kiertscher

## Requirements

* NodeJS &ge; 20

## Getting Started

1. Install the _Boomack_ server: `npm i -g boomack` (may require `sudo` on Linux)
2. Start the server listening at default port 3000: `boomack`
3. Open the display page in a browser: `http://127.0.0.1:3000/`
4. Send display requests via the HTTP API:

Bash:

```bash
curl -H "Content-Type: application/json" \
  -d '{"text":"Hello World!"}' \
  http://127.0.0.1:3000/v1/display
```

PowerShell:

```powershell
Invoke-WebRequest http://127.0.0.1:3000/v1/display `
    -Method Post `
    -ContentType application/json `
    -Body '{"text":"Hello World!"}'
```

## Use the Boomack CLI

1. Install the _Boomack_ CLI: `npm i -g boomack-cli` (may require `sudo` on Linux)
2. Send API requests:
    + Send plain text to the default slot in the default panel  
      `boom -s "Hello World!"`
    + Create new panel `demo` with two slots: `head` and `main`:  
      `boom panel add demo "{grid: {rows: 3}, slots: {head: {}, main: {row: 1, rowSpan: 2, history: 10}}}"`
    + List all existing panels:  
      `boom panel ls`
    + Send Markdown to the slot `head` in the panel `demo`:  
      `boom --target demo/head -s "# Demo" -t text/markdown`
    + Send a file to the slot `main` in the panel `demo`:  
      `boom --target demo/main -f ./my-code.js`

## Try out the demos

* Clone the repository
* Start a local _Boomack_ server: `boomack -b --panel default`
* Run scripts in `demo` folder, e. g.: `node demo/display-image.js`

## Development

* Install development dependencies: `npm i`
* Run tests: `npm test`
* Build docs: `npm run docs`
* Make sure, you have Gulp CLI installed: `npm i -g gulp-cli`
* Update vendor libraries
    + Update e.g. lodash: `npm upgrade lodash`
    + Copy web client dependencies from `node_modules` to client folder: `vendor`
