mfaisalkhatri / restful-ecommerce

A free to use E-Commerce Web APIs for practising API testing.
GNU Affero General Public License v3.0
26 stars 9 forks source link
api api-testing e-commerce expressjs hacktoberfest nodejs rest-api testing training web-apis

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 :star: 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

API Testing Tutorials

:question: Need Assistance?