Skip to content

supritkumar007/express-notes-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Express Notes API

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.

Features

  • 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

Tech Stack

  • Backend: Node.js, Express.js v5
  • Frontend: Vanilla JavaScript (ES6+), HTML5, CSS3
  • Middleware: Custom validation middleware for request handling

Project Structure

├── 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

Getting Started

Prerequisites

  • Node.js installed (v14 or higher recommended)
  • npm or yarn package manager

Installation

  1. Clone the repository
git clone https://github.com/supritkumar007/express-notes-api.git
cd express-notes-api
  1. Install dependencies
npm install
  1. Start the server
node server.js

The server will start on http://localhost:3000

API Endpoints

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

Example Usage

Create a Note:

POST /api/notes
Content-Type: application/json

{
  "title": "My Note Title",
  "content": "Note content here..."
}

Get All Notes:

GET /api/notes

Delete a Note:

DELETE /api/notes/:id

Key Learnings

This 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.

About

A lightweight RESTful API for note-taking built with Node.js and Express.js. Features in-memory storage, server-side validation, and a clean frontend interface.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors