Registry stack documentation: machine-readable Markdown.
Index of all pages: https://docs.registrystack.org/dev/llms.txt
Full corpus: https://docs.registrystack.org/dev/llms-full.txt

# Preview a business registration service

> Run the business registration starter, submit a test registration in your browser, and read the resulting Record from Base Registry Engine.

import QuickstartMeta from '../../../components/QuickstartMeta.astro';

If you are building a service on Base Registry Engine (BReg), try the business registration
starter. You will run it on your machine, register a test business from a browser form, and see
the Record that BReg returns.

<QuickstartMeta
  outcome="A local service that registers a test business and reads back its BReg Record."
  time="About 15 minutes, plus downloads"
  level="Local evaluation only"
  prerequisites={[
    { label: 'Registry Stack with the BReg component installed', href: '/tutorials/first-breg/#install-registry-stack' },
    'Node.js 24 with npm',
    'Running Docker',
    'Git and a browser',
  ]}
/>

## Scaffold the preview

Start in an empty working directory. Use the Registry Stack release selected in the docs
version picker and install the BReg component from that release. Replace `<version>` with the
release number, without the leading `v`. Copy the business registration starter from its source tag.

```sh
version='<version>'
rstack breg --version
git clone --depth 1 --branch "v${version}" https://github.com/registrystack/registry-stack.git registry-stack-preview-source
cp -R registry-stack-preview-source/products/platform/examples/service-previews/business-registration ./business-registration
```

Check that the reported tool version matches `<version>`.
You now have a `business-registration` directory with a registry project, a browser page, and a
registration function. If Git cannot find the tag, check the release number in the verified
installer's filename. If the starter is missing, choose a release that includes the preview.

## Install the client

Install the published client for the release you selected. npm saves that exact version in your
copy of the starter. Run the remaining commands from the preview directory.

```sh
cd business-registration
npm install --save-exact "@registrystack/client@${version}"
```

If npm cannot find the version, check the package version against the Registry Stack release you
installed. Use the same version for both.

{/* Evidence: crates/registry-rstack/src/cli.rs, generate_client(); clients/typescript/package.json. */}

## Start the preview

Use synthetic data and trusted code on a trusted machine. The preview runs as a test registrar.
Other processes and users on the same host can reach the loopback URL.

Check the development plan and start a local run.

```sh
rstack dev check .
rstack dev start . --ttl 30m
```

If the check fails, use the file and field named in its diagnostic. The first start may download
the PostgreSQL image. If start fails, check that Docker is running and read the diagnostic.
Keep the run ID and open the URL marked `Application` in the start report.

{/* Evidence: crates/registry-rstack/src/cli.rs, dispatch_dev; crates/registry-rstack-dev/src/lib.rs, start(). */}

## Register a test business

In the browser, enter `Example Supply Cooperative` for **Business name** and
`BR-TUTORIAL-001` for **Registration number**. Select **Register business**.

The **Business registered** confirmation shows the name, registration number and Record ID
read back from BReg. Reload the page and use a fresh number to repeat the exercise in the same run.

{/* TODO[evidence]: Bind the business-registration page and its native browser acceptance source when the preview release baseline lands. */}

## Stop the preview

Replace `<run-id>` with the ID from the start report. The `--clean` flag deletes the managed
development data for this preview.

```sh
RUN='<run-id>'
rstack dev stop "$RUN" --clean
```

The stop report confirms the run stopped.

## Next

[Generate clients for your own projects](../../reference/typescript-clients/)