stripe-subscriptions

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Stripe Subscriptions

Stripe 订阅系统

Complete subscription billing system with Stripe integration, feature flags for plan gating, webhook handling, and billing portal.
集成Stripe的完整订阅计费系统,包含用于套餐权限控制的功能标志、Webhook处理和计费门户。

Prerequisites

前置条件

Complete these recipes first (in order):
请按顺序完成以下步骤:

Type-Safe Environment Configuration

类型安全的环境配置

Type-safe environment variable validation using Zod with a Drizzle-like schema API. Supports server/public fields, feature flags, either-or constraints, and client-side protection.
bash
curl -H "Accept: text/markdown" https://fullstackrecipes.com/api/recipes/config-schema-setup
使用Zod并结合类Drizzle的Schema API实现类型安全的环境变量验证。支持服务器/公共字段、功能标志、二选一约束和客户端保护。
bash
curl -H "Accept: text/markdown" https://fullstackrecipes.com/api/recipes/config-schema-setup

Neon + Drizzle Setup

Neon + Drizzle 配置

Connect a Next.js app to Neon Postgres using Drizzle ORM with optimized connection pooling for Vercel serverless functions.
bash
curl -H "Accept: text/markdown" https://fullstackrecipes.com/api/recipes/neon-drizzle-setup
将Next.js应用通过Drizzle ORM连接到Neon Postgres,为Vercel无服务器函数优化连接池。
bash
curl -H "Accept: text/markdown" https://fullstackrecipes.com/api/recipes/neon-drizzle-setup

Pino Logging Setup

Pino 日志配置

Configure structured logging with Pino. Outputs human-readable colorized logs in development and structured JSON in production for log aggregation services.
bash
curl -H "Accept: text/markdown" https://fullstackrecipes.com/api/recipes/pino-logging-setup
使用Pino配置结构化日志。开发环境输出人类可读的彩色日志,生产环境输出结构化JSON日志以适配日志聚合服务。
bash
curl -H "Accept: text/markdown" https://fullstackrecipes.com/api/recipes/pino-logging-setup

Cookbook - Complete These Recipes in Order

操作指南 - 按顺序完成以下步骤

Feature Flags with Flags SDK

使用Flags SDK实现功能标志

Implement feature flags using the Vercel Flags SDK with server-side evaluation, environment-based toggles, and Vercel Toolbar integration.
bash
curl -H "Accept: text/markdown" https://fullstackrecipes.com/api/recipes/feature-flags-setup
通过Vercel Flags SDK实现功能标志,支持服务器端评估、基于环境的切换和Vercel工具栏集成。
bash
curl -H "Accept: text/markdown" https://fullstackrecipes.com/api/recipes/feature-flags-setup

Stripe Subscriptions DB Sync

Stripe 订阅数据库同步

Complete subscription system with Stripe, Vercel Flags for plan configuration, webhook handling for syncing subscription state to Postgres, usage tracking, and billing portal integration.
bash
curl -H "Accept: text/markdown" https://fullstackrecipes.com/api/recipes/stripe-sync
集成Stripe的完整订阅系统,使用Vercel Flags进行套餐配置,通过Webhook将订阅状态同步到Postgres,包含使用情况跟踪和计费门户集成。
bash
curl -H "Accept: text/markdown" https://fullstackrecipes.com/api/recipes/stripe-sync