Skip to content

yuiseki/hatebu-selection

Repository files navigation

Template of Next.js + NextAuth.js + Prisma with MongoDB

What is this

The minimum Next.js template repository implemented Authentication and Persistence in MongoDB using NextAuth.js and Prisma.

How to use it

Run following commands:

npm ci
npm i -g prisma
prisma generate

Notice

We don't need prisma migrate command because we are riding on the MongoDB!

Development with Docker

According to the official documentation, Prisma require MongoDB replica set cluster even the development environment!!

https://www.prisma.io/docs/concepts/database-connectors/mongodb#error-transactions-are-not-supported-by-this-deployment

I believe it's making things crazy hard... But thankfully, there is a workaround.

prisma/prisma#8266 (comment)

docker compose build
docker compose exec mongodb mongo --eval "rs.initiate({_id: 'rs0', members: [{_id: 0, host: 'mongodb:27017'}]});"
docker compose up

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published