This is a robust template for Next.js 15 projects, pre-configured with a modern development stack to ensure productivity, code quality, and scalability. It includes tools for databases, testing, component documentation, and much more.
- Framework: Next.js 15
- Language: TypeScript
- Styling: Tailwind CSS
- Database: PostgreSQL with Prisma ORM
- Containerization: Docker
- Testing: Jest & Testing Library
- Component Documentation: Storybook
- Code Quality: ESLint & Prettier
- Standardized Commits: Commitizen, Commitlint & Husky
This project has multiple branches to showcase different database configurations:
master: The main branch, configured with Prisma ORM.Aleydon: A development branch, also configured with Prisma ORM.Drizzle: This branch is configured with Drizzle ORM.
-
Clone the repository:
git clone https://github.com/Aleydon/Next15.git
-
Navigate to the project directory:
cd Next15 -
Install dependencies:
npm install
-
Set up environment variables:
- Rename the
enviroment-example.envfile to.env. - Fill in the required environment variables in the
.envfile.
- Rename the
-
Start the Docker environment:
- This command will build and start the PostgreSQL container.
npm run docker:start
-
Run the database migrations:
- This command will create the database tables based on your Prisma schema.
npm run prisma:migrate
-
Start the development server:
npm run dev
| Script | Description |
|---|---|
dev |
Starts the Next.js development server. |
build |
Builds the application for production. |
start |
Starts a production server. |
lint |
Runs ESLint to analyze and fix the code. |
docker:start |
Starts the services defined in docker-compose.yml. |
prisma:migrate |
Runs Prisma migrations to update the database. |
prisma:generate |
Generates the Prisma Client based on your schema. |
prisma:studio |
Opens Prisma Studio to view and edit your data. |
test |
Runs the unit and integration tests. |
test:watch |
Runs the tests in watch mode. |
commit |
Starts the Commitizen assistant to create standardized commits. |
storybook |
Starts Storybook to view and develop components. |
build-storybook |
Builds Storybook for production. |
The development environment uses Docker to manage the PostgreSQL database.
- Start the container:
This command will build and start the database container in the background.
npm run docker:start
Prisma is used as an ORM to interact with the database.
-
Apply migrations:
npm run prisma:migrate
Creates and applies migrations to the database based on
schema.prisma. -
Generate Prisma Client:
npm run prisma:generate
Generates or updates the Prisma Client whenever
schema.prismais modified. -
Open Prisma Studio:
npm run prisma:studio
Opens a visual interface in the browser to view and manage the database data.
This project uses Jest and Testing Library for testing.
- To run the tests, execute:
npm run test - To run the tests in watch mode:
npm run test:watch
A test example can be found in src/app/page.spec.tsx.
Visualize and develop your components in isolation with Storybook.
- To start Storybook:
npm run storybook
A story example can be found in src/app/components/Text/text.stories.tsx.

