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.
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:
3Configure Database
Initialize Prisma and configure your database connection:
Update your .env
file:
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:
--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:
And a registration page:
6Protect Your Routes
Use middleware to protect authenticated routes:
7Start Development Server
You're all set! Start your development server:
🚀 Your App
http://localhost:3000
Main application
🔐 Auth Pages
http://localhost:3000/auth/login
http://localhost:3000/auth/register