- Next.js application with TypeScript
- User authentication powered by Stack Auth
- Database migrations with Drizzle ORM
- Ready-to-deploy configuration for Vercel, Netlify, and Render
- Neon account
- Node.js 18+ installed locally
- Create a new Neon project or use an existing one
- Navigate into Neon Auth
- Click "Connect" and go through the OAuth flow until your Neon Auth integration is set
- Navigate to your Stack Auth project dashboard
- You should have received your API keys automatically when creating your project. If you don't have them, go to API Keys under Configuration and create new ones there.
- You'll need three keys for this demo:
NEXT_PUBLIC_STACK_PROJECT_ID
,NEXT_PUBLIC_STACK_PUBLISHABLE_CLIENT_KEY
andSTACK_SECRET_SERVER_KEY
. Keep these handy for the next steps.
-
Clone the repository:
git clone https://github.com/neondatabase-labs/neon-auth-demo-app.git cd neon-auth-demo-app
-
Install dependencies:
npm install
-
Create
.env
file with the following variables:# Stack Auth NEXT_PUBLIC_STACK_PROJECT_ID= NEXT_PUBLIC_STACK_PUBLISHABLE_CLIENT_KEY= STACK_SECRET_SERVER_KEY= # Database connections DATABASE_URL= # neondb_owner role connection
Get your Stack Auth keys from your Stack Auth project dashboard.
-
Set up the database:
npm run drizzle:generate # Generate migrations npm run drizzle:migrate # Apply migrations
-
Start the development server:
npm run dev
-
Visit
http://localhost:3000
to see the application running.
Contributions are welcome! Please feel free to submit a Pull Request.