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.gitGo to the project directory
cd nextjs-starterInstall dependencies
yarnCreate .env.local and change env variables as per the instructions.
cp .env.example .env.localSetup the database by running the following command and pasting the Fauna Secret key when prompted. More details at fauna-schema-migrate.
yarn setup-dbStart the server
yarn devTo run this project, you will need to add the following environment variables to your .env.local file
NEXTAUTH_URL
http://localhost:3000SECRET
EMAIL_SERVER
smtp://username:[email protected]:587. Replace username, password and smtp.example.com with your own credentials.EMAIL_FROM
GITHUB_IDGITHUB_SECRET
Homepage URL to http://localhost:3000 and Authorization Callback URL to http://localhost:3000/api/auth/callback/githubLINKEDIN_IDLINKEDIN_SECRET
http://localhost:3000/api/auth/callback/linkedinFAUNADB_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 --helpAfter you installed this, you can start the container using the following command
docker run --rm --name faunadb -p 8443:8443 -p 8084:8084 fauna/faunadbPlease 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.
MIT
TBD
TBD
TBD
TBD