I've built a simple REST API in Node.js with a MVC software architecture simulating a basic shop API by following the Building a RESTful API Academind Course course.
It was an optional side course suggested in the main course I was taking at the time - Vue - The Complete Guide (incl. Router & Composition API) Udemy course.
- Core Runtime:
Node.js(v20.19.5 for modern ES modules and async/await support). - API Framework:
Express.jsfor routing and middleware handling with endpoints for CRUD operations (Create, Read, Update, Delete) on items such as users, products or orders, emphasizing API design principles like statelessness, resource-based routing, and HTTP methods (GET, POST, PUT, DELETE). - Tools:
Nodemon- automatically restarting the Node.js application when file changes in the directory are detected. - Database:
MongoDB Atlastogether withMongoosefor the object modeling in the MVC software architecture of the API project. - APIs:
Postmanfor testing the API project by providing a user-friendly interface for making requests, viewing responses, and debugging issues. - Middlewares:
Multeris the Node.js middleware for handling multipart/form-data in this API project, which is primarily used for uploading files for products.express-async-handler- for handling exceptions inside of async express routes and passing them to the express error handlers.Mongan- HTTP request logger middleware for Node.js
- Authentication:
JSON Web Token (JWT)together withbcryptfor hashing passwords. - Other: The project is using
body-parserpackage to parse the body of an incoming requests, because it's not nicely formatted and easily readable by default in Node.js. As a result we can then use the formatted data of the body of an incoming requests. The package doesnt support files, but it supports URL encoded bodies and json data.
- Authentication of users.
- Endpoints for signin and logging for users:
- /signup,
- /login.
- Endpoints for managing shop inventory and orders:
- /products for listing items,
- /products/:id for individual product details,
- /orders for listing orders,
- /orders/:id for individual order details.
- Basic error handling and response formatting.
Make sure to install the dependencies:
$ npm iStart the development server:
$ npm run start
📂 Building a RESTful API Academind Course
🎞️ Building a RESTful API with Node.js Academind [Youtube]
🪁 JWT Debugger
📊 GitDiagram
🙌 Thanks for checking out my project! More coming 🔜.
Stay tuned 🚀 and don't forget to give the project a star!
⭐ Made with lots of 💗, ☕, and a sprinkle of ✨ by Ralitsa Voronevska!





























