chore: initial project scaffold

Set up Mangalord with a Rust/axum backend, SvelteKit frontend, Postgres,
and Docker Compose deployment. Establishes the architecture and TDD
patterns the project will extend:

- Hexagonal-ish backend layering (domain / repo / storage / api) with
  a pluggable Storage trait (LocalStorage today, S3 as a future impl).
- Initial migration: users, mangas, chapters, bookmarks.
- Vertical slice for mangas (list, search, create, get) with
  #[sqlx::test] integration coverage and storage unit tests.
- SvelteKit frontend using Svelte 5 runes, typed API client, Vitest
  unit tests and Playwright e2e with route mocking.
- CLAUDE.md documenting layering, TDD/git/SemVer workflow rules, and
  extension points (tags, fulltext search, OCR, S3, auth).
- Project-scoped .claude/settings.json with permission allowlist for
  the toolchain (git, cargo, npm/vite, docker, psql, gh, doc fetches).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
MechaCat02
2026-05-16 21:05:16 +02:00
commit 6c1d04aaf4
48 changed files with 1657 additions and 0 deletions

69
README.md Normal file
View File

@@ -0,0 +1,69 @@
# 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
```bash
cp .env.example .env
docker compose up --build
```
- Frontend: http://localhost:3000
- API: http://localhost:8080/api
- API health: http://localhost:8080/api/health
## Local development
Run only Postgres in Docker; run backend and frontend natively for fast iteration:
```bash
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:
```bash
# 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`](./CLAUDE.md).