neondatabase-labs/neon-auth-demo-app

Neon Auth demo using Next.js, Drizzle, and Styled Components

reactnextdrizzletypescriptstyled-components
Loading...
netlifyrender

Neon Auth Demo App

Features

  • Next.js application with TypeScript
  • User authentication powered by Neon Auth
  • Database migrations with Drizzle ORM
  • Ready-to-deploy configuration for Vercel, Netlify, and Render

Prerequisites

  • Neon account
  • Node.js 18+ installed locally

Local Development Setup

Clone this repository

Clone this demonstration application and install the dependencies:

git clone https://github.com/neondatabase-labs/neon-auth-demo-app.git

cd neon-auth-demo-app
npm install

Set up Neon Auth

  1. Create or open a Neon project
  2. Go to Neon AuthSetup instructions
  3. Click Set up Auth to generate your configuration
  4. Copy these environment variables to .env.local:
    • NEXT_PUBLIC_STACK_PROJECT_ID
    • NEXT_PUBLIC_STACK_PUBLISHABLE_CLIENT_KEY
    • STACK_SECRET_SERVER_KEY
    • DATABASE_URL

Screenshot of Neon Auth API keys in the console

Set up and run the application

  1. Set up the database:

    npm run drizzle:generate  # Generates migrations
    npm run drizzle:migrate   # Applies migrations
    
  2. Start the development server:

    npm run dev
    
  3. Visit http://localhost:3000 to see the application running (check your console for the actual port if 3000 is in use).

    Screenshot of the Neon Auth demo application showing the todos interface

Production Setup (Important)

Configure production settings in the Neon Console's Auth Configuration tab, such as domain restrictions.

Screenshot of Neon Auth configuration settings

Learn More

Authors

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.