Set up
From the repository root:DRUKS_SECRETS_KEY in .env, then
initialize the development database:
./druks.toml from the current directory. The example uses
[identity].mode = "none". The loopback dashboard has no authentication and
exactly one operator account. Your first provider connection creates this
account.
To use header mode with the development server, set
identity.mode = "header" in druks.toml. Set identity.header in the same
file. Then send the header with a browser add-on or
curl -H 'X-Edge-Email: you@example.com'.
The dev Compose project creates two databases:
- Development:
druks_devfor the host-run server. - Tests:
druks_testfor pytest. The suite rebuilds this schema.
.env.example points the server at druks_dev. The suite reaches
druks_test and Redis index 15 through DRUKS_TEST_DATABASE_URL and
DRUKS_TEST_REDIS_URL. It does not use the server settings. Thus, the two
databases cannot be confused.
Start the backend:
Architecture map
The API process embeds DBOS and executes workflows. App modules register
capabilities during boot, after DBOS initialization and before launch.
App test surface
The main package registers bundled apps throughpyproject.toml. CI also
installs backend/tests/druks-field_notes as a real editable distribution and
runs the proof-app tests. Those tests are the executable contract for:
- Headless and boot-time entry-point loading
- Role-module discovery
- Route and subject read-side mounting
- Independent migrations and table-prefix enforcement
- Workflow start, settings, and feed formatting
- Output artifacts and their Activity topics
- Accepted work, validated gate replies, and terminal failures
- Completed-step replay without duplicate output or announcement rows.
Database changes
Core and bundled historical tables use the core Alembic history:<table>.<column> as the AAD. A
migration that renames that table or column must also decrypt every row under
the old name and re-encrypt it under the new one, or every stored value stops
decrypting. e3a9c7d1b5f4_providers_own_logins.py shows the step.
Verification
Backend checks:field_notes, the proof app. This standalone
distribution depends on Druks. It installs like an author app, not as a Druks
dependency. Install it one time for the full suite.
The pull-request backend
workflow does the same. Pyright is available for local and editor use. It is not
a CI gate.
House rules:
house_rules app
and posts the result as the druks-house-rules check, which main requires.
Frontend checks:
docs/ directly. Its GitHub App owns deployments and
pull-request previews. The repository does not require a documentation-specific
GitHub Actions workflow.
Chat end to end
TheOn Pull Request E2E workflow runs Chat end to end with Playwright on every
pull request. It builds the Druks image from the pull request and installs it
with scripts/install.sh on the docker provider. Only the model is fake:
scripted Anthropic and OpenAI APIs in the Playwright process answer for
api.anthropic.com and api.openai.com. The specs run Chat on Claude, Codex,
and OpenCode. The box, the secrets proxy, the sandbox image, and the CLIs are
real.
Run the lane on Linux or on macOS with Docker Desktop. The stack uses the host
network and the ports of an installed Druks, so stop any other Druks stack
first, and the development database of deploy/compose.dev.yaml. The mock
listens on port 443, and the containers reach it at the Docker bridge address,
172.17.0.1.
-
Build the image of your checkout:
-
Install the stack into
~/druks.DRUKS_REFnames a pushed commit whosedeploy/files match your checkout: -
On Linux, let Node listen on port 443. Then run the suite:
export E2E_MOCK_ADDRESS=192.168.65.254, and keep
it set for each docker compose command in the install directory. Skip the
sysctl command.
Set DRUKS_INSTALL_DIR to install elsewhere, and set it for the suite too. The
suite needs no cleanup between runs. To start over, run
docker compose down --volumes in the install directory and remove it.
Working with sandboxes
Backend tests mock most provider boundaries. For a real local sandbox, run Drukbox on the host from its own checkout (DOCKER_SSH_USERNAME=druks make dev in
czpython/drukbox) and set:
DRUKS_SANDBOX_SERVICE_TOKEN=dev-token in .env.
uv run druks doctor --sandbox creates a real host. If you require a real
sandbox test, run this command. It is not part of the normal test suite.
Frontend ownership
An app’s screens are Python. It declares them inpages.py, and the shell
renders them through frontend/src/druksui/. An installed wheel therefore
adds pages without touching the JavaScript bundle. The
Druks UI contract is the one description of what those pages
carry; change it first, then the renderer.
Two escape hatches remain, and both are for an app that needs full control of
its interface. An app can ship a standalone static frontend in its package’s
dist/, served at /app/<name>. React code that joins the bundled dashboard
shell must already be in the SPA and register through
frontend/src/apps/index.ts; a wheel cannot put routes into that existing
JavaScript bundle.
See the frontend guide
before adding dashboard pages.