A ComfyUI-style node-based workflow editor for image generation and manipulation (React + Vite frontend, FastAPI backend).
| Path | Purpose |
|---|---|
frontend/ |
React app (Vite, XYFlow canvas) |
backend/ |
FastAPI API, workflow engine, persistence (SQLite or Firestore) |
assets/ |
Shared branding assets (e.g. logo.svg) |
docs/ |
Publishing plan, dev → publish, no GCP billing deploy, Gemini keys |
firebase.json |
Firebase Hosting + rules (production deploy) |
run.bat |
Windows: starts backend and frontend, opens the browser |
The favicon and in-app icon are served from frontend/public/ (e.g. blackpot-icon.svg). Use assets/logo.svg as an additional source asset when you need the same mark outside the web build.
This folder is a Git repo on branch main. Secrets stay out of Git (see .gitignore: backend/.env, backend/cloud-run-env.yaml, *.local, frontend/dist/, etc.).
To push to GitHub:
- Create a new empty repository on GitHub (no README, no license) — pick a name such as
blackpot. - From this repo root:
git remote add origin https://github.com/YOUR_USER/YOUR_REPO.git
git push -u origin mainIf Git asks for a password, use a personal access token (classic: enable repo scope) instead of your account password.
Double-click run.bat, or from the repo root:
run.batcd backend
cp .env.example .env # Unix — on Windows: copy .env.example .env
pip install -r requirements.txt
python main.pyRuns at http://localhost:8000. Set GEMINI_API_KEY in backend/.env for AI nodes; see docs/GEMINI_API_KEYS.md.
Leave FIREBASE_PROJECT_ID unset so the API does not require sign-in (SQLite keeps working as a single-user/dev setup).
cd frontend
npm install
npm run devRuns at http://localhost:5173.
Without VITE_FIREBASE_* variables, the UI does not show a login gate.
When you are ready to publish for specific people:
- Create a Firebase project and enable Authentication (Email/Password and/or Google), Firestore, Storage, and Hosting.
- Backend (
backend/.envor Cloud Run env):FIREBASE_PROJECT_ID— enables JWT verification on all protected API routes.ALLOWLIST_EMAILS— comma-separated list of allowed account emails (Google or email/password sign-in).- Or create Firestore document
config/allowed_emailswith fieldemails(array of strings). If neither is set, no one is allowed unless you setAUTH_SKIP_ALLOWLIST=1(development only). GOOGLE_APPLICATION_CREDENTIALS— path to a service account JSON locally; on Cloud Run use the default service account with Firebase Admin permissions.
- Frontend — copy
frontend/.env.exampletofrontend/.env.localand fill in the Firebase web app values from the Firebase console (VITE_FIREBASE_*). - Users sign in with email/password (create account on the login screen) or Google, then open Settings and paste a Google AI Studio API key. Keys are stored server-side (Firestore
userSecrets/{uid}or SQLiteuser_secretswhen testing with Auth locally).
DATA_BACKEND |
Use case |
|---|---|
sqlite (default) |
Local dev; optional owner_uid columns when Firebase Auth is enabled |
firestore |
Production on Cloud Run; requires FIREBASE_PROJECT_ID and Firebase Auth |
Set CORS_ORIGINS to a comma-separated list of allowed origins (e.g. https://your-app.web.app). Default * is only for convenience in local development.
Windows scripts (after npx -y firebase-tools@latest login and installing Google Cloud SDK):
- Copy
backend/cloud-run-env.yaml.example→backend/cloud-run-env.yamland edit (gitignored). powershell -ExecutionPolicy Bypass -File .\scripts\deploy-cloud-run.ps1— deploys the API to Cloud Run.powershell -ExecutionPolicy Bypass -File .\scripts\deploy-phase3.ps1— rules + frontend build + Hosting.
Manual steps:
-
Cloud Run — build and deploy the backend from
backend/(Dockerfile included):cd backend # Set env: FIREBASE_PROJECT_ID, DATA_BACKEND=firestore, CORS_ORIGINS, ALLOWLIST_EMAILS, etc. gcloud run deploy blackpot-api --source . --region us-central1
The service id must match
firebase.json→hosting.rewrites[0].run.serviceId(blackpot-api), or editfirebase.jsonto your service name. -
Firestore & Storage rules — from the repo root:
npx -y firebase-tools@latest login npx -y firebase-tools@latest use --add YOUR_PROJECT_ID npx -y firebase-tools@latest deploy --only firestore:rules,storage
-
Hosting — build the frontend, then deploy:
cd frontend && npm run build && cd .. npx -y firebase-tools@latest deploy --only hosting
Hosting serves
frontend/distand rewrites/api/**to your Cloud Run URL (same-origin/apiin the browser).
Cloud Run is not used. Deploy the API on Render from backend/Dockerfile, the static site on Netlify, and set VITE_API_BASE to your Render API URL when you run npm run build. Full steps: docs/PUBLISH_NO_GOOGLE_BILLING.md. Optional blueprint: render.yaml in the repo root.
- Add nodes — Drag from the left palette onto the canvas.
- Connect — Drag from an output handle to a compatible input.
- Configure — Select a node to edit properties in the inspector.
- Run — Use the run control at the bottom to execute the workflow.
- M — Bypass all selected nodes; Alt+M — clear bypass on all selected nodes
- Delete / Backspace — Remove the selected node
- I/O: Import Image, Export Image, Preview
- Tools: Resize, Crop, Change Hue, Set Alpha, Brightness, Contrast, Blur, Sharpen, Color Overlay, Rotate/Flip
- Values: Number, Color Picker, Text, Boolean
- Read data: Get Image Size, Get Dominant Colors, Get Pixel Color
- AI: Gemini-backed nodes (per-user key in Settings, optional
GEMINI_API_KEYfallback, or per-nodeapiKey)