Skip to content
AleBrito124356Public

About

Migraciones de bases de datos con IA: análisis, cotización fija y artefactos listos para ejecutar. Next.js 15 + Prisma + Stripe + Claude.

Topics

Resources

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

Morph

AI-run database migrations. Pay once, migrate with confidence.

Morph turns a risky, weeks-long database migration into a single fixed-price transaction. You describe your source database, target database, scale, and requirements. Morph's AI (Anthropic claude-opus-4-8) analyzes the migration, returns a deterministic, up-front quote, and — the moment you pay — generates the complete artifact set you need to execute the move safely: target schema, data-movement scripts, a validation suite, a rollback plan, and an operator runbook. Every migration also gets its own AI chat assistant grounded in your specific plan.

No subscriptions. No per-seat pricing. You pay once, per migration.


What you get per migration

When payment clears, Morph generates a downloadable artifact set:

Artifact What it is
Target DDL / schema The full schema translated and tuned for your target engine.
Data-movement script A repeatable script to move and transform data from source to target.
Validation / reconciliation suite Checks that prove the target matches the source — row counts, checksums, spot-checks.
Rollback plan A concrete, ordered path back to the source if something goes wrong.
Operator runbook Step-by-step instructions a human operator follows on cutover day.

Alongside the artifacts, the migration detail page shows the AI plan (ordered steps with ETAs), a risk register (severity + mitigation per risk), an activity timeline, and a per-migration chat assistant that answers questions in the context of your migration.


Features

  • One-time pricing, computed server-side. The AI proposes complexity; the price is derived deterministically from scale and complexity in src/lib/pricing.ts and is never trusted from the model.
  • Guided migration wizard. Source DB, target DB, scale, and requirements in a few focused steps.
  • AI analysis + fixed quote. Complexity score, estimated duration, summary, risks, and an ordered plan — before you spend a cent.
  • Full artifact generation on payment. DDL, data-movement, validation, rollback, and runbook, all downloadable.
  • Per-migration AI chat. Ask about any step, risk, or artifact; the assistant is grounded in your plan.
  • Adaptive AI engine. Anthropic SDK with adaptive thinking, prompt caching, and streaming — plus a deterministic offline fallback engine so the product is fully functional with no API key.
  • One-time Stripe Checkout with an instant demo payment mode for local development and demos.
  • Custom JWT auth. jose-signed tokens in httpOnly cookies, bcryptjs password hashing, route protection in middleware.ts.
  • Portable data layer. Prisma + SQLite for local dev, a one-line switch to PostgreSQL for production.
  • "Daylight / Liquid Blue" design system. A light, all-blue palette with frosted glassmorphism, interactive 3D (react-three-fiber), and a high-end scroll experience (framer-motion: magnetic CTAs, scroll reveals, parallax, tilt). Tailwind CSS with Outfit, Hanken Grotesk, and JetBrains Mono.

How it works

  Sign up / log in
        │
        ▼
  New migration wizard ──────────►  source DB · target DB · scale · requirements
        │
        ▼
  AI analysis  ──────────────────►  complexity · risks · ordered plan · ETA
        │
        ▼
  Deterministic quote  ──────────►  fixed price, computed server-side
        │
        ▼
  One-time payment  ─────────────►  Stripe Checkout  (or instant demo mode)
        │
        ▼
  AI generates artifacts  ───────►  DDL · data-movement · validation · rollback · runbook
        │
        ▼
  Migration detail page  ────────►  download artifacts · plan · risks · timeline · chat

A project moves through these statuses: draft → analyzing → quoted → awaiting_payment → paid → generating → ready (with failed as the error path).


Quick start

Requirements: Node 18.18+. Works on Windows, macOS, and Linux.

# 1. Install dependencies
npm install

# 2. Set up the database (prisma generate + db push + db seed)
#    Creates prisma/dev.db with seeded demo data.
npm run setup

# 3. Start the dev server
npm run dev

Open http://localhost:3000.

Morph runs out of the box with no API keys: the AI uses its deterministic demo engine and checkout uses instant demo payments. Add keys to .env when you're ready to go live (see Demo vs live).

Demo logins

The seed script creates two ready-to-use accounts (both password morphdemo):

Email Password
demo@morph.dev morphdemo
alejandrobritoolivera@gmail.com morphdemo

Environment variables

Copy .env.example to .env and fill in what you need. Only the first three are required for local development.

