LaunchPix is a Mistral-assisted asset generator for product launches. It turns raw screenshots into polished listing visuals, promo tiles, and hero banners.
DESIGN.mdis the canonical design brain for the product UI.docs/design-md/google-designmd-spec.mdis a local copy of the Google DESIGN.md specification.docs/design-md/README.mdexplains how to use both files in this repo.
- Next.js App Router + TypeScript
- Tailwind CSS + reusable UI primitives
- Supabase (Auth, Postgres, Storage)
- Mistral structured planning and image generation
- Deterministic SVG -> PNG fallback rendering (
@resvg/resvg-js) - Lemon Squeezy credit-pack billing and webhook fulfillment
- Sign in
- Create project and upload screenshots
- Generate structured asset plan via Mistral
- Generate image assets through a Mistral image-generation agent
- Preview/download assets while credits remain
- Every account starts with 300 credits.
- Existing accounts are raised to at least 300 credits by
0004_credit_balance_model.sql. - Billing is credit based, not subscription based.
- Users buy one-time Lemon Squeezy credit packs after exhausting their included credits.
See .env.example.
Minimum required:
NEXT_PUBLIC_APP_URLNEXT_PUBLIC_SUPABASE_URLNEXT_PUBLIC_SUPABASE_ANON_KEYSUPABASE_SERVICE_ROLE_KEYDATABASE_URLMISTRAL_API_KEYMISTRAL_MODEL_VISIONMISTRAL_MODEL_TEXTMISTRAL_IMAGE_MODELMISTRAL_IMAGE_AGENT_ID(optional)LEMON_SQUEEZY_API_KEYLEMON_SQUEEZY_STORE_IDLEMON_SQUEEZY_WEBHOOK_SECRETLEMON_SQUEEZY_STARTER_CREDITS_VARIANT_IDLEMON_SQUEEZY_CREATOR_CREDITS_VARIANT_IDLEMON_SQUEEZY_STUDIO_CREDITS_VARIANT_ID
Optional for Supabase CLI workflows:
SUPABASE_ACCESS_TOKENSUPABASE_DB_PASSWORD
- Copy env:
cp .env.example .env.local
- Install dependencies:
npm install
- Apply database migrations using one of these options:
- Supabase CLI:
npx supabase db push --linked - or run the SQL files in
supabase/migrations/in order
- Supabase CLI:
- Start dev server:
npm run dev
Recommended validation commands:
npm run typechecknpm run build
- Enable email auth.
- Ensure storage buckets exist:
project-uploads-rawproject-uploads-normalizedlaunchpix-assets
- Apply RLS policies from migrations.
- If you use the Supabase CLI, link the project first with
npx supabase link.
- Mistral is used for structured product/copy/layout planning.
- Final image assets are generated through a Mistral Agent with the built-in
image_generationtool. - Planning default model:
mistral-small-2506(configurable via env). - Image generation default model:
mistral-medium-latest(configurable viaMISTRAL_IMAGE_MODEL). MISTRAL_IMAGE_AGENT_IDcan point to a pre-created image-generation agent. If it is omitted, LaunchPix creates an agent at runtime.- If Mistral image generation fails, LaunchPix falls back to deterministic SVG -> PNG rendering so generation does not hard-fail.
- Checkout init:
POST /api/billing/checkout - Verification: purchases are fulfilled by webhook after Lemon Squeezy confirms the order
- Webhook:
POST /api/billing/webhook - Configure Lemon Squeezy webhook URL to point to
/api/billing/webhook. - Select the
order_createdevent for credit fulfillment. - Create three Lemon Squeezy variants and map them to the variant ID env vars in
.env.example.
npm run devnpm run lintnpm run typechecknpm run buildnpm run video:studionpm run video:rendernpm run video:render:chromeon Windows if Remotion cannot download Chrome Headless Shell
- The Remotion demo composition lives in
remotion/. - Rendered output is written to
output/launchpix-demo.mp4. - The video explains the core LaunchPix story: project brief, screenshot uploads, Mistral planning, image generation, fallback rendering, exports, credits, and billing.
- Set all env vars in hosting provider.
NEXT_PUBLIC_APP_URLmust be set in the hosting provider's production environment to your live domain;.env.localis only used locally.- Use HTTPS and production callback URLs for Lemon Squeezy.
- Auth confirmation and billing redirects are built from
NEXT_PUBLIC_APP_URL, so production must not point this to localhost. - Keep
package-lock.jsoncommitted so CI and hosting builds install the same dependency tree. - Confirm webhook signature secret matches deployment env.
- Build command:
npm run build - Install command:
npm installornpm ci - The app relies on
@resvg/resvg-jsduring server rendering, so the currentnext.config.tsmust be preserved in deployments.
- Rate limiting is lightweight (in-memory).
- Credit packs are one-time purchases; subscription renewal automation is intentionally not used.
- Visual templates are production-capable baseline and can be expanded further.