Rapid Mongo Express Kit: Build Express.js Apps Faster with Pre-Built Modules

Rapid Mongo Express Kit is a ready-to-use boilerplate for building Express.js applications with MongoDB. It includes pre-configured authentication, mail sending, error handling, and other utilities to streamline development and reduce repetitive tasks.
Features
- Authentication using JWT and bcrypt
- MongoDB integration with Mongoose
- Mail sending with Nodemailer
- Error handling middleware
- Environment configuration with dotenv
- CORS support
- Cookie parsing
- Templating with EJS
- API documentation with Swagger
- Data validation with Zod
- Redis support with ioredis
Installation
To create a new project using this kit, run the following commands:
npx rapid-mongo-expresskit my-new-project
cd my-new-project
npm install
npm dev
Project Structure
The project comes with a well-organized folder structure for rapid development:

Create Module with CLI
You can generate a full module (routes, controller, service, model) using the CLI command:
pnpm create-module <module-name>- After running, the boilerplate code will be available under
src/modules/<module-name>folder.
Example Module Model
import { Schema, model } from 'mongoose';
import { IModulename } from './modulename.interface';
const modulenameSchema = new Schema<IModulename>({
email: { type: String, required: true },
name: { type: String, required: true },
phone: { type: String }
});
export const Modulename = model<IModulename>('Modulename', modulenameSchema);
Example Module Interface
export interface IModulename {
name: string;
email: string;
phone?: string;
}
Example Module Validation
import { z } from 'zod';
export const modulenameValidationSchema = z.object({
body: z.object({
email: z.string(),
name: z.string(),
avatar: z.string()
})
});
Example Module Controller
import { RequestHandler } from 'express';
import { sendResponse } from '../../utils/sendResponse';
import { catchAsync } from '../../utils/catchAsync';
import { createModulenameService } from './modulename.service';
export const getAllModulenameController: RequestHandler = catchAsync(async (req, res) => {
const result = await createModulenameService(req.body);
sendResponse(res, {
status: 201,
success: true,
message: 'Successfully created modulename',
data: result
});
});
Example Module Service
import { IModulename } from './modulename.interface';
import { Modulename } from './modulename.model';
export const createModulenameService = async (payload: IModulename) => {
const result = await Modulename.create(payload);
return result;
};
Advanced Queries
You can perform sorting, filtering, and search using the built-in QueryBuilder:
export const getAllModulnameService = async (query: Record<string, unknown>) => {
const moduleQueries = new QueryBuilder(Modulename.find(), query)
.fields()
.filter()
.sort()
.search('search value here');
const result = await moduleQueries.modelQuery;
return result;
};
Conclusion
Rapid Mongo Express Kit provides a comprehensive boilerplate to accelerate Express.js development with MongoDB. With pre-configured modules, easy CLI generation, and support for advanced features like JWT authentication, Redis, and Swagger, developers can focus on building applications rather than repetitive setup tasks. You can visit the NPM package or star the GitHub repository.