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
- Host: GitHub
- URL: https://github.com/hiroppy/app-router_nexauth_prisma_stripe_sample
- Owner: hiroppy
- Created: 2024-02-25T07:09:39.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-28T03:33:03.000Z (about 2 years ago)
- Last Synced: 2024-05-01T23:03:11.467Z (about 2 years ago)
- Language: TypeScript
- Homepage:
- Size: 131 KB
- Stars: 12
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
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
```