mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
docs: sync api documentation
This commit is contained in:
@@ -49,7 +49,7 @@ Shared TypeScript types, constants (like `APP_VERSION` and tool definitions), an
|
||||
|
||||
### API (`apps/api`)
|
||||
|
||||
A Fastify v5 server exposing 240 tool routes across five modalities (image, video, audio, document, data) that handles:
|
||||
A Fastify v5 server exposing 241 tool routes across five modalities (image, video, audio, document, file) that handles:
|
||||
- File uploads, temporary workspace management, and persistent file storage
|
||||
- User file library with version chains (`user_files` table) - each processed result links back to its source file and records which tool was applied, with auto-generated thumbnails for the Files page
|
||||
- Tool execution (routes each tool request to the image engine or AI bridge)
|
||||
@@ -58,8 +58,8 @@ A Fastify v5 server exposing 240 tool routes across five modalities (image, vide
|
||||
- User authentication, RBAC (admin/user roles with a full permission set), API key management, and rate limiting
|
||||
- Teams management - admin-only CRUD; users are assigned to a team via the `team` field on their profile
|
||||
- Runtime settings - a key-value store in the `settings` table that controls `disabledTools`, `enableExperimentalTools`, `loginAttemptLimit`, and other operational knobs without redeploying
|
||||
- Custom branding - logo upload endpoint; the uploaded image is stored at `data/branding/logo.png` and served to the frontend
|
||||
- Swagger/OpenAPI documentation at `/api/docs`
|
||||
- Custom branding and runtime preferences through database-backed settings
|
||||
- Scalar/OpenAPI documentation at `/api/docs`
|
||||
- Serving the built frontend as a SPA in production
|
||||
|
||||
Key dependencies: Fastify, Drizzle ORM (pg-core, node-postgres), Sharp, BullMQ, ioredis, Zod for validation.
|
||||
|
||||
@@ -62,7 +62,7 @@ Telemetry note: embedded mode inherits the image's analytics default like any ot
|
||||
| `MAX_MEGAPIXELS` | `0` (unlimited) | Maximum image resolution allowed in megapixels. Set to 0 for unlimited. |
|
||||
| `MAX_WORKER_THREADS` | `0` (auto) | Maximum worker threads for image processing. Set to 0 to auto-detect based on available CPU cores. |
|
||||
| `PROCESSING_TIMEOUT_S` | `0` (no limit) | Maximum processing time per request in seconds. Set to 0 for no timeout. |
|
||||
| `MAX_PIPELINE_STEPS` | `0` (no limit) | Maximum number of steps in a pipeline. Set to 0 for no limit. |
|
||||
| `MAX_PIPELINE_STEPS` | `20` | Maximum number of steps in a pipeline. Set to 0 for no limit. |
|
||||
| `MAX_CANVAS_PIXELS` | `0` (no limit) | Maximum canvas size in pixels for output images. Set to 0 for no limit. |
|
||||
| `MAX_SVG_SIZE_MB` | `0` (unlimited) | Maximum SVG file size in megabytes. Set to 0 for unlimited. |
|
||||
| `MAX_SPLIT_GRID` | `100` | Maximum grid dimension for the image split tool. |
|
||||
|
||||
@@ -228,7 +228,7 @@ These numbers come from benchmarks across a range of systems, from a modern amd6
|
||||
| Disk | ~5.5 GB (image) + data volume |
|
||||
| GPU | Not required |
|
||||
|
||||
Every non-AI tool — image (resize, crop, convert, compress, adjust, watermark…), video (trim, mute, remux), audio (convert, normalize, trim), PDF (merge, split, compress, rotate, protect), and data/file conversions — runs on modest hardware. Most operations finish in well under a second even on a large file: a 2.7 MB image resizes in ~0.05 s and re-encodes to WebP in ~2 s.
|
||||
All 222 non-AI catalog tools - image (resize, crop, convert, compress, adjust, watermark), video (trim, mute, remux), audio (convert, normalize, trim), PDF (merge, split, compress, rotate, protect), file conversions, and dedicated conversion presets - run on modest hardware. Most operations finish in well under a second even on a large file: a 2.7 MB image resizes in ~0.05 s and re-encodes to WebP in ~2 s.
|
||||
|
||||
The memory floor is real, from a Docker resource-limit sweep: **512 MB cannot start the stack** (even a single image resize is killed), **1 GB** handles single-file operations but a multi-file batch runs out of memory, and **2 GB / 2 cores** is the smallest configuration that handles batches comfortably.
|
||||
|
||||
@@ -248,7 +248,7 @@ deploy:
|
||||
|---|---|
|
||||
| CPU | 4 cores |
|
||||
| RAM | 4 GB |
|
||||
| Disk | 3 GB (image) + 14 GB (AI models) + workspace |
|
||||
| Disk | 3 GB (image) + 24 GB (AI models) + workspace |
|
||||
| GPU | Not required (CPU fallback) |
|
||||
|
||||
**Installing the AI bundles is what pushes RAM to 4 GB.** With no AI installed the app idles around 360 MB; with all seven bundles installed it holds ~2.6 GB resident, because the Python AI sidecar pre-loads its models (background removal, upscaling, OCR, transcription, face detection, restoration) at startup. Non-AI installs stay light; AI installs need ≥4 GB.
|
||||
@@ -268,13 +268,13 @@ AI model download sizes:
|
||||
|
||||
| Bundle | Disk Size |
|
||||
|---|---|
|
||||
| Background removal | 3-4 GB |
|
||||
| Upscale + Face enhance + Noise removal | 4-5 GB |
|
||||
| Background removal | 4-5 GB |
|
||||
| Upscale + Face enhance + Noise removal | 5-6 GB |
|
||||
| Face detection | 200-300 MB |
|
||||
| Object eraser + Colorize | 1-2 GB |
|
||||
| OCR | 3-4 GB |
|
||||
| Photo restoration | 800 MB - 1 GB |
|
||||
| **All bundles** | **~14 GB** |
|
||||
| OCR | 5-6 GB |
|
||||
| Photo restoration | 4-5 GB |
|
||||
| **All bundles** | **~24 GB** |
|
||||
|
||||
```yaml
|
||||
deploy:
|
||||
|
||||
@@ -111,14 +111,14 @@ pnpm dev
|
||||
|
||||
## What You Can Do
|
||||
|
||||
### File Processing (200+ Tools)
|
||||
### File Processing (241 Tools)
|
||||
|
||||
| Modality | Count | Example Tools |
|
||||
|----------|-------|---------------|
|
||||
| **Image** | 64 | Resize, Crop, Compress, Convert, Remove Background, Upscale, OCR, Watermark, Collage, Colorize, GIF Tools |
|
||||
| **Video** | 29 | Trim, Crop, Compress, Convert, Merge, Extract Audio, Auto Subtitles, Video to GIF, Resize, Stabilize |
|
||||
| **Audio** | 17 | Trim, Merge, Convert, Normalize, Noise Reduction, Transcribe, Pitch Shift, Fade, Ringtone Maker |
|
||||
| **PDF / Document** | 37 | Merge, Split, Compress, OCR, Watermark, Redact, Word to PDF, Excel to PDF, Rotate, Protect, Repair |
|
||||
| **Image** | 105 | Resize, Crop, Compress, Convert, Remove Background, Upscale, OCR, Watermark, Collage, Colorize, GIF Tools, format presets |
|
||||
| **Video** | 57 | Trim, Crop, Compress, Convert, Merge, Extract Audio, Auto Subtitles, Video to GIF, Resize, Stabilize, format presets |
|
||||
| **Audio** | 27 | Trim, Merge, Convert, Normalize, Noise Reduction, Transcribe, Pitch Shift, Fade, Ringtone Maker, format presets |
|
||||
| **PDF / Document** | 42 | Merge, Split, Compress, OCR, Watermark, Redact, Word to PDF, Excel to PDF, Rotate, Protect, Repair |
|
||||
| **Files** | 10 | CSV to JSON, JSON to XML, Merge CSVs, Split CSV, Create ZIP, Extract ZIP, Chart Maker, YAML/JSON |
|
||||
|
||||
### Pipelines
|
||||
@@ -130,7 +130,7 @@ Chain tools into multi-step workflows and apply them to one image or a whole bat
|
||||
3. Run on a single file - or an entire batch at once.
|
||||
4. Save the pipeline for later reuse.
|
||||
|
||||
Pipelines have unlimited steps by default.
|
||||
Pipelines allow 20 steps by default. Set `MAX_PIPELINE_STEPS=0` to make the limit unlimited.
|
||||
|
||||
### File Library
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ SCIM provisioning requires an **enterprise** license with the `scim` feature. It
|
||||
|
||||
- A running SnapOtter instance reachable at a public URL
|
||||
- An enterprise license key with the `scim` feature
|
||||
- Admin access to SnapOtter (the `users:manage` permission is required to generate a SCIM token)
|
||||
- Admin access to SnapOtter (the `users:manage` permission is required to generate or revoke a SCIM token)
|
||||
- Admin access to your identity provider's provisioning settings
|
||||
|
||||
## Quick start
|
||||
|
||||
@@ -296,7 +296,7 @@ docker run --rm -v SnapOtter-data:/data -v $(pwd)/backup:/backup \
|
||||
--exclude='ai' --exclude='venv' -C /data .
|
||||
```
|
||||
|
||||
AI models total up to 14 GB across all bundles. Since they are re-downloadable, exclude `/data/ai/` and `/data/venv/` from backups to save space. Only the database and user files are critical.
|
||||
AI models total up to about 24 GB across all bundles. Since they are re-downloadable, exclude `/data/ai/` and `/data/venv/` from backups to save space. Only the database and user files are critical.
|
||||
|
||||
## Compliance Artifacts
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ SnapOtter ships three built-in roles, 17 granular permissions, and support for c
|
||||
|
||||
### Creating users
|
||||
|
||||
Admins can create users through the admin panel or the `POST /api/auth/users` endpoint. Each user has a username, role, team assignment, and an optional email address.
|
||||
Admins can create users through the admin panel or the `POST /api/auth/register` endpoint. Each user has a username, role, team assignment, and an optional email address.
|
||||
|
||||
### Default admin
|
||||
|
||||
@@ -90,12 +90,12 @@ All 17 permissions. Full control over the instance.
|
||||
|
||||
## Custom roles
|
||||
|
||||
Admins with the `users:manage` permission can create custom roles through the admin panel or the roles API.
|
||||
Admins with the `security:manage` permission can create custom roles through the admin panel or the roles API. Listing roles requires `audit:read`.
|
||||
|
||||
### Creating a custom role
|
||||
|
||||
```bash
|
||||
curl -X POST http://localhost:13490/api/v1/roles \
|
||||
curl -X POST http://localhost:1349/api/v1/roles \
|
||||
-H "Authorization: Bearer si_..." \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
@@ -167,7 +167,7 @@ Users can generate API keys for programmatic access. Each key uses the `si_` pre
|
||||
API keys can optionally carry a `permissions` array. When set, the effective permissions for a request are the **intersection** of the user's role permissions and the key's scoped permissions. This means an API key can never escalate beyond the user's own permissions.
|
||||
|
||||
```bash
|
||||
curl -X POST http://localhost:13490/api/v1/api-keys \
|
||||
curl -X POST http://localhost:1349/api/v1/api-keys \
|
||||
-H "Authorization: Bearer si_..." \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
|
||||
Reference in New Issue
Block a user