Next.jsReactSaaSStarter

auth_template — Next.js SaaS Template

By AmarMuric04

An authentication starter template based on the Next.js App Router, providing email OTP passwordless login, Google/GitHub OAuth via NextAuth, a Prisma + Supabase data layer, and a built-in extensible AI chatbot interface.

Explore the design

Compare the page layouts and mobile experience. Open any screenshot for a closer look.

2 previews
Desktop homepage1 / 2
Desktop captureTop of page

Actual screenshot captured by the server browser.

All pages & views 2

Screenshots show visual appearance; interactive behavior may differ.

Recorded 2026-10-03View source

What stands out

A quick read of the recorded project description.

01

Email OTP passwordless login, issuing a custom JWT after verification, with no passwords stored

02

OAuth login with Google and GitHub via NextAuth

03

Supabase PostgreSQL + Prisma ORM, with schemas already covering users, OTP, sessions, and chat data

04

Built-in extensible AI chatbot UI, with chat records stored in Supabase

05

Modular directory structure based on the Next.js App Router, with a responsive interface

Template Details

This template is aimed at SaaS or application projects that need to quickly set up an authentication system. It places two authentication paths in the same Next.js project: one is a custom email OTP passwordless login that issues a custom JWT after verification and uses stateless sessions; the other is OAuth login with Google and GitHub via NextAuth. The data layer uses PostgreSQL provided by Supabase and is accessed through Prisma ORM. The repository already includes schemas for users, OTP verification, sessions, and chatbot data.

The interface is responsive and includes a login page and a built-in AI chatbot UI, with chat records written to Supabase. The project structure is organized by the App Router, with authentication-related APIs under pages/api/auth, and authentication and JWT utilities centralized in the lib directory.

Before use, you need to prepare your own Supabase database, JWT secret, NextAuth secret, and Google/GitHub OAuth credentials, and run Prisma generate and db push to initialize the table structure. The unit tests and end-to-end tests mentioned in the README are marked as "coming soon"; the repository currently does not include a test suite. The template is MIT licensed and can be used, modified, and distributed for free, but third-party resources such as demo assets, fonts, and icons, as well as external services such as Supabase, hosting, and AI, require separate verification of licensing and costs.

Next.jsSaaSStarter

Is it right for your project?

Use Cases

  • Set up a login entry point for a SaaS product that supports both OTP and OAuth
  • Introduce a Prisma + Supabase authentication data model into an existing Next.js project
  • Application prototypes that need a built-in customer support or onboarding AI chat interface
  • Serve as a reference project for learning how NextAuth and custom JWT session approaches can coexist

Suitable For

  • Developers using the Next.js App Router and planning to integrate Supabase
  • SaaS or application projects that need a runnable authentication flow quickly
  • Products that want to keep both passwordless login and third-party OAuth

Getting started & customization

Use these recorded setup notes alongside the repository instructions for your chosen version.

  1. 1

    After cloning the repository, run npm install or yarn to install dependencies

  2. 2

    Copy .env.example to .env.local and fill in DATABASE_URL, JWT_SECRET, Supabase and NextAuth-related variables, and Google/GitHub OAuth credentials

  3. 3

    Run npx prisma generate and npx prisma db push to initialize the database table structure

  4. 4

    Optionally run npm run seed to write seed data, then run npm run dev to start the local development server

  5. 5

    The testing section in the README is marked as coming soon; the repository currently does not provide Jest or Playwright tests

Read repository instructions

License & source material

Usage conditions & limitations

Free to use · keep license notice

This entry covers the free version under the MIT license in the public repository; the free scope is the code of this version and does not mean that external services or third-party assets are free.

Must comply with when using

  • You may use, modify, commercialize, and distribute the code of this version for free.
  • When distributing copies or substantial portions of the code, retain the original author's copyright notice and the complete MIT license notice.
  • The code is provided as is; warranties and limitations of liability are governed by the original license and applicable law.

