# e2ee-backend-adapter

`e2ee-backend-adapter` is a Rust backend runtime for manifests generated by `e2ee-client-backend`.

It is intended to run the adapter server itself, connect to the configured PostgreSQL database, expose REST routes and generated-client-compatible GraphQL operations, expose optional WebSocket realtime endpoints, and provide explicit database expectation and diff tooling.

Documentation is published to GitHub Pages at <https://benedikt-weyer.github.io/e2ee-backend-adapter/>.

The current implementation bootstraps:

- a Rust workspace with the main adapter crate and an internal CLI crate
- a versioned manifest contract on the Rust side
- a server that validates the manifest and verifies PostgreSQL connectivity
- CLI commands for manifest validation and expected-schema export scaffolding
- MkDocs documentation pages

## Release

The main `e2ee-backend-adapter` crate is versioned and published from this workspace for crates.io.

Compute the next version:

```bash
bash ./scripts/next-version.sh patch
```

Update the workspace release version:

```bash
bash ./scripts/set-version.sh 0.1.1
```

Publish the crates.io package:

```bash
bash ./scripts/publish-crates.sh
```

GitHub Actions workflow:

- `.github/workflows/release-crates.yml`
- manual trigger with `patch`, `minor`, or `major`
- expects `CARGO_REGISTRY_TOKEN` or `CRATES_IO_TOKEN` in repository secrets

## Docs

Build the MkDocs site locally:

```bash
python -m pip install -r docs/requirements.txt
mkdocs build --strict
```

GitHub Pages deployment:

- `.github/workflows/docs-pages.yml`
- automatic on pushes to `main` that touch `docs/**`, `mkdocs.yml`, or the workflow itself
- manual trigger available through `workflow_dispatch`

Dry-run the publish flow:

```bash
bash ./scripts/publish-crates.sh --dry-run
```
