Skip to main content

In the web UI

The same flow, started, approved and inspected from the browser instead of the CLI.

You need
  • the afe-first-flow folder from Your first flow.
  • Docker, for Postgres and Redis.
At the end you have
  • a ticket started from the web UI, approved in Approvals, with its BPMN and its artifacts.

Steps​

  1. Start Postgres and Redis from the repository's compose file:

    docker compose -f docker/compose.yml up -d --wait
  2. Add the Runtime that names them, config/runtime.yaml:

    config/runtime.yaml
    apiVersion: afe.dev/v1alpha1
    kind: Runtime
    metadata:
    name: local
    spec:
    store:
    type: postgres
    dsnEnv: AFE_POSTGRES_DSN
    broker:
    type: redis
    urlEnv: AFE_REDIS_URL
  3. Build the web UI bundle into the afe-web package:

    make web
  4. Export the API token:

    export AFE_API_TOKEN=$(openssl rand -hex 32)
  5. Serve the API and the UI:

    afe serve -c config/ --ui
  6. Run a worker, in another terminal:

    afe worker -c config/ --dry
  7. Open http://127.0.0.1:8765/ and sign in with the token.

  8. Open Flows, start writer-reviewer, fill the form and start the ticket.

  9. Answer it in Approvals. Then read the BPMN diagram and the artifacts on the ticket's page.

Troubleshooting​

Symptom: afe serve --ui fails with "the web UI is not built: run make web". Cause: step 3 was skipped, or the afe-web package has no build yet. Fix: run make web from the repository root, then start afe serve --ui again.

Symptom: afe serve exits with "set AFE_API_TOKEN: the server does not start without a token". Cause: step 4 was skipped in this terminal, or the token was exported in a different shell. Fix: export AFE_API_TOKEN again in the shell that runs afe serve.

Symptom: the browser cannot reach 127.0.0.1:8765. Cause: Postgres or Redis are not up, so afe serve from step 5 failed to start. Fix: run docker compose -f docker/compose.yml ps and check both services are healthy.

See also​