Overview:
The NEXTjs Boilerplate is a project template for building web applications using Next.js 13. It includes several key features such as TypeScript, Tailwind CSS, DaisyUI, Prisma, and Postgres, React Query. It also provides functionality for login, user management, user roles, user permissions, user profile, forgot password, reset password, and nodemailer.
Features:
- TypeScript: Next.js 13 app using TypeScript for improved static typing and increased code safety.
- Tailwind CSS: Utilizes Tailwind CSS for quick and easy styling customization.
- DaisyUI: Includes DaisyUI, a utility-first CSS framework for rapid UI development.
- Prisma: Uses Prisma, a modern database toolkit, for efficient and type-safe database access.
- Postgres: Integrates with Postgres as the database management system.
- React Query: Incorporates React Query for managing asynchronous data fetching and caching.
- User Management: Provides features for managing user accounts, including login, user roles, and user permissions.
- Forgot/Reset Password: Includes functionality for users to reset their passwords if they forget them.
- Nodemailer: Uses Nodemailer for sending emails, such as password reset emails.
Installation:
To use this boilerplate, follow these steps:
- Clone the repository to your local machine.
- Install the project dependencies by running the command
npm install. - Create a
.env.localfile in the root directory of the project. - In the
.env.localfile, define the following variables:
DB_USER=your_postgres_user
DB_PASSWORD=your_postgres_password
DB_NAME=your_database_name
SMTP_HOST=your_smtp_host
SMTP_USER=your_smtp_user
SMTP_PASSWORD=your_smtp_password
Make sure to replace the placeholder values with your own Postgres credentials, as well as your SMTP credentials.
- Create a migration for the
nanoidfunction by running the commandnpx prisma migrate create --name nanoid. - Open the file created by the migration and paste the
nanoidfunction into it. - Run the migration by executing
npx prisma migrate dev. - Start the development server by running the command
npm run dev.
To seed data, make a GET request to http://localhost:3000/api/seeds?secret=ts&option=reset in your browser or using a tool like Postman. This will create default user roles and permissions and create a default admin user with the email info@ahmedibra.com and password 123456.
Summary:
The NEXTjs Boilerplate is a complete project template for building web applications with Next.js 13. It offers a range of features including TypeScript, Tailwind CSS, DaisyUI, Prisma, and Postgres, React Query. Users can easily set up a development environment by cloning the repository and following the installation instructions. The boilerplate provides functionality for user management, password reset, and email sending using Nodemailer. Contributions to the project are also welcome. The boilerplate is licensed under the MIT License.