GithubHelp home page GithubHelp logo

orders_demo's Introduction

orders_demo

Introduction

The objective is to create a backend system which implements a RESTful API to accept and process orders.

Tech stack

The main software components are:

  • API Server

    • flask : Python based web framework
    • pymongo : Database connector
  • DB backend

    • mongodb : NoSQL DB server
  • Third Party Maps API

    • Google Maps

Data Model

The data model is a simple NoSQL database.

How to run

All the components have been dockerized for easier deployment.

Configuration variables

The rest API needs google maps key. Edit the docker-compose.yml to provide the API key.

    environment:
     - API_KEY=<INSERT YOUR KEY HERE>
     - MONGO_HOST=mongo
     - MONGO_PORT=27017

Alternatively docker-compose can be rewritten to read the API key from the host environment variable.

Docker run

Application can be launched by using docker-compose

docker-compose up -d

This launches two containers with the

Running tests

The code include unit test for the Web API. Tests can be executed by connecting to the API server container and running the test script

docker exec -it orders_demo_api_1 /bin/sh
python test.py

Future work

  • Add support for deployment options on hosted platforms such as:
    • Google app engine
    • AWS Elastic Beanstalk
  • Add more exception handling to catch potential exceptions happening at all interfaces such as Python -> Google Maps or Python -> MongoDB

orders_demo's People

Contributors

tmzh avatar

Watchers

 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.