This project is named Birrita. A Postman collection file has been provided for testing purposes. Additionally, Swagger has been integrated into the project, providing a means to interact with the API directly, which is available at the /api path.
A JWT login system has been developed, restricting the ability to create new beer dispensers to admin users only.
Authentication is not required for the rest of the endpoints.
A CRON job has been implemented to monitor tap opening times, and certain limits have been established for litres per person and maximum tap opening time in order to make the solution more closely resemble a real-world scenario.
Writes have been implemented with transactions for enhanced security.
To setup and run the project, use the following commands:
- Install the necessary packages:
npm install
- Run the project:
npm run start
A Postman collection has been included in the repository for testing the API endpoints. Import the collection into Postman and execute the requests.
The Swagger API documentation is available at /api
path on the running server. You can interact with the API directly using Swagger.
JWT authentication is used to restrict the ability to create new beer dispensers to admin users only. Use the login endpoint to authenticate.
A CRON job runs regularly to monitor and enforce limits for litres per person and maximum tap opening time.
Writes to the database are handled with transactions to ensure data integrity and consistency.