Giter Site home page Giter Site logo

coffee-app's Introduction

Coffee app - BackEnd project (NodeJS / Express)

License: MIT

General Info

  1. The task is implemented using JavaScript as programming language and NodeJS and Express as server / back-end framework.
  2. I used Visual studio code as Editor.

Notes

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

Definition of done

  1. Implement the required endpoints to get machines / pods and filter them.
  2. Add required test cases for for the the different functionalities.
  3. 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.
  4. Add Dockerfile to help to setup the project easily.
  5. Add a health check endpoint.
  6. Application docker image is pushed to DockerHub so you can pull the image directly and use it.
  7. Deploy the application to Amazon web services using ElasticBeanStalk service.

Installation and setup

  1. Unzip the compressed file to any where on your computer if you download or just clone the repository.
  2. Navigate to the cloned/downloaded folder and open it using your favourite IDE/Editor but but I prefer VSCode or WebStorm

Running

NPM

  • You can run the project using NPM by running the following commands in your terminal.
    $ npm install
    
    $ npm run db:seed
    
    $ npm run dev
    

Docker

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

Usage & available end-points

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

Testing

You can run the available test through the this command

$ npm run test

Run Test with coverage:

$ npm run test:full

Deployment

18.204.208.228:3000

or

ec2-18-204-208-228.compute-1.amazonaws.com:3000

TODO

Author

Mohamed Kashif

coffee-app's People

Watchers

Mohamed Mahmoud avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.