You are reading the docs for CalmAPI 1.x (legacy), which is no longer developed. Run npx calmapi@next doctor in your 1.x project to check it against published advisories, then see Migrating from 1.x or the CalmAPI 2 docs.

CalmAPI Documentation

Production-Ready Modular REST API Framework using NodeJS & MongoDB

CalmAPI Logo


šŸ“š Table of Contents#

  1. Getting Started - Installation and project setup
  2. Understanding the Architecture - Core concepts and structure
  3. Creating Your First Module - Quick start guide to building APIs
  4. Working with Models - Database schema and validation
  5. Controllers Made Easy - Request handling and super methods
  6. Services Layer - Business logic and database operations
  7. Data Transfer Objects (DTOs) - Input validation and response formatting
  8. Routing & Configuration - Custom paths and nested routes
  9. Built-in Modules - Auth, User, Media & Post
  10. Advanced Techniques - Tips, tricks, and best practices
  11. Built in Security & Best Practices - Securing your API
  12. Deployment Guide - From local to production

šŸŽÆ What is CalmAPI?#

CalmAPI is a zero-hidden-magic REST API framework that generates production-ready, modular APIs in seconds. Unlike other frameworks that hide complexity in node_modules, CalmAPI puts everything in your project where you can see it, customize it, and own it.

Key Features#

āœ… Production Ready - Controller, Model & Service oriented architecture
āœ… Lightning Fast - Generate complete CRUD modules with one command
āœ… Built-in Auth - JWT authentication with database token store
āœ… No Hidden Magic - All code is visible and customizable
āœ… Smart Routing - Automatic route generation with nesting support
āœ… DTO Support - Clean data validation and transformation
āœ… File Uploads - AWS S3 integration out of the box
āœ… ESLint Ready - Code quality baked in


⚔ Quick Example#

Create a complete CRUD API in seconds:

Shell
# Generate a module
calmapi generate module product

# That's it! Your API is ready at:
# GET    /api/products
# GET    /api/products/:id
# POST   /api/products
# PUT    /api/products/:id
# DELETE /api/products/:id

šŸ—ļø What Gets Generated?#

Every module includes:

src/modules/product/
ā”œā”€ā”€ product.controller.js  # Request handling
ā”œā”€ā”€ product.service.js     # Business logic
ā”œā”€ā”€ product.model.js       # Database schema
ā”œā”€ā”€ product.route.js       # Route definitions
ā”œā”€ā”€ product.dto.js         # Data validation
└── product.settings.js    # Module configuration

šŸŽ“ Who Is This For?#

  • Beginners who want to learn backend development with a clear structure
  • Teams who need a consistent, maintainable codebase
  • Developers who value transparency over "magic"
  • Startups who need to move fast without sacrificing quality

šŸš€ Ready to Build?#

Start with Getting Started to install CalmAPI and create your first project!


šŸ“– Documentation Philosophy#

This documentation is written for complete beginners. We explain:

  • WHY - Why things work the way they do
  • HOW - Step-by-step instructions
  • WHEN - When to use different features
  • EXAMPLES - Real-world code you can copy and modify

Every concept builds on the previous one. Start from page 1 and go in order for the best learning experience.


šŸ¤ Need Help?#


Let's build something amazing together! šŸŽ‰