A robust starter template for Nest.js applications with pre-configured essential modules and security features.
P.S: this is opinionated and may not fit all use cases, but it's a good starting point that you can customize.
- Built-in authentication system
- Role-based access control (ADMIN, SELLER, CLIENT)
- API Key protection
- Guards implementation for security
- User registration and authentication
- Password reset functionality
- Role management
- Profile image handling
- Image upload and storage
- Image URL management
- Built-in Image module
- Email service integration
- Password reset email functionality
- Email module for communication
- Prisma ORM integration
- MySQL database support
- Pre-configured schema with:
- User management
- Image storage
- Password reset tokens
- API Key Guard
- Authentication Guard
- Roles Guard
- Password hashing
- Token-based authentication
The starter kit includes a Prisma schema with the following models:
- User (with role-based access)
- Image
- PasswordResetToken
- Clone the repository
- Install dependencies:
npm install
-
Set up your environment variables:
- Create a
.env
file - Add your
DATABASE_URL
- Create a
-
Run database migrations:
npx prisma migrate dev
- Start the application:
npm run start:dev
Make sure to set up the following environment variables:
DATABASE_URL
: Your MySQL database connection string- Other configuration variables as needed
Feel free to submit issues and pull requests.
MIT