This is a Next.js template which includes the following technology
- next.js (app router)
- drizzle orm
- lucia auth
- sqlite (or turso)
- shadcn
- react hook form
- zsa (server action validation)
- tiered architecture example
- resend emails
The point of this template is to allow you to setup a project which has a lot of the necessary authentication functionality out of the box, such as
- google oauth login
- github oauth login
- magic link login
- email / password login
- password reset flow email
- account registration + confirmation emails
cp .env.sample .env
(fill out the necessary information for email support with resend, and your google + github oauth info, more info below)npm i
npx drizzle-kit push
(will create your sqlite database)npm run dev
If you want google login, you'll need to setup a google project and create some keys:
- https://console.cloud.google.com/apis/credentials
- create a new project
- setup oauth consent screen
- create credentials - oauth client id
- for authorized javascript origins
- Authorized redirect URIs
- Set your google id and secret inside of .env
- GOOGLE_CLIENT_ID
- GOOGLE_CLIENT_SECRET
TODO
I'm hoping to keep this template as slim as possible and only add auth related features. Some future things that might be nice to add in could be MFA, sign out all devices, etc. I'm open to contributions, but please keep that core vision of "just auth related stuff" in mind.