Skip to content

A simple and beginner-friendly Notes API built with Node.js, Express, and MongoDB. It allows users to create, update, delete, and search notes efficiently, with clean endpoints and MongoDB integration.

Notifications You must be signed in to change notification settings

Jerrwin/Node-Notes-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📝 Notes API

Node.js Express MongoDB Mongoose Postman

A simple, clean and fully functional Notes REST API built with Node.js, Express, and MongoDB (Mongoose).
Perfect for learning backend development or integrating into your full-stack projects.

Test all endpoints easily with Postman, Thunder Client, or any API client.


✨ Features

  • Create a new note
  • Get all notes
  • Get a single note by ID
  • Update a note (Partial update using PATCH)
  • Delete a note
  • Search notes by title (case-insensitive)
  • Automatic createdAt & updatedAt timestamps

🛠 Tech Stack

  • Node.js
  • Express.js
  • MongoDB
  • Mongoose
  • dotenv

📁 Folder Structure

project/
 ├── controllers/
 │     └── noteController.js
 ├── models/
 │     └── noteModel.js
 ├── routes/
 │     └── noteRoutes.js
 ├── config/
 │     └── db.js
 ├── index.js
 ├── .env
 └── package.json

📥 Installation

  1. Clone the repository
    git clone https://github.com/Jerrwin/Node-Notes-API.git
    cd Node-Notes-API
  2. Install dependencies
    npm install
  3. Create a .env file in the root directory
    MONGO_URI=your_mongodb_connection_string_here
    PORT=5000
  4. Start the server
    npm run dev
    Server runs at → http://localhost:5000

📌 API Endpoints

Method Endpoint Description
POST /notes/add Create a new note
GET /notes/getAll Get all notes
GET /notes/search?title=xyz Search notes by title (case-insensitive)
PATCH /notes/update/:id Update a note (partial update)
DELETE /notes/delete/:id Delete a note

Example Request (POST /notes)

{
  "title": "My First Note",
  "content": "This is important!",
  "tags": ["work", "urgent"]
}

🤝 Contributing

Feel free to fork this repository and submit pull requests.
This project is beginner-friendly and open for improvements.

About

A simple and beginner-friendly Notes API built with Node.js, Express, and MongoDB. It allows users to create, update, delete, and search notes efficiently, with clean endpoints and MongoDB integration.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published