Welcome to the ultimate, production-grade GitHub Datasets workspace! This repository contains a premium, highly optimized Node.js / Express MVC backend powered by a remote MongoDB cluster containing over 115,011 dataset records and built using a strict, modern 15-Pull Request Git/GitHub workflow.
Note
All core and "Good to Have" backend requirements are 100% complete, programmatically tested, and fully optimized.
The workspace is organized into a modular monolithic architecture, dividing backend logic and configurations cleanly:
github_dataset_nitish_kumar/
├── backend/ # 🚀 Core Node.js / Express MVC API codebase
│ ├── src/
│ │ ├── config/ # MongoDB connection handlers and listeners
│ │ ├── controllers/ # Controller layer (CRUD, Analytics, Stats, Auth, Utils)
│ │ ├── middlewares/ # Rate limiting, Auth protection, and Error interceptors
│ │ ├── models/ # Mongoose schemas (Dataset & User Models)
│ │ ├── routes/ # Route routing layer mapping endpoints
│ │ ├── scripts/ # Programmatic endpoint verification test suites
│ │ └── utils/ # Query builders, pagination, and unified error classes
│ ├── README.md # Detailed backend installation and setup guide
│ └── postman_collection.json # Exhaustive Postman workspace collection (250+ endpoints)
├── assginmentRule.md # Project specification checklist
├── routes.md # Pre-mapped system routing catalog
└── README.md # 🌟 Main repository entrypoint (this file)
We built this project around 10 production-grade architectural patterns:
- API Response Standardization: All controllers return standardized JSON structures
{ success: true, message, results, data }. - Centralized Async Wrappers: Removed messy try-catch blocks using reusable async handler wrappers.
- Global Exception Mapping: Custom middleware translates Mongoose validations, CastErrors, and JWT anomalies into clear REST responses.
- Soft Delete System: Implemented safe, non-destructive record deletions utilizing
isDeletedquery filters. - Pre-Save Bcrypt Encryption: Cryptographically hashes and secures user accounts prior to MongoDB saves.
- JWT Token Lifecycle Management: Full authorization token generation, validation, refresh, and secure blacklist revocation.
- Custom Endpoint Rate Limiting: Deployed route-specific flood protections (brute-force login blocks, search queries throttlers).
- Dynamic MongoDB Query Builder: Converts query parameters dynamically into MongoDB-compatible compound operators.
- Performance-Tuned Aggregations: Constructs fast aggregation metrics
$match,$group,$sortpipeline streams. - HTTP HEAD / OPTIONS Handshakes: Direct preflight pre-allocation and rapid X-Total-Count header polling support.
The backend is connected out-of-the-box to our production MongoDB cluster:
- Host:
ac-tebhsg0-shard-00-02.q17d6sn.mongodb.net - Target Database:
githubDataSetDB - Main Collection:
datasets(~115,011 highly indexed documents)
To launch the backend API server locally, run the following commands:
cd backend
npm installCreate a .env file in the backend/ directory:
PORT=5000
NODE_ENV=development
MONGO_URI=mongodb+srv://assignment:assignment12@cluster0.q17d6sn.mongodb.net/githubDataSetDB
JWT_SECRET=super-secure-jwt-key-2026-nitish-kumar
JWT_EXPIRES_IN=90dnpm run devValidate all 250+ routes automatically:
node src/scripts/test-pr14.jsWe have exported a complete Postman Collection containing pre-configured request payloads and authorization blocks:
- Locate postman_collection.json.
- Import the file directly into your Postman app.
- Setup variables
base_urltohttp://localhost:5000/api/v1and perform instant pings!