Start with this boilerplate to make your own nextjs app(Docker image)
- styled-component
- antd
- serviceWorker(public/sw.js)
- Dockerfile
- git clone [email protected]:david718/nextjs-nextauth-prisma-starter.git
- cd nextjs-nextauth-prisma-starter
- yarn install
- touch .env
- NEXTAUTH_URL=
- NEXT_PUBLIC_API_SERVER_URL=
http://localhost:3000/api
- DATABASE_URL=
- KAKAO_REST_KEY=
- KAKAO_REDIRECT_URI=
http://localhost:3000/api/auth/callback/kakao
kakao-login with next-auth(medium posts)
- create kakao app and use kakao loginkakao developer site
- get
kakao login rest key
- input
http://localhost:3000/api/auth/callback/kakao
to redirect_uri - please change status of profile and email in agreement items(scope)
- get
- edit .env
- ...
- KAKAO_REST_KEY=
kakao login rest key
- KAKAO_REDIRECT_URI=
http://localhost:3000/api/auth/callback/kakao
- yarn dev
- you can use additional login(google or facebook login) with
.env
andapi/auth/[...nextauth].ts
in nextauth
- create database and get
database url
- npx prisma init
- edit .env
- ...
- DATABASE_URL={
database url
} - ...
- create user table with cli(You have to directly connect with DB!, cannot make any tables with prisma CLI or API)
- npx prisma db pull
- yarn add @prisma/client
- npx prisma generate
- docker build -t
{dockerId}/{imageName}:{version}
(exhkc718/everyday-bible:1.0
) - docker images
- you can verify your docker image