Welcome to NestXcelerator, a powerful and flexible NestJS starter template designed to kickstart your backend monolith projects. NestXcelerator provides a solid foundation equipped with all the essential features and best practices to ensure scalability, maintainability, and developer happiness.
Note
Internal Developer Platforms (IDPs) are tools that help teams within a company build and manage software more easily. Think of them as a one-stop shop for developers, providing everything they need to write, test, and deploy their applications. IDPs automate many tasks, making it faster and simpler for developers to work without getting bogged down in complicated processes. This boosts productivity and helps teams deliver better software more consistently.
The concept of internal developer platform (IDP) is something I am really interested in for a while. This projects is meant to server as template for an IDP I'm building. This template project will be used in the IDP to quickly kickstart backend projects with sensible defaults and best practices thus boosting developer productivity.
- Typescript: Offers type safety when building backend APIs in nodejs
- NestJs: Provides best in class developer experience building backend APIs using nodejs
- Prisma: Database ORM
- ts-rest: Provides excellent developer experience by empowering you to build fuly type safe API endpoints utilizing api contracts
- Postgres: a powerful, open source object-relational database system with over 35 years of active development that has earned it a strong reputation for reliability, feature robustness, and performance.
- React Email: For building email templates
- Resend: For sending emails
Install all dependencies
npm install
In order for the authentication endpoints to work, generate public/private key pair which will be used for generating and verifying JWTs.
# Generate private key using P-256 curve
openssl ecparam -genkey -name prime256v1 -noout -out ec-private.pem
# Generate corresponding public key
openssl ec -in ec-private.pem -pubout -out ec-public.pem
General
- API
- Health check endpoints checking HTTP, memory health (rss and heap) and prisma database connection
- Open API spec v3 support and UI using swagger
- Typesafe API contract
- Client SDK supporting
fetch
andreact-query
- Email integration
- Email template support using
react-email
- Email service integration:
- Resend
- SendGrid
- MailGun
- AWS SES
- Email template support using
- File upload using uploadthing
Database
- Database support
- Postgres
- MySQL
- ORM
- Prisma
- Drizzle
Security
- JWT based authentication.
accessToken
is secured by usingES256
hashing via private public key pair. (ES256
is an Elliptic Curve Digital Signature Algorithm (ECDSA) that uses the P-256 curve and SHA-256 hash function.) - Authentication guard verifying JWT expiration, issuer and audience for maximum security
- Authorization guard that implements Role Based Access Conrtol (RBAC)
- Securely stored password hashed using Blowfish cipher hashing algorithim.
- Issued refresh token is unique to the device and is stored securely
- Refresh token functionality while revoking used refresh token for one time use refresh tokens.
- Active session management including revokation.
- Rate limitter integration. Configured for:
- Email verification endpoint
- Password resent endpoint
- Password reset functionality
Deployment
- Production ready dockerfile
- Multi stage build for small docker image
- Health check mechanisim for monitoring
- CI/CD
This project is licensed under the MIT License. See the LICENSE file for details.
We welcome contributions! Please fork the repository, create a feature branch, and submit a pull request.
This module is maintained by Endalkachew Biruk.