RustRover cargo-generate template: Axum + Vue 3 + TypeScript + Tailwind + sqlx
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

123456789101112131415161718192021222324252627282930
  1. # Architecture
  2. ```
  3. browser → Vite :5173 --proxy /api,/health--> Axum :8080 → PostgreSQL
  4. ↑ │
  5. └── generated client ← openapi.json ← utoipa-axum router
  6. ```
  7. ## Why this shape
  8. One workspace. The server owns HTTP and persistence. The web app owns interaction. The contract package is generated, never edited.
  9. Config is shared on purpose. `config/default.toml` is read by both `AppConfig::load` and `apps/web/vite.config.ts`, so the reverse proxy target cannot drift from the bind address.
  10. ## Request path
  11. 1. Vite binds `127.0.0.1` (not `localhost`) so the browser never hits IPv6 `::1`.
  12. 2. Browser calls `/api/v1/items`.
  13. 3. Vite proxies to `http://127.0.0.1:8080`.
  14. 4. `SetRequestIdLayer` assigns `X-Request-Id`.
  15. 5. `request_logging` records method, path, status, latency, request id.
  16. 6. Handler returns `Result<T, ApiError>`. Errors become a single JSON envelope.
  17. ## Adding an endpoint
  18. 1. DTO in `apps/server/src/models`.
  19. 2. Handler in `apps/server/src/handlers` with `#[utoipa::path]`.
  20. 3. Register it with `.routes(routes!(your_handler))` in `routes/mod.rs`.
  21. 4. `just generate-api`.
  22. 5. Call the new function from `apps/web/src/api/generated.ts`.