- The task is implemented using JavaScript as programming language and NodeJS and Express as server / back-end framework.
- I used Visual studio code as Editor.
1- You will notice that I pushed the .env file to GitHub which is bad practice but I did that so you will have ability to tesst the project.
2- The best practice to handle the .env file is to save it in System Manger paremeter store
- Implement the required endpoints to get machines / pods and filter them.
- Add required test cases for for the the different functionalities.
- You will notice from the above badge that test coverage is 44% but this is because the core directory which contains validators and exception is not tested besides the Greeting entity it self is not tested as well.
- Add Dockerfile to help to setup the project easily.
- Add a health check endpoint.
- Application docker image is pushed to DockerHub so you can pull the image directly and use it.
- Deploy the application to Amazon web services using ElasticBeanStalk service.
- Unzip the compressed file to any where on your computer if you download or just clone the repository.
- Navigate to the cloned/downloaded folder and open it using your favourite IDE/Editor but but I prefer VSCode or WebStorm
- You can run the project using NPM by running the following commands in your terminal.
$ npm install
$ npm run db:seed
$ npm run dev
You can run the project through docker either by building the image from Dockerfile then running the container through the following commands
$ docker build -t swensenhe-coffee-app .
$ docker run -p 3000:3000 swensenhe-coffee-app
Or by pulling the image directly from Docker Hub
docker push mohamedmkashif/swensenhe-coffee-app:latest
Run the pulled image throught the following command docker run -p 3000:3000 -t mohamedmkashif/swensenhe-coffee-app
There are five end-points available in this project
Method | Endpoint | Body |
---|---|---|
GET | localhost:3000/machines | no body |
GET | localhost:3000/pods | no body |
GET | localhost:3000/machines?productType=${filterByType} | no body |
GET | localhost:3000/machines?waterLine=${filterByWaterLine} | no body |
GET | localhost:3000/pods?productType=${filterByType} | nobody |
GET | localhost:3000/pods?coffeeFlavor=${filterByFlavor} | nobody |
GET | localhost:3000/pods?packSize=${filterBySize} | nobody |
You can run the available test through the this command
$ npm run test
Run Test with coverage:
$ npm run test:full
-
The project is deployed on Amazon web services using EC2
-
AWS endpoint
18.204.208.228:3000
or
ec2-18-204-208-228.compute-1.amazonaws.com:3000