nextjs starter kit
1.0.0
克隆存儲庫:
git clone <repository-url>
cd <project-directory>
安裝依賴項:
yarn
設置環境變量:在根目錄中創建一個.env文件,並具有以下變量:
SUPABASE_URL=<your-supabase-project-url>
SUPABASE_SERVICE_KEY=<your-supabase-service-key>
# If using Stripe
STRIPE_SECRET_KEY=<your-stripe-secret-key>
NEXT_PUBLIC_STRIPE_PRICE_ID=<your-stripe-price-id>
# If using Clerk
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=<your-clerk-publishable-key>
CLERK_SECRET_KEY=<your-clerk-secret-key>
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/
NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/
配置功能:在config.ts中,設置所需的功能:
const config = {
auth : {
enabled : true , // Set to false if not using Clerk
} ,
payments : {
enabled : true , // Set to false if not using Stripe
}
} ;設置數據庫:運行Prisma遷移:
npx prisma migrate dev
啟動開發服務器:
yarn dev
打開瀏覽器並導航到http://localhost:3000以查看您的應用程序運行。
/api/auth/webhook以及條紋(如果使用付款)at /api/payments/webhook 。prisma/schema.prisma中修改Prisma架構。 有關更多詳細信息,請參閱本項目中使用的各個技術的文檔: