hiroppy / app-router_nexauth_prisma_stripe_sample

stripe + next.js app router + nextauth + prisma

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This sample shows how to handle Stripe payments using NextAuth and Prisma based on Next.js's app router.

Dummy cards: https://docs.stripe.com/testing

Setup

Installing Docker Compose

Please check Installation scenarios section.

Enabling git hook and corepack

$ npm run setup

Installing Deps

$ pnpm i

Creating .env.local and modifying env

$ cp .env.sample .env.local

If you use Google OAuth, you need to set GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET, if not, you can remove a provider from _clients/NextAuth.ts. And NextAuth requires NEXTAUTH_SECRET token so please generate using OpenSSL.

Dev

# start docker-compose, migrations(generating the client), and next dev
$ pnpm dev
# create new migration
$ pnpm dev:db:migrate
# reset the DB
$ pnpm dev:db:reset
# view the contents
$ pnpm dev:db:studio

About

stripe + next.js app router + nextauth + prisma


Languages

Language:TypeScript 95.6%Language:JavaScript 3.9%Language:CSS 0.4%Language:Shell 0.2%