https://github.com/ph-7/projectu-simple-clean-nodejs-api
A simple clean REST API built with NodeJS, express with a n-tier architecture (organized into layers). My Udemy course explaining how to build it is available at: https://www.udemy.com/course/build-backend-api-node-js-and-react-frontend/
https://github.com/ph-7/projectu-simple-clean-nodejs-api
api express-js javascript js nodejs podman rest rest-api udemy
Last synced: 6 months ago
JSON representation
A simple clean REST API built with NodeJS, express with a n-tier architecture (organized into layers). My Udemy course explaining how to build it is available at: https://www.udemy.com/course/build-backend-api-node-js-and-react-frontend/
- Host: GitHub
- URL: https://github.com/ph-7/projectu-simple-clean-nodejs-api
- Owner: pH-7
- License: mit
- Created: 2022-07-15T04:06:03.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-09-27T08:14:39.000Z (about 1 year ago)
- Last Synced: 2025-04-09T20:05:31.028Z (6 months ago)
- Topics: api, express-js, javascript, js, nodejs, podman, rest, rest-api, udemy
- Language: JavaScript
- Homepage: https://www.udemy.com/course/build-backend-api-node-js-and-react-frontend/
- Size: 181 KB
- Stars: 10
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# ProjectU Simple clean NodeJS API
A simple clean REST API built with NodeJS, express with a n-tier architecture (organized into layers). My Udemy course explaining how to build it is available at: https://www.udemy.com/course/build-backend-api-node-js-and-react-frontend/learn/lecture/33130370#overview
## Setting Up
- Make sure you have [NodeJS](https://nodejs.org/en/download) v14 or newer innstalled.
- Run `npm ci` to install all dependencies.
- `npm start` to start your API on port `4000`.
- You can change the port by editing `src/server.js` and changing `const port = 4000;` to another port number.
- Download [Insomnia](https://insomnia.rest/download) or [Postman](https://www.postman.com/downloads/) to send easily HTTP requests to your API.
- In this Udemy course, I will be using Insomnia v4.2, so Insomnia would be the recommended one.## Running unit tests
```console
npm test
```Or with `npx`
```console
npx ava
```## Running it with Podman
1. Make sure Podman is correctly installed on your machine - https://podman.io/getting-started/installation
2. From a command line opened , run `podman machine init`, and then `podman machine start`
3. Then, in the project folder (still from your terminal), let's build the image with `podman build -t simple-api-image .`
4. Once it has finished and the image successfully built, you should be able to see it by typing `podman images`
5. Finally, let's run the image container by typing `podman run -p 4000:4000 simple-api-image` - Here, we use port `4000`, and map it to the local port `4000`.## 3rd-party libraries
To make our job easier, this API uses the some great handy libraries such as...* [Pino logging library](https://github.com/pinojs/pino)
* [Yup schema validation](https://github.com/jquense/yup)
* [express-rate-limit](https://github.com/express-rate-limit/express-rate-limit)## Author
[](https://ph7.me 'Pierre-Henry Soria website')
I'm [Pierre-Henry Soria](https://ph7.me) 👋
A **super passionate** Belgian **software engineer** 🤗 And a true cheese 🧀 & chocolate 🍫 lover! 😋 You can reach me at _hi {[AT]} ph7 [{D0T}] me_
[](https://www.linkedin.com/in/ph7enry/ "Pierre-Henry Soria LinkedIn") [](https://twitter.com/phenrysay 'Follow Me on Twitter') [](https://github.com/pH-7 'Follow Me on GitHub')
## Context
This is the final source code and completed project of my [Udemy Course](https://www.udemy.com/user/pierresoria/), **Learn how to build a Backend REST API with Node JS**.
## License
This project is distributed under [MIT license](https://opensource.org/licenses/MIT). Enjoy! 🎉