Skip to main content

Installation

Prerequisites​

  • Node.js ≥ 20
  • PostgreSQL database (local or hosted)
  • Google credentials — either a Vertex AI service account or a Gemini API key (see Gemini auth modes)

Quick Start​

cd next-app
cp .env.example .env # fill in values (see below)
npm install
npm run prisma:deploy # create/migrate database schema
npm run prisma:seed # load demo user + example pipeline workflow
npm run dev -- --port 3006

App runs at http://localhost:3006. The seed creates a login: demo@tailormade.local / demo1234.

Environment Variables​

All variables live in next-app/.env (gitignored). Copy from next-app/.env.example.

Database​

VariableExamplePurpose
DATABASE_URLpostgresql://postgres:password@localhost:5432/tailormadePrisma connection string

Auth​

VariableExamplePurpose
JWT_SECRET_KEY(random string)HS256 signing key for access + refresh tokens
APP_URLhttps://tailormade.global-invent-ai.comPublic base URL — used to build the Entra callback URI
ENTRA_TENANT_ID(Azure AD tenant ID)Microsoft Entra directory ID
ENTRA_CLIENT_ID(app registration client ID)Entra OAuth2 client
ENTRA_CLIENT_SECRET(app registration secret)Entra OAuth2 secret
ALLOW_USER_REGISTRATIONtrueEnable password-based sign-up
ALLOWED_REGISTRATION_EMAIL_DOMAINScapgemini.comComma-separated domain allowlist (empty = allow all)

Gemini Auth Modes​

One switch controls which Google auth path the app uses:

GOOGLE_GENAI_USE_VERTEXAI=true    # canonical — Vertex AI via ADC / service account
# or
GOOGLE_GENAI_USE_VERTEXAI=false # alternative — public Gemini API key
GEMINI_API_KEY=AIza...

Vertex AI (canonical) — requires a Google Cloud project with roles/aiplatform.user:

GOOGLE_GENAI_USE_VERTEXAI=true
GOOGLE_CLOUD_PROJECT=premi1078276-inventglobalai
GOOGLE_CLOUD_LOCATION=global

Local dev authenticates via gcloud auth application-default login. Production uses a service account key passed as GOOGLE_APPLICATION_CREDENTIALS_B64.

API key (alternative) — no Google Cloud project needed, but Veo video and Nano Banana Pro image model are unavailable:

GOOGLE_GENAI_USE_VERTEXAI=false
GEMINI_API_KEY=AIza...
GEMINI_IMAGE_MODEL=gemini-2.5-flash-image

AI Models​

VariableDefaultPurpose
GEMINI_TEXT_MODELgemini-2.5-flashText generation, copy, alt-text
GEMINI_IMAGE_MODELgemini-3-pro-image-previewImage generation (Nano Banana Pro)
PIPELINE_IMAGE_MODEL(inherits GEMINI_IMAGE_MODEL)Image Pipeline override
VEO_MODELveo-3.1-fast-generate-001Video generation
VEO_LOCATIONus-central1Veo region (always US)

Storage & CORS​

VariableDefaultPurpose
UPLOAD_DIR/uploadsFilesystem path for uploaded and generated images
CORS_ALLOWED_ORIGINS(empty)Comma-separated extra CORS origins

Database Setup​

cd next-app
npm run prisma:deploy # apply migrations (safe to re-run)
npm run prisma:seed # demo superuser + example pipeline workflow

The seed is idempotent — re-running it is safe.

Local Dev — Vertex AI Auth​

# one-time: write Application Default Credentials
gcloud auth application-default login
gcloud auth application-default set-quota-project premi1078276-inventglobalai

Tooling​

cd next-app
npm run dev -- --port 3006 # dev server
npm run build # production build (lint skipped by design)
npm run typecheck # tsc --noEmit
npm run test # vitest (141 tests)
npm run lint # eslint (0 errors, ~146 legacy warnings)