Automate the creation of a well-structured Model-View-Controller (MVC) pattern for your Node.js projects with ease. Servitect is designed to help developers quickly scaffold a project, follow best practices, and integrate various functionalities with minimal setup.
Servitect is designed to simplify and accelerate the server development process by automating the setup of essential components for a modern backend. Here's why you should choose Servitect:
-
ποΈ Speedy Development: Perfect for hackathons and rapid prototyping, Servitect allows you to set up a fully functional server in minutes, letting you focus on building unique features and meeting tight deadlines rather than getting stuck in setup.
-
ποΈ MongoDB Integration: With built-in support for MongoDB, Servitect is ideal for modern applications that need a flexible and scalable NoSQL database.
-
βοΈ Customizable: Servitect's menu-driven approach allows you to pick and choose the features you need, giving you flexibility while still automating repetitive tasks.
-
π€ AI-Ready: Built-in support for Large Language Models (LLMs) with LangChain integration for modern AI-powered applications.
Servitect streamlines the backend creation process, allowing developers to focus on building what matters most. Whether you're a beginner or an experienced developer, Servitect provides the tools you need to jumpstart your server development!
Servitect comes with a variety of built-in features that streamline the development process:
- Automatically generates a standard Model-Controller folder structure.
- Creates the directories and files for:
- Models: MongoDB Schema definitions and database models.
- Controllers: Handles logic and data flow between models and views.
- Routes: Defines CRUD endpoints.
- Helper: Utility functions and middleware.
- Constants: Application constants and messages.
- Comes with pre-configured global error-handling mechanisms.
- Implements best practices for middleware and request validation.
- Follows scalable design patterns to ensure maintainability even as your application grows.
- Built-in try-catch wrapper for async route handlers.
- Provides complete authentication system with JWT tokens.
- Actor-based authentication system for users, admins, and custom roles.
- Secure password hashing with bcryptjs.
- Token verification middleware for protected routes.
- Session management with configurable token expiration.
- Quickly generate Create, Read, Update, Delete (CRUD) APIs for any entity.
- Support for both Actor models (with authentication) and Entity models.
- Consistent API response format with success/error handling.
- Automatic route registration and controller generation.
- Complete file upload system with Cloudinary integration.
- Support for single file, multiple files, and field-specific uploads.
- Automatic local file cleanup after cloud upload.
- Built-in file deletion capabilities from Cloudinary.
- Multer middleware for handling multipart/form-data.
- Integrates with WhatsApp Cloud API for sending notifications.
- Template-based message sending system.
- Easy configuration with access tokens.
- Perfect for automated notifications and alerts.
- Complete Firebase FCM setup for push notifications.
- Support for sending notifications to individual devices.
- Topic-based messaging for broadcasting to multiple users.
- Batch notifications for sending to multiple FCM tokens.
- Multi-topic notification support with condition-based targeting.
- Full email functionality with NodeMailer.
- Gmail SMTP configuration out of the box.
- HTML email support for rich content.
- Environment-based configuration for security.
- Ready-to-use real-time chat system.
- MongoDB-based chat storage with message history.
- APIs for sending messages and retrieving conversations.
- Support for one-on-one conversations with message threading.
- Timestamp tracking and sender identification.
- Pre-configured Docker setup for containerization.
- Production-ready Dockerfile with Node.js best practices.
- Easy deployment with container orchestration support.
- Development and production environment configurations.
- Ollama Integration: Local LLM deployment with conversation memory.
- LangChain Framework: Advanced prompt engineering and chain operations.
- Session-based conversation history for contextual responses.
- Customizable system prompts and model configurations.
- Support for multiple LLM models through Ollama.
Install Servitect globally using npm:
npm install -g servitectFor Linux and Mac users:
sudo npm install -g servitectAfter installation, you can create a new MVC project by running:
servitectFollow the interactive Menu to configure your project with the features you need.
-
Install Servitect globally:
npm install -g servitect
-
Run the CLI tool:
servitect
-
Select your project directory and provide a project name when prompted.
-
Choose "Initialize MVC" from the menu to create the basic structure.
-
Add additional modules as needed:
- Actor Models (Users, Admins, etc.)
- Entity Models (Products, Orders, etc.)
- Chat Module
- File Upload Module
- Firebase FCM
- WhatsApp Integration
- NodeMailer
- Docker Setup
- LLM Integration
-
Navigate to your project and start the server:
cd your-project-name npm run server -
Test your APIs - if you see
Connectedin the console, your APIs are ready!
Here's an overview of the generated project structure:
my-project/
β
βββ models/ # Database models
β βββ User.js # Example actor model
β βββ Product.js # Example entity model
β
βββ controllers/ # Business logic
β βββ userController.js
β βββ productController.js
β βββ chatController.js
β βββ uploadController.js
β βββ firebaseController.js
β
βββ routes/ # API routes
β βββ router.js # Main router
β βββ userRoutes.js
β βββ productRoutes.js
β βββ chatRoutes.js
β βββ fileUploadRoutes.js
β βββ firebaseRoutes.js
β
βββ helper/ # Utility functions
β βββ JsonResponse.js # Standardized API responses
β βββ JWTAuthHelper.js # JWT authentication
β βββ TryCatch.js # Error handling wrapper
β βββ cloudinary.js # File upload utilities
β βββ LlmHelperOllama.js # LLM integration
β βββ Nodemailer.js # Email utilities
β βββ WhatsappNotification.js # WhatsApp messaging
β
βββ constants/ # Application constants
β βββ Message.js # Response messages
β
βββ middleware/ # Express middleware
β βββ multer.js # File upload middleware
β
βββ public/ # Static files
β βββ uploads/ # Temporary file storage
β
βββ .env # Environment variables
βββ .gitignore # Git ignore rules
βββ package.json # Dependencies and scripts
βββ app.js # Express application setup
βββ db.js # Database connection
βββ Dockerfile # Docker configuration
βββ firebase-key.json # Firebase service account key
To enable file uploads with Cloudinary:
- Sign up for a Cloudinary account
- Get your Cloud Name, API Key, and API Secret from the dashboard
- When prompted by Servitect, enter these credentials or add them to
.envlater:CLOUDINARY_CLOUD_NAME=your_cloud_name CLOUDINARY_API_KEY=your_api_key CLOUDINARY_API_SECRET=your_api_secret
To use Firebase Cloud Messaging:
- Create a Firebase project in the Firebase Console
- Go to Settings β Cloud Messaging and enable it
- Go to Service Accounts β Generate Private Key
- Save the downloaded JSON file as
firebase-key.jsonin your project root - Add to
.env:GOOGLE_APPLICATION_CREDENTIALS="firebase-key.json"
To use WhatsApp Cloud API:
- Follow the Meta WhatsApp Business API documentation
- Get your access token and phone number ID
- Add to
.env:WHATSAPP_URL="https://graph.facebook.com/v18.0/YOUR_PHONE_NUMBER_ID/messages" WHATSAPP_ACCESS_TOKEN=your_access_token
For email functionality:
- Use a Gmail account with App Password (recommended)
- Add to
.env:NODEMAILER_ADMIN_EMAIL=your_email@gmail.com NODEMAILER_ADMIN_PASSWORD=your_app_password
For AI integration:
- Install Ollama locally
- Pull a model (e.g.,
ollama pull llama3.1) - Ensure Ollama is running on
http://localhost:11434 - The LLM helper is pre-configured and ready to use
POST /user/register # User registration
POST /user/login # User login
GET /user/get-by-id/:id # Get user by ID (protected)
POST /fileUpload/uploadSingleFile # Upload single file
POST /fileUpload/uploadMultipleFiles # Upload multiple files
POST /fileUpload/deleteSingleFile # Delete file from Cloudinary
POST /chat/send-chat # Send a message
GET /chat/get-my-chat/:id/:contactId # Get conversation history
POST /firebase/sendNotificationToCustomDevice # Send to specific device
POST /firebase/sendNotificationToTopic/:topic # Send to topic subscribers
POST /firebase/sendBatchNotificationsMultipleFCMS # Batch send to multiple devices
POST /llm/ask-llm # Send prompt to LLM and get response
- JWT Authentication: Secure token-based authentication
- Password Hashing: bcryptjs for secure password storage
- CORS Protection: Cross-origin request handling
- Environment Variables: Sensitive data protection
- Input Validation: Request data validation and sanitization
- Error Handling: Comprehensive error management without exposing sensitive info
npm run server # Start development server with nodemon
npm run watch # Alternative development commandIf you are just starting your journey in server development or find certain concepts challenging, we have resources to assist you:
- YouTube Tutorials: Visit our YouTube channel for comprehensive tutorials
- In-Depth Documentation: Detailed documentation covering features, commands, and best practices
- Community Support: Connect with us on LinkedIn for support and questions:
Contributions, issues, and feature requests are welcome! Feel free to check the issues page.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- π― 1000+ weekly downloads on npm
- β Growing GitHub stars
- π Production-ready code generation
- π§ 10+ integrated modules and features
This project is MIT licensed.
- Thanks to all contributors who have helped shape Servitect
- Inspired by the need for rapid, scalable server development in the Node.js ecosystem
- Built with modern development practices and industry standards
- NPM Package: https://www.npmjs.com/package/servitect
- GitHub Repository: https://github.com/kushkapadia/MVCGenerator
- YouTube Channel: CodeGenieKush
Made with β€οΈ by Elite Coders
Server + Architect = Servitect - Your one-click solution for Node.js MVC backend development!

