Rewrite backend in Rust (Axum + sqlx), Postgres-only #1

Merged
freydis merged 1 commit from rust-backend into main 2026-09-20 20:37:23 +02:00
Owner

Summary

  • Replaces the Express + Knex backend with Axum + sqlx, matching hormone's precedent (Postgres-only, no SQLite dev fallback — sqlx has no dialect-agnostic query builder, so supporting both would mean two full sets of queries).
  • All 32 endpoints, mTLS cert-based auth, SSE live updates, Meilisearch search, and the MangaDex/tenrai proxy + title-resolution logic ported with behavioral parity.
  • Init migration mirrors the existing Postgres schema with IF NOT EXISTS guards so it's a no-op against production data (same baselining trick as hormone).
  • Dockerfile rebuilt as a multi-stage Rust + frontend build; docker-compose.yml unchanged (same single-container-serves-both topology, now via tower-http's ServeDir instead of Express static + SPA fallback).
  • 47 backend unit tests added (cargo test), wired into npm run test and CI.

Test plan

  • cargo test, cargo clippy -D warnings, cargo fmt --check all pass
  • Full API smoke-tested against a scratch Postgres + Meilisearch (CRUD, auth/cert flows incl. production read-only gate, MangaDex proxy against the live API, refresh-originals)
  • Docker image built and run end-to-end against a scratch Postgres
  • Full Playwright E2E suite passes against the real dev stack (6/6)
## Summary - Replaces the Express + Knex backend with Axum + sqlx, matching hormone's precedent (Postgres-only, no SQLite dev fallback — sqlx has no dialect-agnostic query builder, so supporting both would mean two full sets of queries). - All 32 endpoints, mTLS cert-based auth, SSE live updates, Meilisearch search, and the MangaDex/tenrai proxy + title-resolution logic ported with behavioral parity. - Init migration mirrors the existing Postgres schema with `IF NOT EXISTS` guards so it's a no-op against production data (same baselining trick as hormone). - Dockerfile rebuilt as a multi-stage Rust + frontend build; `docker-compose.yml` unchanged (same single-container-serves-both topology, now via tower-http's ServeDir instead of Express static + SPA fallback). - 47 backend unit tests added (`cargo test`), wired into `npm run test` and CI. ## Test plan - [x] `cargo test`, `cargo clippy -D warnings`, `cargo fmt --check` all pass - [x] Full API smoke-tested against a scratch Postgres + Meilisearch (CRUD, auth/cert flows incl. production read-only gate, MangaDex proxy against the live API, refresh-originals) - [x] Docker image built and run end-to-end against a scratch Postgres - [x] Full Playwright E2E suite passes against the real dev stack (6/6)
Rewrite backend in Rust (Axum + sqlx), Postgres-only
All checks were successful
CI / Frontend – typecheck, lint, test & build (pull_request) Successful in 40s
CI / Backend – fmt, clippy, test & build (pull_request) Successful in 3m8s
CI / Docker – build image (pull_request) Successful in 2m15s
CI / deploy (pull_request) Has been skipped
2d2d106484
Replaces Express + Knex with Axum + sqlx, matching hormone's precedent.
Drops the SQLite dev fallback: sqlx has no dialect-agnostic query builder
like Knex, so supporting both dialects would mean maintaining two full
sets of queries. The init migration mirrors the existing Postgres schema
with IF NOT EXISTS guards so it's a no-op against production data.
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
freydis/manga-lib!1
No description provided.