This is a Next.js project bootstrapped with create-next-app and enhanced with PostgreSQL, Prisma, auth.js, and Docker support.
- Framework: Next.js with the App Router
- Authentication: NextAuth.js with credentials and Google provider
- Styling/UI: TailwindCSS with shadcn/ui components
- Database: PostgreSQL
- ORM: Prisma
- Validation: Zod
- Logs: Winston
- Environment: Docker & Docker Compose
- TypeScript: TypeScript
- Tests: Playwright
Before you begin, ensure you have the following installed:
- Docker
- Docker Compose
- v20.10.0 of Node.js
- nvm if you want to manage node versions by yourself (recommended)
-
Clone the repository
git clone https://github.com/TeoMastro/next-launch-kit.git cd next-launch-kit -
Create environment file
cp .env.example .env
-
Start the database with Docker
# Start PostgreSQL and the app docker-compose up -d -
Install the project locally
npm i
-
Push the database schema and seed the database
# Run database migrations npx prisma db push # Seed the database (optional) npm run db:seed
-
Make sure to register your database on pg admin before continuing to step 5
-
To run in dev mode
npm run dev
Navigate to http://localhost:3000/dashboard and login with the admin user to see the application.
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.
- Open pgAdmin in your browser at http://localhost:5051
- Log in with the credentials:
- Email:
admin@nextlaunchkit.com - Password:
nextlaunchkit123
- Email:
Once logged into pgAdmin, follow these steps to connect to your PostgreSQL database:
-
Right-click on "Servers" in the left sidebar
-
Select "Register" > "Server..." from the context menu
-
Fill in the General tab:
- Name:
Next Launch Kit DB(or any name you prefer) - Server group: Leave as "Servers"
- Comments: Optional description
- Name:
-
Switch to the Connection tab and enter:
- Host name/address:
postgres(use the container name, notlocalhost) - Port:
5432 - Maintenance database:
next_launch_kit - Username:
postgres - Password:
password123
- Host name/address:
-
Click "Save" to register the server
After running the seed script, you can log in with these demo accounts:
-
Admin User:
- Email:
admin@nextlaunchkit.com - Password:
demoadmin!1 - Role: ADMIN
- Email:
-
Regular User:
- Email:
user@nextlaunchkit.com - Password:
demouser!1 - Role: USER
- Email:
- Make sure 2fa is enabled in your google account.
- Go to app passords and generate an app password. Then use it in the SMTP_PASSWORD of your .env
- Go to Google Cloud Console
- Create a project.
- Go to Credentials and generate credentials.
- Make sure OAuth consent screen is enabled for your project.
- For more information check the official documentation of auth.js for Google Provider
# 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:checkTo alphabetically sort translations copy and paste the contents of your messages json file here. Then paste it back in the project file.
This project is licensed under the MIT License - see the LICENSE file for details.