docs: comprehensive API sync and documentation audit

- Rewrite OpenAPI spec to match actual code (988 lines changed):
  - Fix ToolResponse schema (add previewUrl, savedFileId)
  - Fix Error schema shape ({error, details} not {statusCode, error, message})
  - Fix POST /api/auth/register URL (was /api/auth/users)
  - Fix login/session responses (7 missing user fields + expiresAt)
  - Fix 8 endpoints returning 204 → 200 with {ok: true}
  - Fix pipeline execute field name (steps → pipeline)
  - Fix API keys response key (keys → apiKeys)
  - Fix settings response wrapper, teams UUID type
  - Rewrite 7 major tool response schemas (info, barcode-read,
    find-duplicates, compare, remove-background, upscale, ocr, blur-faces)
  - Fix files/save-result (JSON → multipart), files/upload (201 + array)
  - Fix SSE progress schema (integers not arrays)
  - Add 422/501 error responses to AI and processing tools
  - Fix settings required → optional on 29 tool endpoints
  - Add 5 missing color adjustment fields to alias endpoints
- Rewrite rest.md tool parameter descriptions (12 tools fixed)
- Add Tool Sub-Routes section to rest.md (11 endpoints)
- Fix file library, settings, pipeline, auth docs in rest.md
- Fix API key hashing description (SHA-256 → scrypt)
- Fix "GitHub Pages" → "Cloudflare Pages" in architecture + deployment docs
- Fix tool count "45+" → "47" across all doc surfaces
- Fix branding endpoint paths in rest.md (/branding/logo → /settings/logo)
This commit is contained in:
SnapOtter
2026-04-25 07:17:45 +08:00
parent 6c43802280
commit bd84728588
13 changed files with 861 additions and 274 deletions
+1 -1
View File
@@ -70,7 +70,7 @@ The built frontend gets served by the Fastify backend in production, so there is
### Docs (`apps/docs`)
This VitePress site. Deployed to GitHub Pages automatically on push to `main`.
This VitePress site. Deployed to Cloudflare Pages automatically on push to `main`.
## How a request flows
+1 -1
View File
@@ -393,7 +393,7 @@ The GitHub repository has three workflows:
- **ci.yml** -- Runs automatically on every push and PR. Lints, typechecks, tests, builds, and validates the Docker image (without pushing).
- **release.yml** -- Triggered manually via `workflow_dispatch`. Runs semantic-release to create a version tag and GitHub release, then builds a multi-arch Docker image (amd64 + arm64) and pushes to Docker Hub (`snapotter/snapotter`) and GitHub Container Registry (`ghcr.io/snapotter-hq/snapotter`).
- **deploy-docs.yml** -- Builds this documentation site and deploys it to GitHub Pages on push to `main`.
- **deploy-docs.yml** -- Builds this documentation site and deploys it to Cloudflare Pages on push to `main`.
To create a release, go to **Actions > Release > Run workflow** in the GitHub UI, or run:
+4 -4
View File
@@ -5,17 +5,17 @@ SnapOtter ships as a single Docker image that works on all platforms.
## Quick start
```bash
docker run -d --name SnapOtter -p 1349:1349 -v SnapOtter-data:/data snapotter/snapotter:latest
docker run -d --name SnapOtter -p 1349:1349 -v SnapOtter-data:/data snapotter/snapotter:latest \
&& printf "\n 🦦 SnapOtter\n ────────────────────────────────────────\n\n ➜ Open http://localhost:1349\n ➜ Login admin / admin\n ➜ Docs https://docs.snapotter.com\n\n"
```
The app is available at `http://localhost:1349`.
## GPU acceleration
The image includes CUDA support on amd64. If you have an NVIDIA GPU with the [NVIDIA Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html) installed, add `--gpus all`:
```bash
docker run -d --name SnapOtter --gpus all -p 1349:1349 -v SnapOtter-data:/data snapotter/snapotter:latest
docker run -d --name SnapOtter --gpus all -p 1349:1349 -v SnapOtter-data:/data snapotter/snapotter:latest \
&& printf "\n 🦦 SnapOtter\n ────────────────────────────────────────\n\n ➜ Open http://localhost:1349\n ➜ Login admin / admin\n ➜ Docs https://docs.snapotter.com\n\n"
```
The image auto-detects your GPU at runtime. Without `--gpus all`, it runs on CPU. Same image either way.
+8 -14
View File
@@ -3,33 +3,27 @@
## Quick Start
```bash
docker run -d --name SnapOtter -p 1349:1349 -v SnapOtter-data:/data snapotter/snapotter:latest
docker run -d --name SnapOtter -p 1349:1349 -v SnapOtter-data:/data snapotter/snapotter:latest \
&& printf "\n 🦦 SnapOtter\n ────────────────────────────────────────\n\n ➜ Open http://localhost:1349\n ➜ Login admin / admin\n ➜ Docs https://docs.snapotter.com\n\n"
```
Open [http://localhost:1349](http://localhost:1349) in your browser.
You will be asked to change your password on first login.
::: tip Also on GHCR
```bash
docker run -d --name SnapOtter -p 1349:1349 -v SnapOtter-data:/data ghcr.io/snapotter-hq/snapotter:latest
docker run -d --name SnapOtter -p 1349:1349 -v SnapOtter-data:/data ghcr.io/snapotter-hq/snapotter:latest \
&& printf "\n 🦦 SnapOtter\n ────────────────────────────────────────\n\n ➜ Open http://localhost:1349\n ➜ Login admin / admin\n ➜ Docs https://docs.snapotter.com\n\n"
```
Both registries publish the same image on every release.
:::
**Default credentials:**
| Field | Value |
|----------|---------|
| Username | `admin` |
| Password | `admin` |
You will be asked to change your password on first login.
::: tip NVIDIA GPU acceleration
Add `--gpus all` for GPU-accelerated background removal, upscaling, OCR, face enhancement, and restoration:
```bash
docker run -d --name SnapOtter -p 1349:1349 --gpus all -v SnapOtter-data:/data snapotter/snapotter:latest
docker run -d --name SnapOtter -p 1349:1349 --gpus all -v SnapOtter-data:/data snapotter/snapotter:latest \
&& printf "\n 🦦 SnapOtter\n ────────────────────────────────────────\n\n ➜ Open http://localhost:1349\n ➜ Login admin / admin\n ➜ Docs https://docs.snapotter.com\n\n"
```
Requires the [NVIDIA Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html). Falls back to CPU automatically. See [Docker Tags](/guide/docker-tags) for benchmarks.
@@ -73,7 +67,7 @@ pnpm dev
## What You Can Do
### Image Processing (45+ Tools)
### Image Processing (47 Tools)
| Category | Tools |
|----------|-------|