Welcome to my backend projects collection built with Node.js, Express, and MongoDB (Mongoose) following the clean MVC (Model-View-Controller) pattern. This repository showcases a step-by-step progress from basic CRUD services to advanced pagination, dynamic sorting, and case-insensitive regex search engines.
| Project Folder | Assignment | Key Highlights | Links & Docs |
|---|---|---|---|
6.1-notes-crud-assignment |
Assignment 01 | Basic CRUD, bulk endpoints, Mongoose schema validations, status code management. | 📖 Postman Docs 🌐 Live Deployed API |
06.2-advanced-routing-queries-assignment |
Assignment 02 | Route parameters, dynamic query filters, pagination metadata, custom sorting fields. | 📖 Postman Docs 🌐 Live Deployed API |
06.3-search-assignment |
Assignment 03 | Text search via MongoDB $regex, dual/triple concepts merge, Master Query Builder. |
📖 Postman Docs 🌐 Live Deployed API |
- Objective: Implement a solid backend CRUD foundation from scratch.
- Key Features:
- Create, read, update, replace, and delete notes.
- Supports bulk creation (
POST /api/notes/bulk) and bulk deletion (DELETE /api/notes/bulk). - Implements custom Mongoose validation for title and content fields.
- Returns standard API response payloads in JSON format.
- Objective: Learn dynamic route variables and backend query parameters.
- Key Features:
- Dynamic route parameter path routing:
/api/notes/category/:categoryand/api/notes/status/:isPinned. - Exclude fields from JSON payloads using MongoDB projection:
/api/notes/:id/summary. - Pagination offset calculations:
(page - 1) * limitwith detailed metadata block (totalPages, hasNextPage, total records count). - Dynamic column sorting (
asc/desc) using validation logic to block invalid sort params.
- Dynamic route parameter path routing:
- Objective: Combine multiple queries, sorting, pagination, and text search into production-level endpoints.
- Key Features:
- Case-insensitive regex text search across titles, content, or both using MongoDB
$orlogic. - Merged logic endpoints (e.g. search + paginate, filter + sort + paginate) that safely combine query parameters before querying the database.
- Master Query Endpoint (
GET /api/notes/query): A single request handler supporting optional search keywords (q), category filters, pinning flags, dynamic sorting fields, and pagination limits simultaneously.
- Case-insensitive regex text search across titles, content, or both using MongoDB
To boot any of the assignments locally:
- Clone the repository and navigate into the target folder:
git clone https://github.com/Raushankumar0720/backend-projects.git cd backend-projects/<folder-name>
- Install npm packages:
npm install
- Setup env variables:
Create a
.envfile in the folder root:MONGO_URI=your_mongodb_connection_string PORT=5000
- Run server in development mode:
npm run dev