Next.js starter kit
Install the Next.js starter kit, configure Better Auth and PostgreSQL, and create an admin account.
Getting started
Download the starter kit zip file, extract it, and open the project folder in your terminal. Then install the dependencies:
Copy the example environment file:
Better Auth
This project uses Better Auth for authentication. Generate a private secret:
Add the generated value to your .env file:
Keep this secret private.
Database setup
By default, this starter kit uses PostgreSQL. Set your DATABASE_URL in .env:
Replace USER, PASSWORD, HOST, PORT, and DATABASE with your PostgreSQL credentials.
The starter kit supports optional email verification. If you want users to verify their email, set NEXT_PUBLIC_EMAIL_VERIFICATION to true and configure Resend.
Create an API key on the Resend dashboard, then update your .env:
If you do not need email verification, set:
Running the application
Start the development server:
Open http://localhost:3000 in your browser.
Admin account
Register an account at /register, then promote that existing account from your terminal:
Replace you@example.com with the email address you registered. This command assigns the admin role to an existing account; it does not create a new account.
Sign out and sign in again after changing the role. The Users menu will appear in the sidebar. Open it to manage users.