A Next.js starter kit template with React 17 + Typescript + Tailwind CSS 2 + React Query 3 + NextAuth.js (with GitHub Auth + Passwordless Auth) + Fauna DB
Clone the project
git clone https://github.com/pbteja1998/nextjs-starter.git
Go to the project directory
cd nextjs-starter
Install dependencies
yarn
Create .env.local and change env variables as per the instructions.
cp .env.example .env.local
Setup the database by running the following command and pasting the Fauna Secret key when prompted. More details at fauna-schema-migrate.
yarn setup-db
Start the server
yarn dev
To run this project, you will need to add the following environment variables to your .env.local
file
NEXTAUTH_URL
http://localhost:3000
SECRET
EMAIL_SERVER
smtp://username:[email protected]:587
. Replace username
, password
and smtp.example.com
with your own credentials.EMAIL_FROM
GITHUB_ID
GITHUB_SECRET
Homepage URL
to http://localhost:3000
and Authorization Callback URL
to http://localhost:3000/api/auth/callback/github
LINKEDIN_ID
LINKEDIN_SECRET
http://localhost:3000/api/auth/callback/linkedin
FAUNADB_SECRET
Please note that this is completely optional. You can directly create your database in Fauna cloud and directly use the secret you generate there.
We are using Fauna Dev docker container to run Fauna instance locally.
These are the instructions to setup Fauna container locally.
# Pull the latest Docker container:
docker pull fauna/faunadb:latest
# Verify that the container executes correctly:
docker run fauna/faunadb --help
After you installed this, you can start the container using the following command
docker run --rm --name faunadb -p 8443:8443 -p 8084:8084 fauna/faunadb
Please note that this will create a new instance of Fauna everytime you run it, and all the data will be cleared when you stop this container. For other config options and approaches, go through the documentation.
Changes you need to do in the template:
USE_FAUNA_DOCKER=true
in your .env.local
fileyarn setup-docker-db
.For feedback and support, please open an issue in this repo.
TBD
TBD
TBD
TBD