This project is a sample API REST service built with Node.js that manages gateways - master devices that control multiple peripheral devices. The service allows users to store information about these gateways and their associated devices, which is stored in a database.
The problem this project solves is the need for a system to manage gateways and their associated peripheral devices. The system ensures that any field marked as "to be validated" is validated and an error is returned if it is invalid. Additionally, the system ensures that no more than 10 peripheral devices are allowed for a gateway. The system offers an operation for displaying information about all stored gateways (and their devices) and an operation for displaying details for a single gateway. Finally, it allows users to add and remove a device from a gateway.
- You can access the live site for this API REST service at: https://api-rest-ts-node-gateways
- You can access the API documentation for this service at: https://api-rest-ts-node-gateways/docs
- Swagger json for import to postman: https://api-rest-ts-node-gateways/docs.json
- Frontend app repository: https://github.com/dairon-canel/gateway-list-app
- The version of Node.js used for this project is v14.21.0.
- Used windows 11 for development
- Deployed with railway
To install the project, use the following command:
yarn
add a .env file with this format:
PORT = 1337;
DB_CONNECTION_DEV = 'mongodb://localhost:27017/rest-api-gateway';
DB_CONNECTION_PROD = '';
NODE_ENV = prod;
For run the development environment, use:
yarn dev
For run a production environment, use:
yarn build
and then:
yarn start
- LinkedIn - @dairon-canel
- Frontend Mentor - @dairon-canel
- Github - @dairon-canel
Contributions to this project are welcome. To contribute, please fork this repository, create a new branch, and submit a pull request. Please ensure that your code adheres to the JavaScript Standard Style guidelines.
This project is licensed under the MIT License.