Giter Site home page Giter Site logo

bookstore's Introduction

Bookstore

Installation (Docker)

$ git clone [email protected]:hthompson6/bookstore.git && cd bookstore/scripts
$ ./install.sh

Starting Containers

$ cd /path/to/bookstore/docker
$ sudo docker-compose up -d --build

Docker Containers

Tearing Down Containers

$ cd /path/to/bookstore/docker
$ sudo docker-compose down -v

Usage

  • Please note that it can take some time for the Nginx service to start fully. A 502 bad gateway response may be returned at first.
  • Book IDs are created server side and are read-only

WebUI

The REST API can be interacted with via a WebUI found at the http://<ip_host>/api/book

Rest API

Create Resource

$ curl -d '{"author":"test_author", "title":"test_title", "pub_date": "2019-01-01"}' -H "Content-Type: applicatin/json" -X POST http:<host_ip>/api/book
{"book_id":1,"author":"test_author","title":"test_title","pub_date":"2019-01-01"}
  • Note the endpoint hit is http://<host_ip>/api/book

Update Resource

$ curl -d '{"author":"new_author", "title":"new_title", "pub_date": "2019-02-01"}' -H "Content-Type: application/json" -X POST http://<host_ip>/api/book/1
{"book_id":1,"author":"new_author","title":"new_title","pub_date":"2019-02-01"}
  • Note the endpoint hit is http://<host_ip>/api/book/<book_id>

Get Collection

$ curl http://<host_ip>/api/book

Get Single Resource

$ curl http://<host_ip>/api/book/<book_id>

Delete Resource

$ curl -X DELETE http://<host_ip>/api/book/<book_id>

Uninstall

$ cd /path/to/bookstore/scripts/
$ ./uninstall.sh

Road To Production

  1. Add unit tests
  2. Utilize ssl certs and enforce https
  3. Shift to Kubernetes:
    • Utilize docker hub or local registery (depending on resource)
    • Leverage the nginx ingress controller instead of nginx docker image
    • Prometheus monitoring
    • etc.
  4. Jenkins/CI tooling

bookstore's People

Contributors

hthompson6 avatar

Stargazers

Rajendra Agrawal avatar

Watchers

James Cloos avatar  avatar  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.