Additional costs & items to verify

  • Before use, you must prepare and connect a PostgreSQL database yourself (the README recommends Supabase), and provide connection information such as DATABASE_URL; this is an external service dependency.
  • You need to create a Supabase project yourself and provide SUPABASE_URL and SUPABASE_SERVICE_ROLE_KEY; chat records and data depend on this external service.
  • OAuth login requires you to register an application on GitHub yourself and configure GITHUB_ID/GITHUB_SECRET credentials; otherwise this login method is unavailable.
  • Google OAuth login requires you to apply for Google client credentials yourself and configure GOOGLE_CLIENT_ID/GOOGLE_CLIENT_SECRET.
  • NextAuth sessions require you to generate and configure NEXTAUTH_SECRET and NEXTAUTH_URL yourself; this is configuration that must be completed before deployment.
  • Custom JWT issuance depends on a JWT_SECRET that you set yourself; if it is missing, the OTP login flow will not work properly.
  • OTP login requires a working email sending service; the README only states that it can be simulated in the development environment, and production requires you to integrate an email service yourself and bear the corresponding costs.
  • The deployment example points to Vercel; actual hosting requires you to register an account yourself and may incur costs, which are external service costs.
  • Demo images, fonts, icons, and other third-party assets must be checked against their respective licenses and cannot be judged solely by the code's MIT license.
  • External services such as domains, hosting, databases, payments, or AI may incur additional charges.
View Original Text Basis

Permission is hereby granted, free of charge

Original License Text

DATABASE_URL=postgresql://user:password@host:port/dbname

Original README

SUPABASE_URL=https://your-project.supabase.co

Original README

GITHUB_ID=your_github_id

Original README

GOOGLE_CLIENT_ID=your_google_client_id

Original README

NEXTAUTH_SECRET=nextauth_secret_here

Original README

JWT_SECRET=your_jwt_secret

Original README

An OTP code is emailed (or mocked in dev)

Original README

One-click deploy to **Vercel**

Original README
https://github.com/AmarMuric04/auth_template/blob/master/LICENSEhttps://github.com/AmarMuric04/auth_template/blob/master/README.md

Compiled by DeepSeek based on repository license and README ·2026-10-03. Results only cover the materials read; dependencies, images, fonts, and subsequent term changes are subject to their respective original texts.

Project checks & description sources

Template Information

Source platforms
GitHub
Documentation and maintenance reference score
More documented · 82 / 100
Technologies
Next.js · React
Website type
SaaS · Starter
How this score is calculated

Our heuristic uses license records (up to 30), a demo link (12), a preview (10), stars (15), recorded maintenance (15), description completeness (8), feature records (5) and classification data (5). It is not a code, security or performance test, or a Google score. A link does not establish tested functionality.

What to verify for this project

Repository update recorded
2025-05-10
Screenshot last checked
2026-10-03

A demo link is listed. Check it with your own content and viewport sizes; its presence does not confirm that forms, authentication or payments work.

The catalog identifies Next.js as the primary stack. Check the actual dependency manifest and lockfile for versions and hosting requirements. These notes use recorded metadata, not a code audit or a deployment test.

Use a selection guide →

How this description was prepared

AI-assisted description based on catalog records and repository material. Repository authors are not automatically the reviewers of this description.

Automatically checked against source and license rules; no manual editorial review.

Inspect the recorded source material

SHA-256: 6f72008bb2512b9212242a543bb45041b55247c76a0099e8c77a619c4ff1c305

2026-10-03T07:23:49.145Z

Source file / repository
# 🔐 Full Auth Template – Custom JWT + OTP + OAuth (Next.js + Prisma + Supabase)

A modern and secure **authentication template** built with **Next.js**, featuring:

- 🔑 **Custom credentials auth** using **passwordless OTP** (no passwords stored!)
- 🔐 **OAuth support** with **GitHub** and **Google** (via NextAuth)
- ⚙️ **Custom JWT-based system** for credentials auth
- 🧠 A custom-built **AI chatbot** integrated and ready to go
- 🎨 Fully responsive, modern UI
- 🧩 **Supabase** PostgreSQL database with **Prisma ORM**

