This is a Next.js Application with a simple implementation of NextAuth.js. The application support :
- Typescript ;
- NextAuth.js ;
git clone https://github.com/clemb8/boilerplate-next-auth-typescript-pg.git
First, run the development server:
# Install dependency
npm install
## or
yarn
# serve with hot reload at localhost:3000
npm run dev
## or
yarn run dev
Create a .env file :
touch .env.local
You need to setup the following variables :
DATABASE_URL=postgres://postgres:postgres@localhost:5433/postgres
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=***
GOOGLE_CLIENT_ID=XXX.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=XXXXXXXXXXXXXXXXXXXXXXX
GITHUB_CLIENT_ID=XXXXXXXXXXXXXXXXXXXX
GITHUB_CLIENT_SECRET=XXXXXXXXXXXXXXX
SALESFORCE_CLIENT_ID=XXXXXXXXXXXXXXXX
SALEFORCE_CLIENT_SECRET=XXXXXXXXXXXXXXXXX
Install the PostGreSQL Database :
docker-compose up