This is a sample project which purpose is to mimic a bike reservation web service. It is created with Fastify (web framework for NodeJS) and TypeScript.
Docker is used for ease of development/deployment and nodemon is included for restarting the server each time there is an update to one of the files.
The structure of the projects tries to be modular so it can be easily detached and made as a microservice if needed.
Executing make start-dev
will first build and then start the Docker container with the development NodeJS server and nodemon watching for file chanes. It can be accessed at http://localhost:8080
make start-prod
will start the prod server without rebuilding on file changes.
Once the project is running, the following routes can be accessed:
GET
- /api/bikes/reserve - lists all available bikesPOST
- /api/bikes/reserve/ - creates a reservation for a bikeGET
- /api/bikes/reserve/:uuid - retrieves info about a reservationPUT
- /api/bikes/reserve/:uuid - updates reservationDELETE
- /api/bikes/reserve/:uuid deletes reservation
API documentation is generated with with Swagger through Fastify Schemas and is present at: http://localhost:8080/documentation/
A Postman collection file is included in this repository for manual testing.
Thanks to the Docker contarization, the project is easily deployed with make deploy
to Cloud Run on GCP.
TBD