Follow this comprehensive guide to set up your SaaS application from scratch to production-ready.
git clone https://github.com/Abellybaba/saas-better-auth-nextjs-polar-starterkit.git my-saas-app
cd my-saas-app
yarn installCreate a basic .env file with your database URL:
# Copy the example file
cp .env.example .env
# Edit .env and add your database URL
POSTGRES_DATABASE_URL="postgresql://username:password@localhost:5432/your_database"
BETTER_AUTH_SECRET="your-32-character-random-string"
BETTER_AUTH_URL="http://localhost:3000"yarn dev
# Navigate to http://localhost:3000/setupVerify connection, run migrations, seed initial data
Create your first admin user with secure credentials
Choose provider, configure settings, enable analytics
Review configuration and access your SaaS dashboard
brew install postgresql
brew services start postgresql
createdb my_saas_appsudo apt-get install postgresql postgresql-contrib
sudo -u postgres createdb my_saas_app