Next.js + Stripe + PostgreSQL + Monk

Full-Stack Deployment
Made Simple

This demo showcases how Monk deploys your Next.js backend to containers, PostgreSQL database, and integrates Stripe—all in one go.

Backend
Container
Next.js API routes in Docker
PostgreSQL
Not Configured
Configure DATABASE_HOST
Stripe
Not Configured
Test mode
Subscriptions
N/A
Database required

Pricing

Connect Stripe and provide a price to enable checkout

REST API

Explore the backend API endpoints powered by Next.js API routes

Check service health, Stripe config, and database connection status

curl /api/health

Monk Entity Integration

This demo uses Monk to automatically provision and configure:

  • postgres - PostgreSQL database container
  • stripe/credentials - API keys and account info
  • stripe/webhook-endpoint - Webhook URL and signing secret
  • stripe/product - Product managed by Monk
  • stripe/price - Pricing configuration
app:
  defines: runnable
  connections:
    database:
      runnable: nextjs-stripe-demo/postgres
    creds:
      runnable: nextjs-stripe-demo/stripe-creds
    webhook:
      runnable: nextjs-stripe-demo/stripe-webhook
  variables:
    DATABASE_HOST:
      value: <- connection-hostname("database")
    DATABASE_PASSWORD:
      value: <- secret("postgres-password")
    STRIPE_SECRET_KEY:
      value: <- secret($stripe_secret_ref)
    STRIPE_PRODUCT_ID:
      value: <- connection-target("product") 
             entity-state get-member("product_id")