NoteNest API is a robust, scalable backend solution designed specifically for students and educators to manage tutorials, notes, and educational content. Built with industry-standard technologies, this API provides a solid foundation for building educational applications and learning management systems.
- 🔧 Full CRUD Operations - Complete Create, Read, Update, Delete functionality for tutorials and notes
- 🚀 RESTful Architecture - Clean, intuitive REST API endpoints following best practices
- 🗄️ MongoDB Integration - Robust database operations with Mongoose ODM for data modeling
- 🌐 CORS Support - Cross-origin resource sharing enabled for frontend integration
- 🏗️ Modular Design - Well-organized, maintainable code structure
- 📊 Search & Filter - Advanced querying capabilities with MongoDB aggregation
- 🔍 Published/Unpublished States - Content management with publication status
- ⚡ High Performance - Optimized database queries and efficient data handling
- Learning Backend Development - Understand REST APIs, database design, and server architecture
- Portfolio Project - Showcase your full-stack development skills
- Real-world Experience - Work with production-ready technologies
- Scalable Foundation - Easy to extend and customize for your needs
| Component | Technology | Version | Purpose |
|---|---|---|---|
| Runtime | Node.js | Latest LTS | JavaScript runtime environment |
| Framework | Express.js | 4.18.2+ | Web application framework |
| Database | MongoDB | Latest | NoSQL document database |
| ODM | Mongoose | 6.11.1+ | MongoDB object modeling |
| CORS | cors | 2.8.5+ | Cross-origin resource sharing |
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Client App │ │ NoteNest API │ │ MongoDB │
│ (Frontend) │◄──►│ (Backend) │◄──►│ (Database) │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│
┌─────────────────┐
│ Express.js │
│ Server │
└─────────────────┘
| Method | Endpoint | Description | Request Body | Response |
|---|---|---|---|---|
GET |
/api/tutorials |
Get all tutorials | - | Array of tutorials |
GET |
/api/tutorials/:id |
Get tutorial by ID | - | Single tutorial |
POST |
/api/tutorials |
Create new tutorial | {title, description, published} |
Created tutorial |
PUT |
/api/tutorials/:id |
Update tutorial | {title, description, published} |
Success message |
DELETE |
/api/tutorials/:id |
Delete tutorial | - | Success message |
DELETE |
/api/tutorials |
Delete all tutorials | - | Success message |
GET |
/api/tutorials/published |
Get published tutorials | - | Array of published tutorials |
GET |
/api/tutorials?title=[keyword] |
Search tutorials by title | - | Filtered tutorials |
POST /api/tutorials
Content-Type: application/json
{
"title": "Introduction to Node.js",
"description": "Learn the basics of Node.js development",
"published": true
}{
"id": "507f1f77bcf86cd799439011",
"title": "Introduction to Node.js",
"description": "Learn the basics of Node.js development",
"published": true,
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-15T10:30:00.000Z"
}Before you begin, ensure you have the following installed:
- Node.js (v14.0.0 or higher)
- npm (v6.0.0 or higher)
- MongoDB (v4.4.0 or higher)
- Git (for cloning the repository)
-
Clone the Repository
git clone https://github.com/YUKII2K3/-NoteNest-API.git cd -NoteNest-API -
Install Dependencies
npm install
-
Configure Database
- Ensure MongoDB is running on your system
- The application will automatically connect to
mongodb://0.0.0.0:27017/notenest_db
-
Start the Server
npm start
-
Verify Installation
- Open your browser and navigate to
http://localhost:8080 - You should see:
{"message": "Welcome to NoteNest API."}
- Open your browser and navigate to
You can test the API endpoints using tools like:
- Postman - API development and testing
- cURL - Command-line HTTP client
- Thunder Client - VS Code extension for API testing
# Get all tutorials
curl -X GET http://localhost:8080/api/tutorials
# Create a new tutorial
curl -X POST http://localhost:8080/api/tutorials \
-H "Content-Type: application/json" \
-d '{"title":"My First Tutorial","description":"This is a test tutorial","published":true}'
# Get tutorial by ID (replace with actual ID)
curl -X GET http://localhost:8080/api/tutorials/507f1f77bcf86cd799439011notenest-api/
├── 📁 app/
│ ├── 📁 config/
│ │ └── 📄 db.config.js # Database configuration
│ ├── 📁 controllers/
│ │ └── 📄 tutorial.controller.js # Business logic for tutorials
│ ├── 📁 models/
│ │ ├── 📄 index.js # Database connection setup
│ │ └── 📄 tutorial.model.js # Tutorial data model
│ └── 📁 routes/
│ └── 📄 turorial.routes.js # API route definitions
├── 📄 server.js # Main application entry point
├── 📄 package.json # Project dependencies and scripts
├── 📄 .gitignore # Git ignore rules
└── 📄 README.md # Project documentation
server.js- Application entry point, middleware setup, and server configurationapp/config/- Configuration files for database and other servicesapp/controllers/- Business logic and request handlingapp/models/- Database models and schema definitionsapp/routes/- API route definitions and endpoint mapping
This project is designed to help you master:
- RESTful API Design - Learn to create clean, intuitive APIs
- Database Modeling - Understand MongoDB schema design with Mongoose
- Server Architecture - Build scalable Node.js applications
- Error Handling - Implement robust error management
- Node.js & Express.js - Modern JavaScript backend development
- MongoDB & Mongoose - NoSQL database operations
- API Development - RESTful service creation
- Code Organization - Modular, maintainable code structure
- MVC Pattern - Model-View-Controller architecture
- Middleware Usage - Request processing and validation
- Database Operations - Efficient querying and data manipulation
- Project Structure - Professional code organization
Create a .env file in the root directory for environment-specific configuration:
PORT=8080
MONGODB_URI=mongodb://0.0.0.0:27017/notenest_db
NODE_ENV=developmentThe application connects to MongoDB with the following default settings:
- Host:
0.0.0.0 - Port:
27017 - Database:
notenest_db
You can modify these settings in app/config/db.config.js.
Test the API endpoints using the provided examples or your preferred API testing tool.
To add automated testing to this project:
-
Install testing dependencies:
npm install --save-dev jest supertest
-
Add test scripts to
package.json:{ "scripts": { "test": "jest", "test:watch": "jest --watch" } } -
Create test files in a
tests/directory
npm start-
Environment Setup
export NODE_ENV=production export PORT=3000
-
Process Management
# Using PM2 npm install -g pm2 pm2 start server.js --name "notenest-api"
-
Docker Deployment
FROM node:16-alpine WORKDIR /app COPY package*.json ./ RUN npm install COPY . . EXPOSE 8080 CMD ["npm", "start"]
We welcome contributions from the community! Here's how you can help:
- Use the GitHub issue tracker
- Provide detailed bug reports with steps to reproduce
- Include your environment details (OS, Node.js version, etc.)
- Open a feature request issue
- Describe the use case and expected behavior
- Consider the impact on existing functionality
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow existing code formatting
- Add comments for complex logic
- Write meaningful commit messages
- Include tests for new features
- Postman - API testing
- MongoDB Compass - Database GUI
- VS Code - Code editor
This project is licensed under the ISC License - see the LICENSE file for details.
Yuktheshwar - GitHub Profile
- GitHub: @YUKII2K3
- Email: [email protected]
- LinkedIn: https://www.linkedin.com/in/yuktheshwar-mp
- Express.js Team - For the amazing web framework
- MongoDB Team - For the powerful NoSQL database
- Mongoose Team - For the elegant ODM library
- Node.js Community - For the vibrant ecosystem
⭐ Star this repository if you found it helpful!
🔄 Fork it to create your own version!
🐛 Report issues to help improve the project!