Quick Start

Getting Started with Next.js

Create a new Next.js application with AuthCore authentication in minutes.

1Create a New Next.js App

Start by creating a new Next.js application using create-next-app. Choose TypeScript for the best development experience.

Terminal

Installation Options

When prompted, select: Yes for TypeScript, Yes for Tailwind CSS, Yes for App Router

2Install AuthCore Package

Install the AuthCore package and its dependencies:

Terminal

3Configure Database

Initialize Prisma and configure your database connection:

Terminal

Update your .env file:

.env

4Run Database Migrations

AuthCore provides a Prisma schema, seeds, and optional API handlers. Run the CLI to copy everything into your project and apply migrations in one go:

Terminal
CLI tips: Drop --with-api if you are wiring custom endpoints or the App Router. The CLI will never overwrite existing files without asking; pass --yes for unattended runs.

5Create Authentication Pages

Create a login page with the AuthForm component:

app/auth/login/page.tsx

And a registration page:

app/auth/register/page.tsx

6Protect Your Routes

Use middleware to protect authenticated routes:

middleware.ts

7Start Development Server

You're all set! Start your development server:

Terminal

🚀 Your App

http://localhost:3000

Main application

🔐 Auth Pages

http://localhost:3000/auth/login

http://localhost:3000/auth/register

Next Steps