An open API service indexing awesome lists of open source software.

https://github.com/hiroppy/app-router_nexauth_prisma_stripe_sample

stripe + next.js app router + nextauth + prisma
https://github.com/hiroppy/app-router_nexauth_prisma_stripe_sample

Last synced: 11 months ago
JSON representation

stripe + next.js app router + nextauth + prisma

Awesome Lists containing this project

README

          

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](https://docs.docker.com/compose/install/) section.

**Enabling git hook and corepack**

```sh
$ npm run setup
```

**Installing Deps**

```sh
$ pnpm i
```

**Creating `.env.local` and modifying env**

```sh
$ 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

```sh
# 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
```