Getting Started
Setup
Get your Pro Next.js Drizzle project up and running in less than 30 minutes.
This guide will walk you through the steps to set up your project locally and start developing.
Step 1: Clone the Repository
Clone the project to your local machine:
Terminal
git clone <your-repo-url> my-saas-app
cd my-saas-appStep 2: Install Dependencies
We use npm for dependency management:
Terminal
npm installStep 3: Database Setup
- Make sure you have PostgreSQL running. We provide a
docker-compose.ymlfor convenience:
Terminal
npm run docker:up- The database is automatically created by Docker Compose. If you're using a local PostgreSQL installation, create the database:
Terminal
createdb database- Update
DATABASE_URLin.envto match your local setup:
.env
# For Docker (default):
DATABASE_URL="postgresql://postgres:password@localhost:5432/database"
# For local PostgreSQL:
DATABASE_URL="postgresql://your_user:your_password@localhost:5432/database"- Run migrations:
Terminal
# Generate and apply migrations:
npm run db:push
# Or if you prefer to use migrations:
npm run db:migrateStep 4: Start Development Server
Terminal
npm run devOpen http://localhost:3000 - your app is running!
Step 5: Create Your First Account
- Go to http://localhost:3000/auth/sign-up
- Enter your name, email and password
- Since email is not configured yet, check the console for the verification link
- Click the link to verify your email
- You're in!
Step 6: Make Yourself an Admin
The first user should be a platform admin to access the admin dashboard (/dashboard/admin).
Option A: Using Drizzle Studio (Recommended)
Terminal
# Open Drizzle Studio
npm run db:studio- Open https://local.drizzle.studio in your browser
- Click on the
usertable - Find your user and click to edit
- Change
rolefromusertoadmin - Save
Option B: Using SQL directly
Terminal
# If using Docker (container name may vary based on directory name):
docker compose exec postgres psql -U postgres -d database
# If using local PostgreSQL:
psql -d database
# Then run:
UPDATE "user" SET role = 'admin' WHERE email = 'your@email.com';
\qNow you can access the admin panel at http://localhost:3000/dashboard/admin.