Skip to content
/ next-launch-kit Public template

An open source NextJs+PostgreSQL boilerplate with various integrations needed for a Saas.

License

Notifications You must be signed in to change notification settings

TeoMastro/next-launch-kit

Repository files navigation

Next Launch Kit

This is a Next.js project bootstrapped with create-next-app and enhanced with PostgreSQL, Prisma, auth.js, and Docker support.

Tech Stack

Prerequisites

Before you begin, ensure you have the following installed:

Quick Start

  1. Clone the repository

    git clone https://github.com/TeoMastro/next-launch-kit.git
    cd next-launch-kit
  2. Create environment file

    cp .env.example .env
  3. Start the database with Docker

    # Start PostgreSQL and the app
    docker-compose up -d
  4. Install the project locally

    npm i
  5. Push the database schema and seed the database

    # Run database migrations
    npx prisma db push
    
    # Seed the database (optional)
    npm run db:seed
  6. Make sure to register your database on pg admin before continuing to step 5

  7. To run in dev mode

    npm run dev

    Navigate to http://localhost:3000/dashboard and login with the admin user to see the application.

pgAdmin Server Registration

After starting the containers with docker-compose up -d, pgAdmin won't automatically discover your PostgreSQL database. You need to manually register the server connection.

Accessing pgAdmin

  1. Open pgAdmin in your browser at http://localhost:5051
  2. Log in with the credentials:
    • Email: admin@nextlaunchkit.com
    • Password: nextlaunchkit123

Registering the PostgreSQL Server

Once logged into pgAdmin, follow these steps to connect to your PostgreSQL database:

  1. Right-click on "Servers" in the left sidebar

  2. Select "Register" > "Server..." from the context menu

  3. Fill in the General tab:

    • Name: Next Launch Kit DB (or any name you prefer)
    • Server group: Leave as "Servers"
    • Comments: Optional description
  4. Switch to the Connection tab and enter:

    • Host name/address: postgres (use the container name, not localhost)
    • Port: 5432
    • Maintenance database: next_launch_kit
    • Username: postgres
    • Password: password123
  5. Click "Save" to register the server

Demo Accounts

After running the seed script, you can log in with these demo accounts:

  • Admin User:

    • Email: admin@nextlaunchkit.com
    • Password: demoadmin!1
    • Role: ADMIN
  • Regular User:

    • Email: user@nextlaunchkit.com
    • Password: demouser!1
    • Role: USER

To use Google smtp

  1. Make sure 2fa is enabled in your google account.
  2. Go to app passords and generate an app password. Then use it in the SMTP_PASSWORD of your .env

To use Google sign in

  1. Go to Google Cloud Console
  2. Create a project.
  3. Go to Credentials and generate credentials.
  4. Make sure OAuth consent screen is enabled for your project.
  5. For more information check the official documentation of auth.js for Google Provider

package.json scripts

# Generate Prisma client
npm run db:generate

# Create and apply a new migration
npm run db:migrate

# Push schema changes without creating migration files
npm run db:push

# Reset the database (⚠️ This will delete all data)
npm run db:reset

# Seed the database with sample data
npm run db:seed

# Open Prisma Studio (Database GUI)
npm run db:studio

# Deploy migrations to test database
npm run migrate:test

# Reset test database
npm run migrate:test:reset

# Create and apply migration to test database
npm run migrate:test:dev

# Push schema changes to test database
npm run db:push:test

# Format all files
npm run format

# Check formatting without making changes
npm run format:check

Translations sorting

To alphabetically sort translations copy and paste the contents of your messages json file here. Then paste it back in the project file.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

An open source NextJs+PostgreSQL boilerplate with various integrations needed for a Saas.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published