MechaCat02 2f9912533f feat: list + get chapters under /api/v1/mangas/{id}/chapters
Both endpoints are public reads — anyone browsing can see a manga's
table of contents and chapter metadata. Uploads land in feat/uploads.

- GET /api/v1/mangas/{id}/chapters returns the paged envelope
  ({items, page}) ordered by chapter number ASC. Surfaces 404 if the
  parent manga doesn't exist so an empty result can't be mistaken for
  "no chapters yet" on a real manga.
- GET /api/v1/mangas/{id}/chapters/{number} returns a single chapter,
  404 if either manga or chapter is missing.

repo::chapter exposes list_for_manga, find_by_manga_and_number, and
create. create translates the (manga_id, number) unique violation into
AppError::Conflict so the upload handler can later return a clean 409.

Frontend lib/api/chapters.ts mirrors the shape with listChapters and
getChapter; Vitest asserts the URL shape, paged response handling, and
404 envelope propagation.

Lockstep version bump to 0.4.0.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 22:08:20 +02:00
2026-05-16 21:05:16 +02:00
2026-05-16 21:05:16 +02:00
2026-05-16 21:05:16 +02:00
2026-05-16 21:05:16 +02:00
2026-05-16 21:05:16 +02:00

Mangalord

A self-hosted manga and comics reader. Browse, search, read, bookmark, and upload manga and chapters. The HTTP API is consumed by both the SvelteKit web UI and external bots/scripts that perform the same actions programmatically.

Stack

  • Backend: Rust, axum, sqlx
  • Database: Postgres 16
  • Frontend: SvelteKit 2 (Svelte 5 runes), TypeScript, Vite
  • File storage: pluggable Storage trait — local FS today, S3 (and friends) as future impls
  • Deploy: Docker Compose on a single server

Quick start

cp .env.example .env
docker compose up --build

Local development

Run only Postgres in Docker; run backend and frontend natively for fast iteration:

docker compose -f docker-compose.dev.yml up -d

# backend
cd backend
export DATABASE_URL=postgres://mangalord:mangalord@localhost:5432/mangalord
cargo run

# frontend (separate shell)
cd frontend
npm install
npm run dev

The Vite dev server proxies /api to http://localhost:8080.

Tests

This project is developed test-first. Tests live at three levels:

# Backend: unit (in-module) + integration (tests/, per-test DB via #[sqlx::test])
cd backend && cargo test

# Frontend: unit / module tests (Vitest)
cd frontend && npm test

# Frontend: end-to-end (Playwright; spins up dev server, mocks API by default)
cd frontend && npm run test:e2e

API surface

Method Path Purpose
GET /api/health Liveness
GET /api/mangas List / search mangas
POST /api/mangas Create a manga
GET /api/mangas/{id} Get a manga
GET /api/files/{key} Stream a blob (cover, chapter page)

Chapters, uploads, and bookmarks are next — the patterns to extend are documented in CLAUDE.md.

Description
No description provided
Readme 702 KiB
Languages
Rust 59.1%
Svelte 21.9%
TypeScript 18.1%
CSS 0.6%
Dockerfile 0.2%
Other 0.1%