E-commerce – Product Management System – PRD

https://ciaindia.github.io/ecommerce/

Product Requirement Document (PRD)

1. Project Overview

The Product CRUD API is a simple RESTful web service built using Node.js and Express.js. It allows users to perform Create, Read, Update, and Delete (CRUD) operations on a collection of products.

2. Purpose

The goal of this project is to provide a foundational backend API that can manage product data. It can later be integrated with a frontend dashboard or connected to a database such as MySQL.

3. Scope

The system will:

  • Allow users to add new products
  • Retrieve all or specific products
  • Update existing products
  • Delete products from the list

4. Functional Requirements

4.1 Product Entity

Each product contains the following fields:

FieldTypeDescription
idIntegerUnique identifier for each product
titleStringName or title of the product
priceNumberProduct price in currency value
stockNumberQuantity of product available in inventory

4.2 API Endpoints

MethodEndpointDescription
GET/productsFetch all products
GET/products/:idFetch single product by ID
POST/productsCreate new product
PUT/products/:idUpdate existing product
DELETE/products/:idDelete a product

4.3 Request/Response Examples

POST /products

{
  "title": "Keyboard",
  "price": 1200,
  "stock": 50
}

Response:

{
  "id": 3,
  "title": "Keyboard",
  "price": 1200,
  "stock": 50
}

PUT /products/3

{
  "price": 1000,
  "stock": 60
}

5. Non-Functional Requirements

  • Scalability: Can later be integrated with a database.
  • Performance: Should handle up to 1000 requests per second on local tests.
  • Security: Input validation required for all API calls.
  • Maintainability: Code follows modular and RESTful design principles.

6. Technology Stack

ComponentTechnology
BackendNode.js
FrameworkExpress.js
Database (Future)MySQL
ToolsPostman for testing, npm for dependency management

7. Assumptions

  • The system will initially store data in-memory.
  • The id field auto-increments based on the existing array size.
  • No user authentication is implemented at this stage.

8. Future Enhancements

  • Integrate with persistent storage (MySQL or MongoDB)
  • Add authentication and authorization
  • Implement pagination and search filters
  • Include product image uploads

9. Deliverables

  • Node.js Express application (server.js)
  • Postman collection for API testing
  • Documentation (this PRD)