A production-ready backend API built using Node.js, Express.js, and MongoDB for managing AI/code datasets.
This project provides:
- RESTful APIs
- CRUD Operations
- Authentication using JWT
- Filtering, Searching, Pagination & Sorting
- Aggregation & Analytics APIs
- Middleware-based architecture
- Scalable MVC folder structure
| Technology | Usage |
|---|---|
| Node.js | Backend Runtime |
| Express.js | Web Framework |
| MongoDB | Database |
| Mongoose | ODM |
| JWT | Authentication |
| bcrypt | Password Hashing |
| dotenv | Environment Variables |
| cors | Cross-Origin Requests |
project-root/
│
├── config/
│ └── db.js
│
├── controllers/
│
├── services/
│
├── models/
│
├── routes/
│
├── middlewares/
│
├── utils/
│
├── .env
├── server.js
├── package.json
└── README.md- RESTful API architecture
- MongoDB integration using Mongoose
- MVC architecture
- Modular and scalable backend structure
- Environment variable configuration
| Feature | Status |
|---|---|
| Create Dataset | ✅ |
| Fetch All Datasets | ✅ |
| Fetch Dataset By ID | ✅ |
| Update Dataset | ✅ |
| Delete Dataset | ✅ |
- Filtering
- Searching
- Pagination
- Sorting
- Dynamic query building
- User Registration
- User Login
- JWT Token Generation
- Protected Routes
- Password Hashing using bcrypt
- Authentication Middleware
- Logger Middleware
- Error Handling Middleware
- Rate Limiting Middleware
- Dataset Statistics
- Type Analysis
- Repository Analysis
- Aggregation Pipelines
{
"id": "string",
"instruction": "string",
"input": "string",
"output": "string",
"metadata": {
"type": "string",
"code_element": "string",
"repo_name": "string",
"file_path": "string",
"source_type": "string"
}
}git clone <your-repository-url>cd project-namenpm installCreate a .env file in the root directory:
PORT=3000
MONGODB_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secretnpm run devnpm start| Method | Endpoint | Description |
|---|---|---|
| GET | /datasets |
Fetch all datasets |
| GET | /datasets/:id |
Fetch dataset by ID |
| POST | /datasets |
Create new dataset |
| PATCH | /datasets/:id |
Update dataset |
| DELETE | /datasets/:id |
Delete dataset |
/datasets?type=function/datasets?search=python/datasets?page=1&limit=10/datasets?sort=repo_name| Method | Endpoint | Description |
|---|---|---|
| POST | /auth/register |
Register User |
| POST | /auth/login |
Login User |
| Method | Endpoint | Description |
|---|---|---|
| GET | /analytics/datasets/type-analysis |
Analyze datasets by type |
| GET | /analytics/datasets/repo-analysis |
Analyze repositories |
| Method | Endpoint | Description |
|---|---|---|
| GET | /stats/datasets/count |
Total dataset count |
| GET | /stats/datasets/repos |
Total repositories count |
- JWT Authentication
- Password Hashing
- Protected Routes
- Input Validation
- Global Error Handling
- Rate Limiting
| Middleware | Purpose |
|---|---|
| Authentication Middleware | Protect private routes |
| Logger Middleware | Log incoming requests |
| Error Handling Middleware | Handle application errors |
| Rate Limiting Middleware | Prevent API abuse |
- Schema Validation
- Indexing
- Aggregation Pipeline
- Dynamic Querying
- Pagination
- Projection
- Sorting
API testing was performed using:
- Postman
Postman collection is included in the project.
This project demonstrates understanding of:
- REST API Development
- MongoDB & Mongoose
- MVC Architecture
- Authentication & Authorization
- Middleware System
- Aggregation Framework
- Backend Scalability Concepts
- Error Handling
- API Optimization
- Swagger Documentation
- Redis Caching
- Docker Deployment
- Unit Testing
- CI/CD Integration
Developed as part of the Full Stack Backend Project Assignment – 2026