A lightweight RESTful API for blog/notes management built with Node.js and Express.js. This project demonstrates clean CRUD operations with a clear separation of concerns between frontend and backend.
- RESTful API Architecture - Implements GET, POST, and DELETE methods
- In-Memory Data Store - Fast and efficient data handling for demonstration
- Validation Middleware - Server-side validation ensures data integrity
- Dynamic UI Updates - Asynchronous frontend interactions without page reloads
- Semantic HTML & CSS - Modern, responsive, and accessible interface
- Clean Code Structure - Separation of concerns with controllers, routes, and middleware
- Backend: Node.js, Express.js v5
- Frontend: Vanilla JavaScript (ES6+), HTML5, CSS3
- Middleware: Custom validation middleware for request handling
├── controllers/
│ └── noteController.js # Business logic for note operations
├── middleware/
│ └── validation.js # Request validation middleware
├── public/
│ ├── app.js # Frontend JavaScript
│ ├── index.html # Main HTML page
│ └── style.css # Styling
├── routes/
│ └── noteRoutes.js # API route definitions
├── server.js # Express server setup
└── package.json # Project dependencies
- Node.js installed (v14 or higher recommended)
- npm or yarn package manager
- Clone the repository
git clone https://github.com/supritkumar007/express-notes-api.git
cd express-notes-api- Install dependencies
npm install- Start the server
node server.jsThe server will start on http://localhost:3000
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/notes | Get all notes |
| POST | /api/notes | Create a new note |
| DELETE | /api/notes/:id | Delete a note by ID |
| GET | /api/status | Health check endpoint |
Create a Note:
POST /api/notes
Content-Type: application/json
{
"title": "My Note Title",
"content": "Note content here..."
}Get All Notes:
GET /api/notesDelete a Note:
DELETE /api/notes/:idThis project was built to demonstrate:
- Request-Response cycle in web development
- RESTful API design principles
- Server-side validation with middleware
- Asynchronous JavaScript with Fetch API
- Clean architecture with separation of concerns
Note: This is a demonstration project using in-memory storage. For production use, integrate a database and add proper authentication.