In the web UI
The same flow, started, approved and inspected from the browser instead of the CLI.
- the
afe-first-flowfolder from Your first flow. - Docker, for Postgres and Redis.
- a ticket started from the web UI, approved in Approvals, with its BPMN and its artifacts.
Steps
-
Start Postgres and Redis from the repository's compose file:
docker compose -f docker/compose.yml up -d --wait -
Add the
Runtimethat names them,config/runtime.yaml:config/runtime.yamlapiVersion: afe.dev/v1alpha1kind: Runtimemetadata:name: localspec:store:type: postgresdsnEnv: AFE_POSTGRES_DSNbroker:type: redisurlEnv: AFE_REDIS_URL -
Build the web UI bundle into the
afe-webpackage:make web -
Export the API token:
export AFE_API_TOKEN=$(openssl rand -hex 32) -
Serve the API and the UI:
afe serve -c config/ --ui -
Run a worker, in another terminal:
afe worker -c config/ --dry -
Open http://127.0.0.1:8765/ and sign in with the token.
-
Open Flows, start
writer-reviewer, fill the form and start the ticket. -
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.