/api-rest-ts-node-gateways-master

This project is a sample API REST service built with Node.js and typescript

Primary LanguageJavaScript

API REST Service with Node for Managing Gateways and Peripheral Devices

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.

Table of contents

Overview

The challenge

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.

Screenshots

Frontend

image image

Swagger Docs

image

Links

Development environment

Requeriments used

  • The version of Node.js used for this project is v14.21.0.
  • Used windows 11 for development
  • Deployed with railway

Installing Dependencies

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

Author

Contributing

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.

License

This project is licensed under the MIT License.