Skip to content

Replace the legacy PHP ERP with Vitrina, an AI product-visuals studio for e-commerce - #1

Merged
biluses merged 11 commits into
masterfrom
claude/clone-build-autonomous-repo-lou6ef
Sep 18, 2026
Merged

biluses merged 11 commits into
masterfrom
claude/clone-build-autonomous-repo-lou6ef

Conversation

@biluses

@biluses biluses commented Sep 18, 2026

Copy link
Copy Markdown
Owner

What this does

Empties the repository of the legacy PHP ERP and replaces it with Vitrina: a vertical SaaS built on top of the open-higgsfield generation studio, aimed at e-commerce brands that need product photos and clips for every channel.

What is in the box

  • Domain as data (src/domain): 11 presets (pack shot, lifestyle, flat lay, hero, on-model, macro, product reveal, b-roll, UGC clip, unboxing, seasonal), 8 channels that fix ratio and duration, a prompt compiler that folds product + brand kit + channel + scene, integer credit pricing and plans.
  • Engine (src/generation): the inherited catalog of 38 models, platform client and poll loop, now behind the session with credits reserved before a run and refunded on failure; runs persisted per workspace and settled server-side.
  • Studio (src/studio): product / preset / channel rail, final-prompt preview, review (approve / reject), product and review filters, paged run log, bulk actions.
  • App (src/app, src/ui): sign-in, products with photos, brand kit, campaigns (preset × channel generated in one press, exported as a zip filed by channel), settings with Stripe plans, credit ledger, BYOK platform key, team invites with seats per plan, several brands per account, optional password reset by email, closed sign-ups for private installs.
  • Infra: Drizzle + libsql (file or Turso), better-auth, local or Vercel Blob storage, migrations on boot, standalone Dockerfile + compose, GitHub Actions (lint, types, unit, build, e2e), a mock platform server for development, security headers.
  • Docs: README, ARCHITECTURE, DEPLOY, VERTICAL (how to re-aim at another industry), NOTICE (provenance), CLAUDE.md, reset-total and wipe-local skills.

Verification

  • pnpm lint, pnpm typecheck: clean.
  • pnpm test: 34 unit tests (prompt compiler against the real catalog, pricing, credits ledger races and idempotent refunds, Stripe event handling, invites and seats, run settlement and paging).
  • pnpm test:e2e: 5 Playwright flows against the standalone build and the mock platform (sign-up, brand kit, product photo upload, generation through the job rail, review, refunded failure, campaign generation and zip export, invite flow with a second browser, signed-out redirects).
  • Standalone server started and probed; security headers confirmed.

Not verified here: the real Higgsfield API (no key), Stripe in live mode (covered by simulated events), the Docker image build (no daemon in the session; the artifact it packages was run directly).

Heads-up before selling

The upstream repository carried no LICENSE file at import time. NOTICE.md records the provenance; confirm terms with the author before commercial distribution.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QktEqYfYA1H2gQRbvG88pU


Generated by Claude Code

biluses and others added 11 commits September 18, 2026 00:12
Removes the legacy PHP ERP and brings in the open-higgsfield Next.js
studio (catalog-driven image/video generation) as the foundation for a
vertical product built around it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QktEqYfYA1H2gQRbvG88pU
…pricing, plans

Pure, tested modules that make the vertical data: channels decide ratio and
duration, presets carry the prompt skeleton and preferred models, the
compiler folds product, brand kit and channel guidance into a prompt, and
pricing turns a resolved run into an integer credit cost.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QktEqYfYA1H2gQRbvG88pU
Drizzle over libsql (a local file or Turso), better-auth email/password
with a sign-up hook that bootstraps a workspace, brand kit and trial
credits, an AES-GCM seal for bring-your-own platform keys, and an
atomic credit ledger with idempotent refunds and grants — all covered
by an integration test against a temporary database.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QktEqYfYA1H2gQRbvG88pU
… billing

The generation engine now runs behind the session: submits reserve
credits, runs are persisted per workspace and settled server-side on
poll, and a workspace can bring its own platform key. The studio gains a
product / preset / channel rail that compiles the prompt from the brand
kit, review states, product filters and a final-prompt preview. Around
it: sign-in, products with photos, the brand kit, campaigns that
generate a preset-by-channel plan and export approved files as a zip,
and settings with Stripe plans, a credit ledger and the key. Local or
Vercel Blob storage, a mock platform server for development.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QktEqYfYA1H2gQRbvG88pU
Playwright drives sign-up, brand kit, product photo upload, a pack shot
generated through the job rail, review from the viewer, a refunded
failure, and a campaign generated and exported as a zip. Along the way:
the studio opens on images, the pack-shot preset carries the scene,
filters live inside the gallery panel, the live credit balance is shared
with the sidebar, an empty selection no longer reads as approved, and
every app page redirects a signed-out visitor instead of erroring.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QktEqYfYA1H2gQRbvG88pU
… Vitrina brand assets

ESLint 9 with the Next config. The studio no longer sets state from
effects: the selection is read through the visible set and reset by the
handlers that change scope or filters, the gallery scope follows the
surface during render, and picking a preset chooses its model in the
picker itself. The selection bar holds the last non-empty selection as
state. New mark, icons and Open Graph card for Vitrina.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QktEqYfYA1H2gQRbvG88pU
The server migrates its database when it starts, so a container or a
fresh checkout needs no separate step; the traced output excludes runtime
data. Dockerfile (standalone, non-root, /data volume), compose file, a
GitHub Actions pipeline (lint, types, unit, build, e2e with the mock
platform), Stripe webhook tests, a responsive gallery grid, and the
README, architecture, deployment and vertical guides. NOTICE.md records
the upstream provenance and its missing license.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QktEqYfYA1H2gQRbvG88pU
Invite links seat people up to the plan's seats, the owner sees members
and open links in Settings, an account can hold several brands and switch
between them from the sidebar. Password reset goes out through Resend
when a sender is configured and stays hidden otherwise. The run log pages
by creation time with a load-older control. The e2e suite now serves the
standalone build (what Docker ships) and covers the invite flow with a
second browser context; unit tests cover invites, seats, run settlement
and paging.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QktEqYfYA1H2gQRbvG88pU
…n redirects, closed sign-ups

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QktEqYfYA1H2gQRbvG88pU
…eset to wipe-local

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QktEqYfYA1H2gQRbvG88pU
@biluses
biluses merged commit c65199a into master Sep 18, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant