RESTful E-Commerce API in Node.js: Demo APIs for API Testing
Mohammad Faisal Khatri
Posted on September 11, 2024
Hello Testers and Developers! π
If you want to learn and practise API Testing and need a demo API. I have got something exciting for you!!
I recently built a Restful-Ecommerce API that is a simple Node E-Commerce application for testing RESTful web services.
It is built using ExpressJS in node.
This application has multiple endpoints related to creating, updating, retrieving and deleting orders.It is specifically built for testers and developers to practise API Testing manually using tools like Postman or using API Test Automation tools like SuperTest, Rest-Assured, Playwright, Cypress, Boyka-Framework, etc.
In this post, Iβll walk you through what this repository offers, how to get started, and why it could be a great learning resource for your next project.
π GitHub Repo: Restful E-commerce
Why This Project? π€
There are tons of e-commerce platforms out there, but building one from scratch can help you understand the core concepts of back-end development and API design.
Also, for learning about ecommerce applications, I couldnt find a good RESTful API that could serve the purpose of learning API testing and test automation. Another benefit of this project is that it gives control in your hands,i.e. it can be installed on your local machine using NodeJS or using Docker.
It also generates the Swagger that serves as API documentation and allows testing the APIs manually over it.
This project is perfect for testers looking to:
- Learn RESTful API Testing manually using tools like Postman, Insomnia, etc.
- Learn API Test Automation using tools and frameworks like SuperTest, Rest-Assured, Playwright, Cypress, etc.
Technologies Used π οΈ
- Node.js: Back-end JavaScript runtime
- Express: Web framework for building RESTful APIs
- JWT (JSON Web Tokens): For secure user authentication
- Swagger : For generating the Swagger documentation
- Mocha: For writing the Unit tests
- Chai: For writing the assertions in the Unit tests
Features of the API
Security
- JWT based authentication token generation
Order Management
- Users can create and manage orders
- View order history and current orders
- For more details on the APIs checkout the API documentation
Getting Started
Checkout the following links to get started with the project:
Video Tutorial on YouTube
Final Thoughts π¬
Building your own e-commerce API is a fantastic way to sharpen your back-end development skills. Whether you want to use this project as a starting point for a larger application or simply learn more about testing RESTful services, I hope this repo will be useful to you.
Feel free to reach out with any questions or suggestions, and donβt forget to star the repo if you find it helpful! β
Posted on September 11, 2024
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.