Designed for scalability and security, this starter gives you everything you need to bootstrap a real-world auth system.

---

## 🚀 Features

- ✅ Passwordless authentication via OTP codes (email-based)
- 🔐 OAuth support with GitHub and Google via NextAuth
- 🔑 Custom credentials login with stateless JWT handling
- 🧠 Integrated AI chatbot (drop-in use or extendable)
- 📱 Fully responsive and mobile-friendly
- 💽 PostgreSQL + Supabase backend with Prisma ORM
- 🧰 Built with **Next.js App Router** and modular component design

---

## 🧱 Tech Stack

| Layer        | Tech            |
|--------------|-----------------|
| Frontend     | Next.js         |
| Backend      | Next.js (API)   |
| Auth (OAuth) | NextAuth        |
| Auth (OTP)   | Custom JWT + OTP |
| DB           | PostgreSQL via Supabase |
| ORM          | Prisma          |
| AI Chatbot   | Custom-built (plug-and-play) |

---

## 🔧 Getting Started

### 1. Clone the Repository

```bash
git clone https://github.com/amarmuric04/auth-template.git
cd auth-template
```

### 2. Install Dependencies

```bash
npm install
# or
yarn
```

### 3. Configure Environment Variables

Copy `.env.example` to `.env.local`:

```env
DATABASE_URL=postgresql://user:password@host:port/dbname

# JWT Secrets
JWT_SECRET=your_jwt_secret

# Supabase
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_SERVICE_ROLE_KEY=your_service_role

# NextAuth (for OAuth)
NEXTAUTH_SECRET=nextauth_secret_here
NEXTAUTH_URL=http://localhost:3000
GITHUB_ID=your_github_id
GITHUB_SECRET=your_github_secret
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
```

### 4. Set Up the Database

```bash
npx prisma generate
npx prisma db push
```

> ✅ Schema already included for user, OTP verification, sessions, and chatbot data.

### 5. Seed the Database (Optional)

Use mock data or your own:

```bash
npm run seed
```

### 6. Start the App

```bash
npm run dev
# or
yarn dev
```

Open [http://localhost:3000](http://localhost:3000)

---

## 🧬 How Authentication Works

### 🔑 OTP-based Credentials (Passwordless)

- Users login with email
- An OTP code is emailed (or mocked in dev)
- OTP is verified and a **JWT** is issued
- Stateless auth: sessions are stored client-side via JWT

### 🧷 OAuth Login

- Handles GitHub and Google using **NextAuth**
- Session strategy can be configured (JWT or DB-based)

---

## 🤖 AI Chatbot

A smart, extendable chatbot built directly into the UI.

- Custom hook/API integration
- Chat log stored in Supabase
- UI is mobile-ready and responsive
- Great for onboarding or user help center

---

## 📁 Project Structure

``
/app                → Next.js App Router pages
/components         → UI and shared components
/lib                → Utilities (auth, jwt, helpers)
/prisma             → Prisma schema and client
/pages/api/auth     → Custom API for OTP + NextAuth
/styles             → Global CSS / Tailwind
/chatbot            → AI bot logic and UI
``

---

## 🔐 Security Notes

- Passwordless auth = more secure and lower friction
- OTP expires after X minutes (configurable)
- JWT is signed with server-only secret
- OAuth tokens never touch your DB directly
- Fully stateless login path with fallback to OAuth

---

## 🧪 Testing

Coming soon:
- Jest for unit tests
- Playwright for E2E
- Auth flow test harness

---

## 📦 Deployment

- One-click deploy to **Vercel**
- Add env variables in Vercel dashboard
- Works with Docker (optional)

---

## 📜 License

MIT

---

Built for modern apps that need secure, scalable, and flexible authentication + AI support.
Report a correction

Explore similar templates

Compare previews and descriptions within the same stack and category.