Skip to content

mfaisalkhatri/restful-ecommerce

Repository files navigation

Open Source Love

Restful E-Commerce

A simple Node E-Commerce application for testing RESTful web services. This application is built for testers to practice API Testing Manually using tools like Postman or using API Test Automation tools like SuperTest, Rest-Assured, Playwright, Cypress, Boyka-Framework, etc.

Don't forget to give a ⭐ to make the project popular

Installation Steps

  1. Clone the repo
  2. Navigate into the restful-ecommerce root folder
  3. Run npm install
  4. Run npm start

APIs are exposed on http://localhost:3004/

Swagger is exposed on http://localhost:3004/api-docs

Importing the API Collection into Postman

  1. Visit http://localhost:3004/swagger.json to generate and download the Swagger JSON file
  2. The Swagger JSON file will be saved as swagger-output.json in your project directory
  3. Open Postman app and click on Import
  4. Select file swagger-output.json from the root folder of the project
  5. Select OpenAPI 3.0 with a Postman Collection and click on Import
  6. All the Available APIs will be imported in Postman and can be used for testing

Installation using Docker

  1. Clone the repo

  2. Navigate into the restful-ecommerce root folder

  3. Run docker compose -f docker-compose-ecommerce.yml up -d - This command will start the application in detached mode

  4. APIs are exposed on http://localhost:3004/

  5. Swagger is exposed on http://localhost:3004/api-docs

  6. Run docker compose -f docker-compose-ecommerce.yml down to stop the application.

Running the Unit Tests

After running all the steps mentioned in the Installation steps section, the following command will execute all the unit-tests. (It is optional to run the unit tests, these tests are written using Super-Test)

  1. Run npm run unit-test

Checkout the API Documentation on the Wiki-Page

Tutorials of this Project

Blog

YouTube

  • RESTful E-Commerce API in Node.js: Demo APIs for API Testing | Open Source | Tutorial

RESTful E-Commerce API in Node.js: Demo APIs for API Testing | Open Source | Tutorial

API Testing Tutorials

❓ Need Assistance?

  • Discuss your queries by writing to me @ mohammadfaisalkhatri@gmail.com OR ping me on any of the social media sites using the below link: