feat(build): split standalone vs saas build modes #55

Merged
nrupard merged 1 commit from feat/split-build-saas-standalone into main 2026-05-07 17:14:32 +02:00
Owner

Mirrors the pattern used by RUS and Rusty Links. The server now compiles to one of two binaries depending on cargo features:

  • lets-chat (default, --features standalone): self-hosted build with built-in registration, login, and admin pages.
  • lets-chat-saas (--no-default-features --features saas): integrates with a parent SaaS application. The /register and /admin routes are not registered, and a /webhooks/maintenance endpoint is added for the parent app to signal maintenance. Brings in hmac, hex, and jsonwebtoken crates as the foundation for future cookie-based auth.

The Docker image accepts --build-arg BUILD_MODE=saas to switch modes; the runtime binary is always installed as /usr/local/bin/lets-chat regardless of which mode it was built in. The cacher and builder stages branch on BUILD_MODE so dependency caching works for both. compose.dev.yml passes BUILD_MODE through, defaulting to standalone.

Adds saas-suffixed justfile recipes (build-saas, build-docker-saas, check-server-saas, check-clippy-saas, check-docker-saas, dev-web-saas, dev-web-local-saas, test-saas) and includes both modes in the top-level just check so CI catches regressions in either binary. Adds .env.standalone and .env.saas templates documenting the per-mode environment variables. CLAUDE.md describes the two modes and the new recipes.

The actual SaaS cookie validation logic is intentionally a stub for now: the maintenance webhook returns 200 OK and there is no JWT/HMAC verification yet. Future work will swap the inject_user middleware for saas mode and wire up the parent-app cookie handshake.

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

Mirrors the pattern used by RUS and Rusty Links. The server now compiles to one of two binaries depending on cargo features: - `lets-chat` (default, `--features standalone`): self-hosted build with built-in registration, login, and admin pages. - `lets-chat-saas` (`--no-default-features --features saas`): integrates with a parent SaaS application. The /register and /admin routes are not registered, and a /webhooks/maintenance endpoint is added for the parent app to signal maintenance. Brings in hmac, hex, and jsonwebtoken crates as the foundation for future cookie-based auth. The Docker image accepts `--build-arg BUILD_MODE=saas` to switch modes; the runtime binary is always installed as /usr/local/bin/lets-chat regardless of which mode it was built in. The cacher and builder stages branch on BUILD_MODE so dependency caching works for both. compose.dev.yml passes BUILD_MODE through, defaulting to standalone. Adds saas-suffixed justfile recipes (build-saas, build-docker-saas, check-server-saas, check-clippy-saas, check-docker-saas, dev-web-saas, dev-web-local-saas, test-saas) and includes both modes in the top-level `just check` so CI catches regressions in either binary. Adds .env.standalone and .env.saas templates documenting the per-mode environment variables. CLAUDE.md describes the two modes and the new recipes. The actual SaaS cookie validation logic is intentionally a stub for now: the maintenance webhook returns 200 OK and there is no JWT/HMAC verification yet. Future work will swap the inject_user middleware for saas mode and wire up the parent-app cookie handshake. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Mirrors the pattern used by RUS and Rusty Links. The server now compiles to one of two binaries depending on cargo features:

- `lets-chat` (default, `--features standalone`): self-hosted build with built-in registration, login, and admin pages.
- `lets-chat-saas` (`--no-default-features --features saas`): integrates with a parent SaaS application. The /register and /admin routes are not registered, and a /webhooks/maintenance endpoint is added for the parent app to signal maintenance. Brings in hmac, hex, and jsonwebtoken crates as the foundation for future cookie-based auth.

The Docker image accepts `--build-arg BUILD_MODE=saas` to switch modes; the runtime binary is always installed as /usr/local/bin/lets-chat regardless of which mode it was built in. The cacher and builder stages branch on BUILD_MODE so dependency caching works for both. compose.dev.yml passes BUILD_MODE through, defaulting to standalone.

Adds saas-suffixed justfile recipes (build-saas, build-docker-saas, check-server-saas, check-clippy-saas, check-docker-saas, dev-web-saas, dev-web-local-saas, test-saas) and includes both modes in the top-level `just check` so CI catches regressions in either binary. Adds .env.standalone and .env.saas templates documenting the per-mode environment variables. CLAUDE.md describes the two modes and the new recipes.

The actual SaaS cookie validation logic is intentionally a stub for now: the maintenance webhook returns 200 OK and there is no JWT/HMAC verification yet. Future work will swap the inject_user middleware for saas mode and wire up the parent-app cookie handshake.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
nrupard deleted branch feat/split-build-saas-standalone 2026-05-07 17:14:32 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/lets-chat!55
No description provided.