Installing BWEB

BWEB ships in the BSPK Tools component, which bundles every BSPOKE tool: BWEB, the ATL, code and method execution, the JSON object editor. Installation happens in two stages: 4D loads the component as a dependency of your project, then the component's wizard installs BWEB into your database.

Before you start

  • 4D 21. The component is built for 4D 21: its version number starts with 4D's (for instance 21.6.85).
  • A 4D project, new or existing, opened locally and not compiled: the wizard refuses to run otherwise.
  • Internet access on first start: 4D downloads the component and its own dependencies from GitHub, then keeps them in cache.
  • Node.js: BWEB needs it to build its stylesheets. If it is missing, the wizard offers to install it.

1. Declare the component

The component is published on GitHub, in the public bspoke-dev/BSPK-Tools repository, where every version is listed. You declare it as a dependency of your project, from 4D:

  1. Menu Design > Project Dependencies.
  2. Click the + button at the bottom of the window, then choose the GitHub tab.
  3. Enter the repository path: bspoke-dev/BSPK-Tools.
  4. Choose Exact Version (Tag) with a tag such as 21.6.85: you decide when to move to the next version. Click Add.
  5. The dependency is listed as Available after restart: restart 4D.

On restart, the component is downloaded, and it pulls the official 4D components it needs by itself: there is nothing else to declare. The dependencies window then lists BSPK Tools with its version, next to 4D NetKit, 4D Progress, 4D SVG and 4D Widgets.

The window only writes the project's Project/Sources/dependencies.json file. You can also declare the component there directly:

{
  "dependencies": {
    "BSPK Tools": {
      "github": "bspoke-dev/BSPK-Tools",
      "tag": "21.6.85"
    }
  }
}

What about the Components folder? Copying the component into the project's Components folder, as with older versions, still works. A dependency is nevertheless the recommended method: it is the 4D standard, and moving to a new version is done from the dependencies window, without handling any folder.

2. Run the wizard

Run the _BSPK_LAUNCH method. It opens the component's launcher, which gives access to every tool. Click BWEB, accept the licence, then click Start installation.

The wizard lists its steps and ticks them as it goes. They fall into these groups:

  1. Environment: prerequisite check, Node.js and npm installation if needed, libraries, and stylesheet build.
  2. Web server: 4D web server configuration and SSL certificate installation. The wizard asks for your cert.pem and key.pem files; you can continue without them for a local trial.
  3. Files and methods: the web folder, configuration files and BSPH_* methods are copied into your project; the On Startup, Web On Connection and On Exit database methods (and their server counterparts) are modified.
  4. Structure: the BSPK_* tables are created, with their relations and indexes. Your application restarts at this step: that is expected, and installation resumes on its own.
  5. First domain: the wizard asks for the name of your first site, then offers to add it to the machine's hosts file so that it answers locally.

The BSPK_* tables added to your structure belong to BWEB: do not delete or rename them.

3. Check

At the end, click Test BWEB in the launcher: your browser opens your domain's administration, at https://<your domain>/bweb. If you continued without a certificate, or with a self-signed one, the browser shows a security warning: you can proceed for a local trial.

If the login page appears, BWEB is installed.

What next

  • To understand what you just installed: The data model.
  • To build right away: the Quick Start, in the menu, walks you through a complete blog.
  • For the page editing tool: The dev panel.