Variable Required Description
DATABASE_URL Yes Database connection string. Defaults to file:./dev.db (SQLite).
AUTH_SECRET Yes Secret used to sign JWT session tokens. Use a long random string.
NEXT_PUBLIC_APP_URL Yes Public base URL of the app (e.g. http://localhost:3000).
ANTHROPIC_API_KEY No Anthropic API key. Blank → deterministic demo AI engine.
STRIPE_SECRET_KEY No Stripe secret key. Blank → instant demo checkout.
STRIPE_WEBHOOK_SECRET No Signing secret for the Stripe webhook (/api/stripe/webhook).
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY No Stripe publishable key, used client-side at checkout.

npm scripts

Script Description
npm run dev Start the Next.js dev server.
npm run build prisma generate then build for production.
npm run start Start the production server (after build).
npm run lint Run ESLint (next lint).
npm run typecheck Type-check the project with tsc --noEmit.
npm run db:push Push the Prisma schema to the database.
npm run db:seed Seed the database with demo users and migrations.
npm run db:reset Force-reset the schema and re-seed.
npm run setup One-shot: prisma generate + db push + db seed.

Demo vs live

Morph is fully functional with zero external services configured. Each integration independently detects whether its key is present and falls back to a deterministic demo mode otherwise.

Capability Demo mode (no key) Live mode (key set)
AI engine ANTHROPIC_API_KEY blank → a deterministic offline engine produces analysis, quotes, artifacts, and chat replies. ANTHROPIC_API_KEY set → Anthropic claude-opus-4-8 with adaptive thinking, prompt caching, and streaming.
Payments STRIPE_SECRET_KEY blank → checkout simulates an instant successful payment. STRIPE_SECRET_KEY set → real one-time Stripe Checkout + webhook confirmation.

To go live, set the relevant keys in .env and restart. You can enable AI and payments independently — for example, real AI with demo payments, or vice versa.


Project structure

morph/
├─ prisma/
│  ├─ schema.prisma        # Data model (SQLite dev → flip provider for Postgres)
│  └─ seed.ts              # Seeds demo users + example migrations
├─ src/
│  ├─ app/                 # Next.js App Router
│  │  ├─ (marketing)/      # Public pages: home, pricing, how-it-works
│  │  ├─ (auth)/           # Login, signup
│  │  ├─ (app)/            # Authenticated: dashboard, migrations, billing, settings
│  │  │  └─ migrations/    # New-migration wizard + migration detail page
│  │  ├─ api/
│  │  │  ├─ stripe/webhook/            # Stripe webhook handler
│  │  │  └─ migrations/[id]/artifacts/ # Artifact download endpoint
│  │  ├─ actions.ts        # Server actions (wizard, analysis, payment, chat)
│  │  ├─ layout.tsx        # Root layout
│  │  └─ globals.css       # Design-system styles
│  ├─ components/
│  │  ├─ ui/               # Primitives (button, card, badge, input, code-block…)
│  │  ├─ brand/            # Logo, pipeline graphic
│  │  ├─ marketing/        # Landing-page sections
│  │  ├─ app/              # Dashboard shell (sidebar, topbar, cards)
│  │  ├─ wizard/           # Migration wizard + stepper
│  │  ├─ migration/        # Plan timeline, risks, artifacts, chat, pay button
│  │  └─ auth/             # Login / signup forms
│  ├─ lib/
│  │  ├─ db.ts             # Prisma client
│  │  ├─ auth.ts · jwt.ts  # Custom JWT auth (jose) + sessions
│  │  ├─ ai.ts             # Anthropic AI engine (thinking, caching, streaming)
│  │  ├─ engines.ts        # Deterministic offline fallback engine
│  │  ├─ migrations.ts     # Migration orchestration
│  │  ├─ pricing.ts        # Server-side deterministic pricing
│  │  ├─ templates.ts      # Artifact templates
│  │  ├─ stripe.ts         # Stripe + demo checkout
│  │  ├─ types.ts          # String-union types for status fields
│  │  └─ utils.ts          # Shared helpers
│  └─ middleware.ts        # Route protection
├─ .env.example
└─ package.json

Tech stack

  • Framework: Next.js 15 (App Router) · React 19 · TypeScript
  • Database / ORM: Prisma — SQLite for local dev, PostgreSQL for production
  • Auth: Custom JWT with jose, bcryptjs password hashing, httpOnly cookies
  • AI: Anthropic SDK (claude-opus-4-8) with adaptive thinking, prompt caching, and streaming; deterministic offline fallback engine
  • Payments: Stripe one-time Checkout + webhook, with an instant demo mode
  • Styling: Tailwind CSS — "Daylight / Liquid Blue" theme (light + blue + glassmorphism); Outfit / Hanken Grotesk / JetBrains Mono
  • 3D & motion: react-three-fiber + drei (interactive WebGL crystals), framer-motion (scroll reveals, magnetic buttons, parallax, tilt, counters)

Production notes

  • Switch to PostgreSQL. In prisma/schema.prisma change the datasource provider from sqlite to postgresql, point DATABASE_URL at your Postgres instance, then run npm run db:push. No schema changes are required — enum-like fields and JSON payloads are stored as strings precisely so the same schema runs on both engines.
  • Set a strong AUTH_SECRET. Use a long, random value; rotating it invalidates existing sessions.
  • Configure the Stripe webhook. Point your Stripe webhook at /api/stripe/webhook and set STRIPE_WEBHOOK_SECRET so payment confirmations are verified.
  • Artifact generation runs inline after payment. This is fine for the current scale, but a production deployment should move artifact generation to a background queue so the request that confirms payment returns immediately and generation is retryable.

A note on how this was built

The application surface — all pages and feature UI — was generated by a parallel multi-agent Claude Code workflow against a hand-authored backbone (data model, auth, pricing, AI engines, and orchestration). The result is a coherent, production-shaped Next.js app rather than a scaffold.


FILES: C:\Claude Ideas\morph\README.md

About

Migraciones de bases de datos con IA: análisis, cotización fija y artefactos listos para ejecutar. Next.js 15 + Prisma + Stripe + Claude.

Topics

Resources

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages