-
Notifications
You must be signed in to change notification settings - Fork 0
Local Development
This page describes how to develop on MangaCollector without Docker — for hot reload, debugger attach, fast iteration on a single component.
The Docker compose is still useful in dev (it gives you Postgres + Redis + MinIO with one command), but you'll typically run the frontend and backend as native processes against those containerised services.
| Component | What you need |
|---|---|
| Backend | Rust 1.94 (pinned by rust-toolchain.toml), cargo
|
| Frontend | Node 22+ (pinned by package.json engines), npm
|
| Database | Postgres 15 (or use the dev compose) |
| Cache | Redis 7+ (or use the dev compose) |
Optional but useful: rustfmt, clippy, an editor with rust-analyzer.
The lightest way to have Postgres + Redis available locally is to start them from the dev compose without the application services:
docker compose up -d db redisThis exposes:
- Postgres on
localhost:18966 - Redis on
localhost:18967
Both with credentials matching server/.env.example.
cd server
cp .env.example .env
# fill AUTH_CLIENT_ID / AUTH_CLIENT_SECRET / SESSION_SECRET
cargo runMigrations run automatically at boot. The first build is ~3-5 minutes (SeaORM, Axum, sqlx are heavy); subsequent rebuilds use the incremental cache and complete in seconds.
Listening on http://localhost:3000 by default. The backend's CORS / cookie
policy expects FRONTEND_URL=http://localhost:5173 in dev.
cargo check # fast compile check, no codegen
cargo test # full test suite
cargo clippy --all-targets -- -D warnings
cargo fmtcargo watch is the cleanest way to get hot reload on backend changes:
cargo install cargo-watch
cargo watch -x runEach rebuild typically takes 5-10 s on a warm cache.
cd client
npm install
npm run devVite serves on http://localhost:5173 with HMR. The dev server proxies
/api, /auth, /ws to http://localhost:3000 — see client/vite.config.js.
The PWA service worker is disabled in dev (no caching aggravation when iterating). To test the PWA flow:
npm run build && npm run previewThis serves the production build from dist/, including the registered
service worker.
npm run lint # ESLint
npm run format # Prettier
npm run build # Production build
npm run preview # Serve production build locallyRecommended extensions:
-
rust-lang.rust-analyzer— backend -
dbaeumer.vscode-eslint— frontend -
esbenp.prettier-vscode— frontend -
bradlc.vscode-tailwindcss— Tailwind class autocompletion
The repo ships an .idea/ folder configured for the whole stack —
WebStorm picks up the React project, RustRover picks up the backend, IntelliJ
Ultimate handles both.
- Add the handler in
server/src/handlers/. - Wire it in the relevant
server/src/routes/module. - Add the corresponding TanStack Query key + helper in
client/src/hooks/orclient/src/utils/. - Test with the dev frontend at
http://localhost:5173.
- Pick a fresh timestamp:
date +%Y%m%d%H%M%S
- Create the file:
server/migrations/{timestamp}_short_name.sql. - Write forward-only SQL — there's no down migration.
- Restart
cargo run. The migration runner picks it up at boot.
docker compose exec db psql -U mangacollector
# or
psql -h localhost -p 18966 -U mangacollector -d mangacollectorPassword matches server/.env.example.
docker compose exec redis redis-cli
KEYS *
GET mangacollect/some-keyIf you're working on UI without touching the backend, the easiest setup is:
- Run the production backend in Docker:
docker compose up -d server db redis
- Run the dev frontend natively:
cd client && npm run dev
This way the API is stable (one container), and you get HMR on the UI.
Symmetric scenario:
- Run the production frontend in Docker:
It will be served at
docker compose up -d client traefik
http://localhost:12000. - Run the dev backend natively (
cargo run).
You'll need to stop the dev compose's server container so port 3000
is free, then either keep Traefik pointing at the dev backend, or hit
http://localhost:3000 directly.
| What | How |
|---|---|
| Backend unit tests |
cargo test (in server/) |
| Backend integration | none yet — manual |
| Frontend unit | none configured — npm test errors on purpose |
| Lint + types | npm run lint && cargo clippy |
The test culture leans on type safety (Rust + TanStack Query schemas) and hand-driven smoke tests rather than unit-coverage. Contributions adding real test infrastructure are welcome.
🛠️ Infrastructure
- Architecture
- Quick start (Docker)
- Production
- Local development
- Environment variables
- Authentication
- Storage
- Database & migrations
👤 User guide
- Library
- Adding a series
- Series page
- Volume editing
- Coffrets
- Calendar
- Seals
- Profile & stats
- Public profile
- Settings
- Import / export
🔌 Release proxy
📚 Reference