@weirdfingers/baseboards 0.9.6 → 0.9.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +560 -469
- package/dist/index.js.map +1 -1
- package/package.json +2 -5
- package/templates/README.md +0 -122
- package/templates/api/.env.example +0 -65
- package/templates/api/ARTIFACT_RESOLUTION_GUIDE.md +0 -148
- package/templates/api/Dockerfile +0 -32
- package/templates/api/README.md +0 -264
- package/templates/api/alembic/env.py +0 -114
- package/templates/api/alembic/script.py.mako +0 -28
- package/templates/api/alembic/versions/20250101_000000_initial_schema.py +0 -506
- package/templates/api/alembic/versions/20251022_174729_remove_provider_name_from_generations.py +0 -75
- package/templates/api/alembic/versions/20251023_165852_switch_to_declarative_base_and_mapping.py +0 -467
- package/templates/api/alembic/versions/20251202_000000_add_artifact_lineage.py +0 -134
- package/templates/api/alembic/versions/2025925_62735_add_seed_data_for_default_tenant.py +0 -88
- package/templates/api/alembic.ini +0 -36
- package/templates/api/config/generators.yaml +0 -237
- package/templates/api/config/storage_config.yaml +0 -26
- package/templates/api/docs/ADDING_GENERATORS.md +0 -409
- package/templates/api/docs/GENERATORS_API.md +0 -502
- package/templates/api/docs/MIGRATIONS.md +0 -472
- package/templates/api/docs/TESTING_LIVE_APIS.md +0 -417
- package/templates/api/docs/storage_providers.md +0 -337
- package/templates/api/pyproject.toml +0 -205
- package/templates/api/src/boards/__init__.py +0 -10
- package/templates/api/src/boards/api/app.py +0 -172
- package/templates/api/src/boards/api/auth.py +0 -75
- package/templates/api/src/boards/api/endpoints/__init__.py +0 -3
- package/templates/api/src/boards/api/endpoints/jobs.py +0 -76
- package/templates/api/src/boards/api/endpoints/setup.py +0 -505
- package/templates/api/src/boards/api/endpoints/sse.py +0 -129
- package/templates/api/src/boards/api/endpoints/storage.py +0 -155
- package/templates/api/src/boards/api/endpoints/tenant_registration.py +0 -296
- package/templates/api/src/boards/api/endpoints/uploads.py +0 -149
- package/templates/api/src/boards/api/endpoints/webhooks.py +0 -13
- package/templates/api/src/boards/auth/__init__.py +0 -15
- package/templates/api/src/boards/auth/adapters/__init__.py +0 -27
- package/templates/api/src/boards/auth/adapters/auth0.py +0 -220
- package/templates/api/src/boards/auth/adapters/base.py +0 -73
- package/templates/api/src/boards/auth/adapters/clerk.py +0 -172
- package/templates/api/src/boards/auth/adapters/jwt.py +0 -122
- package/templates/api/src/boards/auth/adapters/none.py +0 -102
- package/templates/api/src/boards/auth/adapters/oidc.py +0 -284
- package/templates/api/src/boards/auth/adapters/supabase.py +0 -110
- package/templates/api/src/boards/auth/context.py +0 -35
- package/templates/api/src/boards/auth/factory.py +0 -129
- package/templates/api/src/boards/auth/middleware.py +0 -221
- package/templates/api/src/boards/auth/provisioning.py +0 -129
- package/templates/api/src/boards/auth/tenant_extraction.py +0 -278
- package/templates/api/src/boards/cli.py +0 -354
- package/templates/api/src/boards/config.py +0 -131
- package/templates/api/src/boards/database/__init__.py +0 -7
- package/templates/api/src/boards/database/cli.py +0 -110
- package/templates/api/src/boards/database/connection.py +0 -292
- package/templates/api/src/boards/database/models.py +0 -19
- package/templates/api/src/boards/database/seed_data.py +0 -182
- package/templates/api/src/boards/dbmodels/__init__.py +0 -441
- package/templates/api/src/boards/generators/__init__.py +0 -57
- package/templates/api/src/boards/generators/artifact_resolution.py +0 -405
- package/templates/api/src/boards/generators/artifacts.py +0 -53
- package/templates/api/src/boards/generators/base.py +0 -144
- package/templates/api/src/boards/generators/implementations/__init__.py +0 -14
- package/templates/api/src/boards/generators/implementations/fal/__init__.py +0 -25
- package/templates/api/src/boards/generators/implementations/fal/audio/__init__.py +0 -23
- package/templates/api/src/boards/generators/implementations/fal/audio/beatoven_music_generation.py +0 -171
- package/templates/api/src/boards/generators/implementations/fal/audio/beatoven_sound_effect_generation.py +0 -167
- package/templates/api/src/boards/generators/implementations/fal/audio/chatterbox_text_to_speech.py +0 -176
- package/templates/api/src/boards/generators/implementations/fal/audio/chatterbox_tts_turbo.py +0 -195
- package/templates/api/src/boards/generators/implementations/fal/audio/elevenlabs_sound_effects_v2.py +0 -194
- package/templates/api/src/boards/generators/implementations/fal/audio/elevenlabs_tts_eleven_v3.py +0 -209
- package/templates/api/src/boards/generators/implementations/fal/audio/fal_elevenlabs_tts_turbo_v2_5.py +0 -206
- package/templates/api/src/boards/generators/implementations/fal/audio/fal_minimax_speech_26_hd.py +0 -237
- package/templates/api/src/boards/generators/implementations/fal/audio/minimax_music_v2.py +0 -173
- package/templates/api/src/boards/generators/implementations/fal/audio/minimax_speech_2_6_turbo.py +0 -221
- package/templates/api/src/boards/generators/implementations/fal/image/__init__.py +0 -63
- package/templates/api/src/boards/generators/implementations/fal/image/bytedance_seedream_v45_edit.py +0 -219
- package/templates/api/src/boards/generators/implementations/fal/image/clarity_upscaler.py +0 -220
- package/templates/api/src/boards/generators/implementations/fal/image/crystal_upscaler.py +0 -173
- package/templates/api/src/boards/generators/implementations/fal/image/fal_ideogram_character.py +0 -227
- package/templates/api/src/boards/generators/implementations/fal/image/flux_2.py +0 -203
- package/templates/api/src/boards/generators/implementations/fal/image/flux_2_edit.py +0 -230
- package/templates/api/src/boards/generators/implementations/fal/image/flux_2_pro.py +0 -204
- package/templates/api/src/boards/generators/implementations/fal/image/flux_2_pro_edit.py +0 -221
- package/templates/api/src/boards/generators/implementations/fal/image/flux_pro_kontext.py +0 -216
- package/templates/api/src/boards/generators/implementations/fal/image/flux_pro_ultra.py +0 -197
- package/templates/api/src/boards/generators/implementations/fal/image/gemini_25_flash_image.py +0 -177
- package/templates/api/src/boards/generators/implementations/fal/image/gemini_25_flash_image_edit.py +0 -208
- package/templates/api/src/boards/generators/implementations/fal/image/gpt_image_15_edit.py +0 -216
- package/templates/api/src/boards/generators/implementations/fal/image/gpt_image_1_5.py +0 -177
- package/templates/api/src/boards/generators/implementations/fal/image/gpt_image_1_edit_image.py +0 -182
- package/templates/api/src/boards/generators/implementations/fal/image/gpt_image_1_mini.py +0 -167
- package/templates/api/src/boards/generators/implementations/fal/image/ideogram_character_edit.py +0 -299
- package/templates/api/src/boards/generators/implementations/fal/image/ideogram_v2.py +0 -190
- package/templates/api/src/boards/generators/implementations/fal/image/imagen4_preview.py +0 -191
- package/templates/api/src/boards/generators/implementations/fal/image/imagen4_preview_fast.py +0 -179
- package/templates/api/src/boards/generators/implementations/fal/image/nano_banana.py +0 -183
- package/templates/api/src/boards/generators/implementations/fal/image/nano_banana_edit.py +0 -212
- package/templates/api/src/boards/generators/implementations/fal/image/nano_banana_pro.py +0 -179
- package/templates/api/src/boards/generators/implementations/fal/image/nano_banana_pro_edit.py +0 -226
- package/templates/api/src/boards/generators/implementations/fal/image/qwen_image.py +0 -249
- package/templates/api/src/boards/generators/implementations/fal/image/qwen_image_edit.py +0 -244
- package/templates/api/src/boards/generators/implementations/fal/image/reve_edit.py +0 -178
- package/templates/api/src/boards/generators/implementations/fal/image/reve_text_to_image.py +0 -155
- package/templates/api/src/boards/generators/implementations/fal/image/seedream_v45_text_to_image.py +0 -180
- package/templates/api/src/boards/generators/implementations/fal/utils.py +0 -61
- package/templates/api/src/boards/generators/implementations/fal/video/__init__.py +0 -77
- package/templates/api/src/boards/generators/implementations/fal/video/bytedance_seedance_v1_pro_text_to_video.py +0 -209
- package/templates/api/src/boards/generators/implementations/fal/video/creatify_lipsync.py +0 -161
- package/templates/api/src/boards/generators/implementations/fal/video/fal_bytedance_seedance_v1_pro_image_to_video.py +0 -222
- package/templates/api/src/boards/generators/implementations/fal/video/fal_minimax_hailuo_02_standard_text_to_video.py +0 -152
- package/templates/api/src/boards/generators/implementations/fal/video/fal_pixverse_lipsync.py +0 -197
- package/templates/api/src/boards/generators/implementations/fal/video/fal_sora_2_text_to_video.py +0 -173
- package/templates/api/src/boards/generators/implementations/fal/video/infinitalk.py +0 -221
- package/templates/api/src/boards/generators/implementations/fal/video/kling_video_ai_avatar_v2_pro.py +0 -168
- package/templates/api/src/boards/generators/implementations/fal/video/kling_video_ai_avatar_v2_standard.py +0 -159
- package/templates/api/src/boards/generators/implementations/fal/video/kling_video_v2_5_turbo_pro_image_to_video.py +0 -175
- package/templates/api/src/boards/generators/implementations/fal/video/kling_video_v2_5_turbo_pro_text_to_video.py +0 -168
- package/templates/api/src/boards/generators/implementations/fal/video/minimax_hailuo_2_3_pro_image_to_video.py +0 -153
- package/templates/api/src/boards/generators/implementations/fal/video/sora2_image_to_video.py +0 -172
- package/templates/api/src/boards/generators/implementations/fal/video/sora_2_image_to_video_pro.py +0 -175
- package/templates/api/src/boards/generators/implementations/fal/video/sora_2_text_to_video_pro.py +0 -163
- package/templates/api/src/boards/generators/implementations/fal/video/sync_lipsync_v2.py +0 -167
- package/templates/api/src/boards/generators/implementations/fal/video/sync_lipsync_v2_pro.py +0 -155
- package/templates/api/src/boards/generators/implementations/fal/video/veed_fabric_1_0.py +0 -180
- package/templates/api/src/boards/generators/implementations/fal/video/veed_lipsync.py +0 -174
- package/templates/api/src/boards/generators/implementations/fal/video/veo3.py +0 -194
- package/templates/api/src/boards/generators/implementations/fal/video/veo31.py +0 -190
- package/templates/api/src/boards/generators/implementations/fal/video/veo31_fast.py +0 -190
- package/templates/api/src/boards/generators/implementations/fal/video/veo31_fast_image_to_video.py +0 -191
- package/templates/api/src/boards/generators/implementations/fal/video/veo31_first_last_frame_to_video.py +0 -187
- package/templates/api/src/boards/generators/implementations/fal/video/veo31_image_to_video.py +0 -183
- package/templates/api/src/boards/generators/implementations/fal/video/veo31_reference_to_video.py +0 -172
- package/templates/api/src/boards/generators/implementations/fal/video/wan_25_preview_image_to_video.py +0 -212
- package/templates/api/src/boards/generators/implementations/fal/video/wan_25_preview_text_to_video.py +0 -208
- package/templates/api/src/boards/generators/implementations/fal/video/wan_pro_image_to_video.py +0 -158
- package/templates/api/src/boards/generators/implementations/kie/__init__.py +0 -11
- package/templates/api/src/boards/generators/implementations/kie/base.py +0 -316
- package/templates/api/src/boards/generators/implementations/kie/image/__init__.py +0 -3
- package/templates/api/src/boards/generators/implementations/kie/image/nano_banana_edit.py +0 -190
- package/templates/api/src/boards/generators/implementations/kie/utils.py +0 -98
- package/templates/api/src/boards/generators/implementations/kie/video/__init__.py +0 -8
- package/templates/api/src/boards/generators/implementations/kie/video/veo3.py +0 -161
- package/templates/api/src/boards/generators/implementations/openai/__init__.py +0 -1
- package/templates/api/src/boards/generators/implementations/openai/audio/__init__.py +0 -1
- package/templates/api/src/boards/generators/implementations/openai/audio/whisper.py +0 -69
- package/templates/api/src/boards/generators/implementations/openai/image/__init__.py +0 -1
- package/templates/api/src/boards/generators/implementations/openai/image/dalle3.py +0 -96
- package/templates/api/src/boards/generators/implementations/replicate/__init__.py +0 -1
- package/templates/api/src/boards/generators/implementations/replicate/image/__init__.py +0 -1
- package/templates/api/src/boards/generators/implementations/replicate/image/flux_pro.py +0 -88
- package/templates/api/src/boards/generators/implementations/replicate/video/__init__.py +0 -1
- package/templates/api/src/boards/generators/implementations/replicate/video/lipsync.py +0 -73
- package/templates/api/src/boards/generators/loader.py +0 -253
- package/templates/api/src/boards/generators/registry.py +0 -114
- package/templates/api/src/boards/generators/resolution.py +0 -632
- package/templates/api/src/boards/generators/testmods/class_gen.py +0 -34
- package/templates/api/src/boards/generators/testmods/import_side_effect.py +0 -35
- package/templates/api/src/boards/graphql/__init__.py +0 -7
- package/templates/api/src/boards/graphql/access_control.py +0 -136
- package/templates/api/src/boards/graphql/mutations/root.py +0 -148
- package/templates/api/src/boards/graphql/queries/root.py +0 -116
- package/templates/api/src/boards/graphql/resolvers/__init__.py +0 -8
- package/templates/api/src/boards/graphql/resolvers/auth.py +0 -12
- package/templates/api/src/boards/graphql/resolvers/board.py +0 -1053
- package/templates/api/src/boards/graphql/resolvers/generation.py +0 -666
- package/templates/api/src/boards/graphql/resolvers/generator.py +0 -50
- package/templates/api/src/boards/graphql/resolvers/lineage.py +0 -381
- package/templates/api/src/boards/graphql/resolvers/upload.py +0 -463
- package/templates/api/src/boards/graphql/resolvers/user.py +0 -25
- package/templates/api/src/boards/graphql/schema.py +0 -81
- package/templates/api/src/boards/graphql/types/board.py +0 -102
- package/templates/api/src/boards/graphql/types/generation.py +0 -166
- package/templates/api/src/boards/graphql/types/generator.py +0 -17
- package/templates/api/src/boards/graphql/types/user.py +0 -47
- package/templates/api/src/boards/jobs/repository.py +0 -153
- package/templates/api/src/boards/logging.py +0 -195
- package/templates/api/src/boards/middleware.py +0 -339
- package/templates/api/src/boards/progress/__init__.py +0 -4
- package/templates/api/src/boards/progress/models.py +0 -25
- package/templates/api/src/boards/progress/publisher.py +0 -64
- package/templates/api/src/boards/py.typed +0 -0
- package/templates/api/src/boards/redis_pool.py +0 -118
- package/templates/api/src/boards/storage/__init__.py +0 -52
- package/templates/api/src/boards/storage/base.py +0 -363
- package/templates/api/src/boards/storage/config.py +0 -187
- package/templates/api/src/boards/storage/factory.py +0 -288
- package/templates/api/src/boards/storage/implementations/__init__.py +0 -27
- package/templates/api/src/boards/storage/implementations/gcs.py +0 -340
- package/templates/api/src/boards/storage/implementations/local.py +0 -201
- package/templates/api/src/boards/storage/implementations/s3.py +0 -294
- package/templates/api/src/boards/storage/implementations/supabase.py +0 -218
- package/templates/api/src/boards/tenant_isolation.py +0 -446
- package/templates/api/src/boards/validation.py +0 -262
- package/templates/api/src/boards/workers/__init__.py +0 -1
- package/templates/api/src/boards/workers/actors.py +0 -274
- package/templates/api/src/boards/workers/cli.py +0 -125
- package/templates/api/src/boards/workers/context.py +0 -348
- package/templates/api/src/boards/workers/middleware.py +0 -58
- package/templates/api/src/py.typed +0 -0
- package/templates/compose.web.yaml +0 -35
- package/templates/compose.yaml +0 -116
- package/templates/docker/env.example +0 -23
- package/templates/web/.env.example +0 -28
- package/templates/web/Dockerfile +0 -51
- package/templates/web/components.json +0 -22
- package/templates/web/imageLoader.js +0 -18
- package/templates/web/next-env.d.ts +0 -5
- package/templates/web/next.config.js +0 -36
- package/templates/web/package.json +0 -41
- package/templates/web/postcss.config.mjs +0 -7
- package/templates/web/public/favicon.ico +0 -0
- package/templates/web/src/app/boards/[boardId]/page.tsx +0 -353
- package/templates/web/src/app/globals.css +0 -123
- package/templates/web/src/app/layout.tsx +0 -31
- package/templates/web/src/app/lineage/[generationId]/page.tsx +0 -235
- package/templates/web/src/app/page.tsx +0 -35
- package/templates/web/src/app/providers.tsx +0 -18
- package/templates/web/src/components/boards/ArtifactInputSlots.tsx +0 -206
- package/templates/web/src/components/boards/ArtifactPreview.tsx +0 -466
- package/templates/web/src/components/boards/GenerationGrid.tsx +0 -282
- package/templates/web/src/components/boards/GenerationInput.tsx +0 -370
- package/templates/web/src/components/boards/GeneratorSelector.tsx +0 -272
- package/templates/web/src/components/boards/UploadArtifact.tsx +0 -563
- package/templates/web/src/components/header.tsx +0 -32
- package/templates/web/src/components/theme-provider.tsx +0 -10
- package/templates/web/src/components/theme-toggle.tsx +0 -75
- package/templates/web/src/components/ui/alert-dialog.tsx +0 -157
- package/templates/web/src/components/ui/button.tsx +0 -58
- package/templates/web/src/components/ui/card.tsx +0 -92
- package/templates/web/src/components/ui/dropdown-menu.tsx +0 -200
- package/templates/web/src/components/ui/navigation-menu.tsx +0 -168
- package/templates/web/src/components/ui/toast.tsx +0 -128
- package/templates/web/src/components/ui/toaster.tsx +0 -35
- package/templates/web/src/components/ui/use-toast.ts +0 -187
- package/templates/web/src/hooks/useGeneratorMRU.ts +0 -57
- package/templates/web/src/lib/utils.ts +0 -6
- package/templates/web/tsconfig.json +0 -41
package/package.json
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weirdfingers/baseboards",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.7",
|
|
4
4
|
"description": "One-command launcher for the Boards image generation application",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"baseboards": "./dist/index.js"
|
|
8
8
|
},
|
|
9
9
|
"files": [
|
|
10
|
-
"dist"
|
|
11
|
-
"templates"
|
|
10
|
+
"dist"
|
|
12
11
|
],
|
|
13
12
|
"keywords": [
|
|
14
13
|
"boards",
|
|
@@ -61,8 +60,6 @@
|
|
|
61
60
|
"vitest": "^1.6.0"
|
|
62
61
|
},
|
|
63
62
|
"scripts": {
|
|
64
|
-
"prepare-templates": "node scripts/prepare-templates.js",
|
|
65
|
-
"prebuild": "pnpm run prepare-templates",
|
|
66
63
|
"build": "tsup && node scripts/add-shebang.js",
|
|
67
64
|
"dev": "tsup --watch",
|
|
68
65
|
"test": "vitest --run",
|
package/templates/README.md
DELETED
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
# Baseboards - Image Generation Platform
|
|
2
|
-
|
|
3
|
-
This is a self-hosted Baseboards installation, scaffolded by the Baseboards CLI.
|
|
4
|
-
|
|
5
|
-
## Quick Start
|
|
6
|
-
|
|
7
|
-
### Prerequisites
|
|
8
|
-
|
|
9
|
-
- Docker Desktop (macOS/Windows) or Docker Engine (Linux)
|
|
10
|
-
- Node.js 20+
|
|
11
|
-
|
|
12
|
-
### First-Time Setup
|
|
13
|
-
|
|
14
|
-
1. **Configure API Keys** (Required)
|
|
15
|
-
|
|
16
|
-
Edit `api/.env` and add at least one provider API key:
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
# Get your API keys from:
|
|
20
|
-
# - Replicate: https://replicate.com/account/api-tokens
|
|
21
|
-
# - FAL: https://fal.ai/dashboard/keys
|
|
22
|
-
# - KIE: https://kie.ai/dashboard
|
|
23
|
-
# - OpenAI: https://platform.openai.com/api-keys
|
|
24
|
-
# - Google: https://makersuite.google.com/app/apikey
|
|
25
|
-
|
|
26
|
-
REPLICATE_API_KEY=r8_...
|
|
27
|
-
FAL_KEY=...
|
|
28
|
-
KIE_API_KEY=...
|
|
29
|
-
OPENAI_API_KEY=sk-...
|
|
30
|
-
GOOGLE_API_KEY=...
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
2. **Start the application**
|
|
34
|
-
|
|
35
|
-
```bash
|
|
36
|
-
npx @weirdfingers/baseboards up
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
3. **Access the app**
|
|
40
|
-
|
|
41
|
-
Open http://localhost:3300 in your browser
|
|
42
|
-
|
|
43
|
-
## Commands
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
# Start the application
|
|
47
|
-
npx @weirdfingers/baseboards up
|
|
48
|
-
|
|
49
|
-
# Start in detached mode (background)
|
|
50
|
-
npx @weirdfingers/baseboards up --detached
|
|
51
|
-
|
|
52
|
-
# Stop the application
|
|
53
|
-
npx @weirdfingers/baseboards down
|
|
54
|
-
|
|
55
|
-
# View logs
|
|
56
|
-
npx @weirdfingers/baseboards logs
|
|
57
|
-
|
|
58
|
-
# View specific service logs
|
|
59
|
-
npx @weirdfingers/baseboards logs api
|
|
60
|
-
|
|
61
|
-
# Check status
|
|
62
|
-
npx @weirdfingers/baseboards status
|
|
63
|
-
|
|
64
|
-
# Update to latest version
|
|
65
|
-
npx @weirdfingers/baseboards update
|
|
66
|
-
|
|
67
|
-
# Clean up (removes volumes and containers)
|
|
68
|
-
npx @weirdfingers/baseboards clean --hard
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
## Configuration
|
|
72
|
-
|
|
73
|
-
### Generators
|
|
74
|
-
|
|
75
|
-
Edit `api/config/generators.yaml` to:
|
|
76
|
-
|
|
77
|
-
- Enable/disable specific image generation providers
|
|
78
|
-
- Add custom Replicate models
|
|
79
|
-
- Configure provider-specific settings
|
|
80
|
-
|
|
81
|
-
### Storage
|
|
82
|
-
|
|
83
|
-
Edit `api/config/storage_config.yaml` to:
|
|
84
|
-
|
|
85
|
-
- Switch from local storage to S3/GCS/Cloudflare R2
|
|
86
|
-
- Configure CDN integration
|
|
87
|
-
- Set up routing rules for different file types
|
|
88
|
-
|
|
89
|
-
Generated media is stored in `data/storage/` by default.
|
|
90
|
-
|
|
91
|
-
## Development
|
|
92
|
-
|
|
93
|
-
### Hot Reload
|
|
94
|
-
|
|
95
|
-
The default development mode includes hot reload for both frontend and backend:
|
|
96
|
-
|
|
97
|
-
- Frontend: Next.js Fast Refresh
|
|
98
|
-
- Backend: uvicorn --reload
|
|
99
|
-
|
|
100
|
-
Changes to source code are reflected immediately.
|
|
101
|
-
|
|
102
|
-
### Custom Code
|
|
103
|
-
|
|
104
|
-
You can customize any part of the application:
|
|
105
|
-
|
|
106
|
-
- Frontend: `web/src/`
|
|
107
|
-
- Backend: `api/src/`
|
|
108
|
-
|
|
109
|
-
**Note:** When you run `update`, custom code changes will be overwritten.
|
|
110
|
-
Use git to track your modifications.
|
|
111
|
-
|
|
112
|
-
## Documentation
|
|
113
|
-
|
|
114
|
-
- Full documentation: https://baseboards.dev/docs
|
|
115
|
-
- Adding providers: https://baseboards.dev/docs/generators
|
|
116
|
-
- Storage configuration: https://baseboards.dev/docs/storage
|
|
117
|
-
- Auth setup: https://baseboards.dev/docs/auth
|
|
118
|
-
|
|
119
|
-
## Support
|
|
120
|
-
|
|
121
|
-
- GitHub Issues: https://github.com/weirdfingers/boards/issues
|
|
122
|
-
- Documentation: https://baseboards.dev
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
# Backend Environment Variables
|
|
2
|
-
# Note: Database and Redis URLs are set in docker/.env
|
|
3
|
-
|
|
4
|
-
# API Port (must match docker-compose port mapping)
|
|
5
|
-
BOARDS_API_PORT=8800
|
|
6
|
-
|
|
7
|
-
# CORS Origins (allow frontend to access API)
|
|
8
|
-
BOARDS_CORS_ORIGINS=["http://localhost:3300"]
|
|
9
|
-
|
|
10
|
-
# JWT Secret (will be generated by CLI)
|
|
11
|
-
BOARDS_JWT_SECRET=
|
|
12
|
-
|
|
13
|
-
# ============================================
|
|
14
|
-
# PROVIDER API KEYS (ADD AT LEAST ONE!)
|
|
15
|
-
# ============================================
|
|
16
|
-
|
|
17
|
-
# Replicate - https://replicate.com/account/api-tokens
|
|
18
|
-
REPLICATE_API_TOKEN=
|
|
19
|
-
|
|
20
|
-
# FAL - https://fal.ai/dashboard/keys
|
|
21
|
-
FAL_KEY=
|
|
22
|
-
|
|
23
|
-
# KIE - https://kie.ai/dashboard
|
|
24
|
-
KIE_API_KEY=
|
|
25
|
-
|
|
26
|
-
# OpenAI - https://platform.openai.com/api-keys
|
|
27
|
-
OPENAI_API_KEY=
|
|
28
|
-
|
|
29
|
-
# Google AI - https://makersuite.google.com/app/apikey
|
|
30
|
-
GOOGLE_API_KEY=
|
|
31
|
-
|
|
32
|
-
# ============================================
|
|
33
|
-
# AUTH PROVIDER
|
|
34
|
-
# ============================================
|
|
35
|
-
# For local development, 'none' allows unauthenticated access
|
|
36
|
-
# For production, configure a proper provider (clerk, supabase, auth0, jwt)
|
|
37
|
-
BOARDS_AUTH_PROVIDER=none
|
|
38
|
-
|
|
39
|
-
# Clerk
|
|
40
|
-
# BOARDS_AUTH_PROVIDER=clerk
|
|
41
|
-
# CLERK_SECRET_KEY=sk_test_...
|
|
42
|
-
|
|
43
|
-
# Supabase
|
|
44
|
-
# BOARDS_AUTH_PROVIDER=supabase
|
|
45
|
-
# SUPABASE_URL=https://xxx.supabase.co
|
|
46
|
-
# SUPABASE_SERVICE_KEY=...
|
|
47
|
-
|
|
48
|
-
# Auth0
|
|
49
|
-
# BOARDS_AUTH_PROVIDER=auth0
|
|
50
|
-
# AUTH0_DOMAIN=...
|
|
51
|
-
# AUTH0_CLIENT_ID=...
|
|
52
|
-
# AUTH0_CLIENT_SECRET=...
|
|
53
|
-
|
|
54
|
-
# ============================================
|
|
55
|
-
# CONFIGURATION
|
|
56
|
-
# ============================================
|
|
57
|
-
|
|
58
|
-
# Config file paths
|
|
59
|
-
BOARDS_STORAGE_CONFIG_PATH=./config/storage_config.yaml
|
|
60
|
-
BOARDS_GENERATORS_CONFIG_PATH=./config/generators.yaml
|
|
61
|
-
|
|
62
|
-
# Storage (if using cloud storage)
|
|
63
|
-
# AWS_ACCESS_KEY_ID=
|
|
64
|
-
# AWS_SECRET_ACCESS_KEY=
|
|
65
|
-
# GCP_SERVICE_ACCOUNT_JSON=
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
# Artifact Resolution Guide
|
|
2
|
-
|
|
3
|
-
This guide explains how artifact resolution works in the Boards generator system.
|
|
4
|
-
|
|
5
|
-
## Overview
|
|
6
|
-
|
|
7
|
-
Generators can accept artifacts (images, videos, audio, etc.) from previous generations as inputs. The artifact resolution system automatically converts generation ID strings (UUIDs) into typed artifact objects with proper validation.
|
|
8
|
-
|
|
9
|
-
## How It Works
|
|
10
|
-
|
|
11
|
-
### Automatic Type Introspection
|
|
12
|
-
|
|
13
|
-
The system uses Pydantic type introspection to automatically detect which fields are artifacts. **No manual configuration needed!**
|
|
14
|
-
|
|
15
|
-
```python
|
|
16
|
-
from pydantic import BaseModel, Field
|
|
17
|
-
from boards.generators.artifacts import ImageArtifact, VideoArtifact
|
|
18
|
-
|
|
19
|
-
class MyGeneratorInput(BaseModel):
|
|
20
|
-
"""Input schema for my generator."""
|
|
21
|
-
|
|
22
|
-
prompt: str = Field(description="Text prompt")
|
|
23
|
-
|
|
24
|
-
# These are automatically detected as artifact fields
|
|
25
|
-
image_source: ImageArtifact = Field(description="Input image")
|
|
26
|
-
video_sources: list[VideoArtifact] = Field(description="Input videos")
|
|
27
|
-
|
|
28
|
-
# Regular fields are ignored
|
|
29
|
-
num_outputs: int = Field(default=1, ge=1, le=10)
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
That's it! No decorators, no class variables, no manual registration needed.
|
|
33
|
-
|
|
34
|
-
### What Happens Automatically
|
|
35
|
-
|
|
36
|
-
When a generation is submitted with input parameters like:
|
|
37
|
-
|
|
38
|
-
```json
|
|
39
|
-
{
|
|
40
|
-
"prompt": "enhance the colors",
|
|
41
|
-
"image_source": "550e8400-e29b-41d4-a716-446655440000",
|
|
42
|
-
"video_sources": [
|
|
43
|
-
"7c9e6679-7425-40de-944b-e07fc1f90ae7",
|
|
44
|
-
"8f9e6679-7425-40de-944b-e07fc1f90ae8"
|
|
45
|
-
]
|
|
46
|
-
}
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
The system:
|
|
50
|
-
|
|
51
|
-
1. **Detects** that `image_source` and `video_sources` are artifact fields (via type introspection)
|
|
52
|
-
2. **Queries** the database to fetch the generations by ID
|
|
53
|
-
3. **Validates** each generation:
|
|
54
|
-
- Belongs to the same tenant (access control)
|
|
55
|
-
- Has status="completed" (can't use pending generations)
|
|
56
|
-
- Has the correct artifact type (can't use a video where an image is expected)
|
|
57
|
-
4. **Converts** generation records to typed artifact objects
|
|
58
|
-
5. **Validates** the input with Pydantic
|
|
59
|
-
|
|
60
|
-
All of this happens automatically in [actors.py](src/boards/workers/actors.py).
|
|
61
|
-
|
|
62
|
-
## Supported Patterns
|
|
63
|
-
|
|
64
|
-
### Single Artifact
|
|
65
|
-
|
|
66
|
-
```python
|
|
67
|
-
image_source: ImageArtifact = Field(...)
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
**Input**: Single generation ID string (e.g., `"550e8400-e29b-41d4-a716-446655440000"`)
|
|
71
|
-
**Output**: Single `ImageArtifact` object
|
|
72
|
-
|
|
73
|
-
### List of Artifacts
|
|
74
|
-
|
|
75
|
-
```python
|
|
76
|
-
image_sources: list[ImageArtifact] = Field(min_length=1)
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
**Input**: List of generation ID strings (e.g., `["id1", "id2"]`)
|
|
80
|
-
**Output**: List of `ImageArtifact` objects (always a list, even if input has one ID)
|
|
81
|
-
|
|
82
|
-
**Important**: If the field type is `list[ImageArtifact]`, the resolved value will ALWAYS be a list, even if only one generation ID is provided. The system respects the type annotation.
|
|
83
|
-
|
|
84
|
-
### Optional Artifacts
|
|
85
|
-
|
|
86
|
-
```python
|
|
87
|
-
reference_image: ImageArtifact | None = Field(default=None)
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
Field can be omitted or set to `null`.
|
|
91
|
-
|
|
92
|
-
## Supported Artifact Types
|
|
93
|
-
|
|
94
|
-
- `ImageArtifact` - Images (PNG, JPEG, WebP, etc.)
|
|
95
|
-
- `VideoArtifact` - Videos (MP4, WebM, etc.)
|
|
96
|
-
- `AudioArtifact` - Audio files (MP3, WAV, etc.)
|
|
97
|
-
- `TextArtifact` - Text content
|
|
98
|
-
|
|
99
|
-
## Error Handling
|
|
100
|
-
|
|
101
|
-
The system provides clear error messages when validation fails:
|
|
102
|
-
|
|
103
|
-
- `"Generation {id} not found"` - Invalid generation ID
|
|
104
|
-
- `"Access denied to generation {id} - tenant mismatch"` - User doesn't own this generation
|
|
105
|
-
- `"Generation {id} is not completed (status: pending)"` - Can't use incomplete generations
|
|
106
|
-
- `"Generation {id} has wrong artifact type: expected image, got video"` - Type mismatch
|
|
107
|
-
|
|
108
|
-
## Examples
|
|
109
|
-
|
|
110
|
-
### Image-to-Image Editor
|
|
111
|
-
|
|
112
|
-
```python
|
|
113
|
-
class ImageEditInput(BaseModel):
|
|
114
|
-
prompt: str = Field(description="Editing instructions")
|
|
115
|
-
image_source: ImageArtifact = Field(description="Image to edit")
|
|
116
|
-
strength: float = Field(default=0.8, ge=0.0, le=1.0)
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
### Multi-Image Collage
|
|
120
|
-
|
|
121
|
-
```python
|
|
122
|
-
class CollageInput(BaseModel):
|
|
123
|
-
images: list[ImageArtifact] = Field(
|
|
124
|
-
description="Images to combine",
|
|
125
|
-
min_length=2,
|
|
126
|
-
max_length=9
|
|
127
|
-
)
|
|
128
|
-
layout: Literal["grid", "freeform"] = Field(default="grid")
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
### Video + Audio Mixer
|
|
132
|
-
|
|
133
|
-
```python
|
|
134
|
-
class VideoAudioMixInput(BaseModel):
|
|
135
|
-
video_source: VideoArtifact = Field(description="Video track")
|
|
136
|
-
audio_source: AudioArtifact = Field(description="Audio track")
|
|
137
|
-
volume: float = Field(default=1.0, ge=0.0, le=2.0)
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
## Implementation Details
|
|
141
|
-
|
|
142
|
-
The automatic detection is handled by:
|
|
143
|
-
|
|
144
|
-
- [`extract_artifact_fields()`](src/boards/generators/artifact_resolution.py) - Introspects schema to find artifact fields
|
|
145
|
-
- [`resolve_input_artifacts()`](src/boards/generators/artifact_resolution.py) - Resolves generation IDs to artifacts
|
|
146
|
-
- [`resolve_generation_ids_to_artifacts()`](src/boards/generators/artifact_resolution.py) - Database queries and validation
|
|
147
|
-
|
|
148
|
-
See [artifact_resolution.py](src/boards/generators/artifact_resolution.py) for the full implementation.
|
package/templates/api/Dockerfile
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
FROM python:3.12-slim
|
|
2
|
-
|
|
3
|
-
WORKDIR /app
|
|
4
|
-
|
|
5
|
-
# Install system dependencies
|
|
6
|
-
RUN apt-get update && apt-get install -y \
|
|
7
|
-
curl \
|
|
8
|
-
build-essential \
|
|
9
|
-
&& rm -rf /var/lib/apt/lists/*
|
|
10
|
-
|
|
11
|
-
# Install uv
|
|
12
|
-
RUN pip install --no-cache-dir uv
|
|
13
|
-
|
|
14
|
-
# Copy application code first (needed for version detection in pyproject.toml)
|
|
15
|
-
COPY . .
|
|
16
|
-
|
|
17
|
-
# Install Python dependencies with all generator providers
|
|
18
|
-
RUN uv pip install --system --no-cache-dir .[generators-all]
|
|
19
|
-
|
|
20
|
-
# Create non-root user
|
|
21
|
-
RUN useradd -m -u 1001 apiuser && chown -R apiuser:apiuser /app
|
|
22
|
-
USER apiuser
|
|
23
|
-
|
|
24
|
-
# Expose port
|
|
25
|
-
EXPOSE 8800
|
|
26
|
-
|
|
27
|
-
# Health check
|
|
28
|
-
HEALTHCHECK --interval=30s --timeout=3s --start-period=40s --retries=3 \
|
|
29
|
-
CMD curl -f http://localhost:8800/health || exit 1
|
|
30
|
-
|
|
31
|
-
# Start the application
|
|
32
|
-
CMD ["uvicorn", "boards.api.app:app", "--host", "0.0.0.0", "--port", "8800"]
|
package/templates/api/README.md
DELETED
|
@@ -1,264 +0,0 @@
|
|
|
1
|
-
# Boards Backend
|
|
2
|
-
|
|
3
|
-
Backend for the Boards open-source creative toolkit for AI-generated content.
|
|
4
|
-
|
|
5
|
-
## Features
|
|
6
|
-
|
|
7
|
-
- 🎨 Multi-provider support (Replicate, Fal.ai, OpenAI, etc.)
|
|
8
|
-
- 🔌 Pluggable architecture for generators and providers
|
|
9
|
-
- 📊 GraphQL API with Strawberry
|
|
10
|
-
- 🗄️ PostgreSQL with SQLAlchemy 2.0
|
|
11
|
-
- 🔄 Migrations with Alembic (async) and timestamped filenames
|
|
12
|
-
- 👥 Multi-tenant support with tenant isolation
|
|
13
|
-
- 🔐 Pluggable authentication (Supabase, Clerk, Auth0, JWT)
|
|
14
|
-
- 📦 Flexible storage backends (Local, S3, GCS, Supabase)
|
|
15
|
-
|
|
16
|
-
## Installation
|
|
17
|
-
|
|
18
|
-
### Minimal Install
|
|
19
|
-
|
|
20
|
-
The minimal installation includes core functionality with local filesystem storage only:
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
pip install weirdfingers-boards
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
### Install with Specific Generators
|
|
27
|
-
|
|
28
|
-
Install only the generator providers you need:
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
# OpenAI generators (DALL-E 3, Whisper)
|
|
32
|
-
pip install weirdfingers-boards[generators-openai]
|
|
33
|
-
|
|
34
|
-
# Replicate generators (Flux Pro, Lipsync)
|
|
35
|
-
pip install weirdfingers-boards[generators-replicate]
|
|
36
|
-
|
|
37
|
-
# fal.ai generators (nano-banana)
|
|
38
|
-
pip install weirdfingers-boards[generators-fal]
|
|
39
|
-
|
|
40
|
-
# Multiple generators
|
|
41
|
-
pip install weirdfingers-boards[generators-openai,generators-replicate]
|
|
42
|
-
|
|
43
|
-
# All generators
|
|
44
|
-
pip install weirdfingers-boards[generators-all]
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
### Install with Storage Backends
|
|
48
|
-
|
|
49
|
-
Add cloud storage providers as needed:
|
|
50
|
-
|
|
51
|
-
```bash
|
|
52
|
-
# S3 storage (AWS, MinIO, DigitalOcean Spaces)
|
|
53
|
-
pip install weirdfingers-boards[storage-s3]
|
|
54
|
-
|
|
55
|
-
# Supabase storage
|
|
56
|
-
pip install weirdfingers-boards[storage-supabase]
|
|
57
|
-
|
|
58
|
-
# Google Cloud Storage
|
|
59
|
-
pip install weirdfingers-boards[storage-gcs]
|
|
60
|
-
|
|
61
|
-
# All storage backends
|
|
62
|
-
pip install weirdfingers-boards[storage-all]
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
### Full Installation
|
|
66
|
-
|
|
67
|
-
Install everything (all generators and storage backends):
|
|
68
|
-
|
|
69
|
-
```bash
|
|
70
|
-
pip install weirdfingers-boards[all]
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
### Development Installation
|
|
74
|
-
|
|
75
|
-
For local development with all providers for type checking and testing:
|
|
76
|
-
|
|
77
|
-
```bash
|
|
78
|
-
# Clone the repository
|
|
79
|
-
git clone https://github.com/weirdfingers/boards.git
|
|
80
|
-
cd boards/packages/backend
|
|
81
|
-
|
|
82
|
-
# Install with dev dependencies (includes all providers)
|
|
83
|
-
uv sync
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
## Configuration
|
|
87
|
-
|
|
88
|
-
Copy `.env.example` to `.env` and configure your settings:
|
|
89
|
-
|
|
90
|
-
```bash
|
|
91
|
-
cp .env.example .env
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
Key configuration options:
|
|
95
|
-
|
|
96
|
-
- `BOARDS_DATABASE_URL`: PostgreSQL connection string (e.g. postgresql://user:pass@localhost:5433/db)
|
|
97
|
-
- `BOARDS_REDIS_URL`: Redis connection for job queue
|
|
98
|
-
- `BOARDS_STORAGE_PROVIDER`: Storage backend (local, s3, gcs, supabase)
|
|
99
|
-
- `BOARDS_AUTH_PROVIDER`: Authentication provider
|
|
100
|
-
|
|
101
|
-
## Database Setup
|
|
102
|
-
|
|
103
|
-
### 1. Create the database
|
|
104
|
-
|
|
105
|
-
```bash
|
|
106
|
-
createdb boards_dev
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
### 2. Apply initial schema via Alembic
|
|
110
|
-
|
|
111
|
-
```bash
|
|
112
|
-
# Use Alembic to create all tables
|
|
113
|
-
uv run alembic upgrade head
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
## Development
|
|
117
|
-
|
|
118
|
-
### Quick Start
|
|
119
|
-
|
|
120
|
-
```bash
|
|
121
|
-
# Start the API server (after installation and configuration)
|
|
122
|
-
boards-server
|
|
123
|
-
|
|
124
|
-
# Run database migrations
|
|
125
|
-
boards-migrate upgrade head
|
|
126
|
-
|
|
127
|
-
# Start background workers
|
|
128
|
-
boards-worker
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
### Development Server
|
|
132
|
-
|
|
133
|
-
```bash
|
|
134
|
-
# Using uvicorn directly
|
|
135
|
-
uvicorn boards.api.app:app --reload --port 8088
|
|
136
|
-
|
|
137
|
-
# Or using the module
|
|
138
|
-
python -m boards.api.app
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
### Access the GraphQL playground
|
|
142
|
-
|
|
143
|
-
Open http://localhost:8088/graphql in your browser.
|
|
144
|
-
|
|
145
|
-
### Database migrations
|
|
146
|
-
|
|
147
|
-
When you need to change the database schema, use Alembic.
|
|
148
|
-
|
|
149
|
-
```bash
|
|
150
|
-
# Create a new migration (autogenerate from models in boards.dbmodels)
|
|
151
|
-
uv run alembic revision -m "add feature" --autogenerate
|
|
152
|
-
|
|
153
|
-
# Apply latest migrations
|
|
154
|
-
uv run alembic upgrade head
|
|
155
|
-
|
|
156
|
-
# Roll back one revision
|
|
157
|
-
uv run alembic downgrade -1
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
📖 For detailed migration workflow, see docs and examples under `apps/docs`.
|
|
161
|
-
|
|
162
|
-
## Project Structure
|
|
163
|
-
|
|
164
|
-
```
|
|
165
|
-
packages/backend/
|
|
166
|
-
├── alembic/ # Alembic migration scripts
|
|
167
|
-
│ └── versions/ # Timestamped revision files
|
|
168
|
-
├── alembic.ini # Alembic config
|
|
169
|
-
├── src/boards/
|
|
170
|
-
│ ├── api/ # FastAPI application
|
|
171
|
-
│ ├── dbmodels/ # SQLAlchemy ORM models (authoritative)
|
|
172
|
-
│ ├── database/ # Connection helpers and compatibility shim
|
|
173
|
-
│ ├── graphql/ # GraphQL schema and resolvers
|
|
174
|
-
│ ├── providers/ # Provider implementations
|
|
175
|
-
│ ├── generators/ # Generator implementations
|
|
176
|
-
│ ├── storage/ # Storage backends
|
|
177
|
-
│ └── config.py # Configuration management
|
|
178
|
-
└── tests/
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
## Community & Social
|
|
182
|
-
|
|
183
|
-
Join the Weirdfingers community:
|
|
184
|
-
|
|
185
|
-
- **TikTok**: [https://www.tiktok.com/@weirdfingers](https://www.tiktok.com/@weirdfingers)
|
|
186
|
-
- **X (Twitter)**: [https://x.com/_Weirdfingers_](https://x.com/_Weirdfingers_)
|
|
187
|
-
- **YouTube**: [https://www.youtube.com/@Weirdfingers](https://www.youtube.com/@Weirdfingers)
|
|
188
|
-
- **Discord**: [https://discord.gg/rvVuHyuPEx](https://discord.gg/rvVuHyuPEx)
|
|
189
|
-
- **Instagram**: [https://www.instagram.com/_weirdfingers_/](https://www.instagram.com/_weirdfingers_/)
|
|
190
|
-
## Testing
|
|
191
|
-
|
|
192
|
-
Boards uses pytest for testing with both unit tests (mocked) and optional live API tests.
|
|
193
|
-
|
|
194
|
-
### Running Tests
|
|
195
|
-
|
|
196
|
-
```bash
|
|
197
|
-
# Run all unit tests (excludes live API tests)
|
|
198
|
-
make test-backend
|
|
199
|
-
|
|
200
|
-
# Or using pytest directly
|
|
201
|
-
cd packages/backend
|
|
202
|
-
uv run pytest tests/
|
|
203
|
-
|
|
204
|
-
# Run with coverage
|
|
205
|
-
uv run pytest tests/ --cov=src/boards --cov-report=html
|
|
206
|
-
|
|
207
|
-
# Run specific test file
|
|
208
|
-
uv run pytest tests/generators/implementations/test_flux_pro.py -v
|
|
209
|
-
```
|
|
210
|
-
|
|
211
|
-
### Unit Tests vs Live API Tests
|
|
212
|
-
|
|
213
|
-
**Unit tests** (default):
|
|
214
|
-
- Use mocked provider SDKs
|
|
215
|
-
- Fast and free
|
|
216
|
-
- Run automatically in CI/CD
|
|
217
|
-
- Located: `tests/**/test_*.py`
|
|
218
|
-
|
|
219
|
-
**Live API tests** (opt-in only):
|
|
220
|
-
- Make real API calls to providers
|
|
221
|
-
- Consume API credits
|
|
222
|
-
- **Never run by default**
|
|
223
|
-
- Located: `tests/**/test_*_live.py`
|
|
224
|
-
|
|
225
|
-
### Running Live API Tests
|
|
226
|
-
|
|
227
|
-
Live tests verify real connectivity with provider APIs but cost money. They are **excluded from default test runs**.
|
|
228
|
-
|
|
229
|
-
```bash
|
|
230
|
-
# Set up API key
|
|
231
|
-
export BOARDS_GENERATOR_API_KEYS='{"REPLICATE_API_TOKEN": "r8_..."}'
|
|
232
|
-
|
|
233
|
-
# Run a specific generator's live test
|
|
234
|
-
uv run pytest tests/generators/implementations/test_flux_pro_live.py -v -m live_api
|
|
235
|
-
|
|
236
|
-
# Run all live tests for one provider
|
|
237
|
-
uv run pytest -m live_replicate -v
|
|
238
|
-
|
|
239
|
-
# Run all live tests (not recommended - expensive!)
|
|
240
|
-
uv run pytest -m live_api -v
|
|
241
|
-
```
|
|
242
|
-
|
|
243
|
-
For detailed information on live API testing, see:
|
|
244
|
-
- [Live API Testing Guide](docs/TESTING_LIVE_APIS.md)
|
|
245
|
-
- [Generator Testing Documentation](../../apps/docs/docs/generators/testing.md)
|
|
246
|
-
|
|
247
|
-
### Test Organization
|
|
248
|
-
|
|
249
|
-
```
|
|
250
|
-
tests/
|
|
251
|
-
├── conftest.py # Shared fixtures (database, etc.)
|
|
252
|
-
├── generators/
|
|
253
|
-
│ └── implementations/
|
|
254
|
-
│ ├── conftest.py # Generator-specific fixtures
|
|
255
|
-
│ ├── test_flux_pro.py # Unit tests (mocked)
|
|
256
|
-
│ ├── test_flux_pro_live.py # Live API tests (opt-in)
|
|
257
|
-
│ └── ...
|
|
258
|
-
├── graphql/ # GraphQL API tests
|
|
259
|
-
└── storage/ # Storage backend tests
|
|
260
|
-
```
|
|
261
|
-
|
|
262
|
-
## License
|
|
263
|
-
|
|
264
|
-
MIT
|