Giter VIP home page Giter VIP logo

cg_technical_challenge_backend's Introduction

Credit Group Technical Challenge - Backend

See Frontend repo at https://github.com/luks04/cg_technical_challenge_frontend.git

Flask app

It contains a Flask app which resolve the following objective:

Bulid a web service which exposes the current exchange rate of USD to MXN from three different sources in the same endpoint. The response format should be something like the following:

"rates": {
    "provider_1": {
        "last_updated": "2018-04-22T18:25:43.511Z",
        "value": 20.4722
    },
    "provider_2_variant_1": {
        "last_updated": "2018-04-23T18:25:43.511Z",
        "value": 20.5281
    }
}

Exchange rate sources:

Extra requirements:

  • API should be accessed with an Application Token.
  • API should have a rate limit per user.

Fake users

Username Password
admin admin

Docker Deployment in Heroku

Heroku CLI needed. The Flask app is containerized using Docker, so to deploy the app in a production environment it is recommended to use Gunicorn (see src/Dockerfile).

  1. Clone the repo, checkout to the "main" branch and login into Heroku CLI:
git clone https://github.com/luks04/cg_technical_challenge_backend.git
cd cg_technical_challenge_backend
git checkout main
heroku login
  1. Delete Heroku remote old repository:
git remote rm heroku
  1. Check remote repositories:
git remote -v
  1. Deploy the app with a Dockerfile using heroku.yml:
heroku create <app_name>
heroku stack:set container
git push heroku <source_branch>:main
  1. Deploy new changes:
git add .
git commit -m "<commit message>"
git push heroku <source_branch>:main
  1. To show the logs use the next command:
heroku logs --tail

cg_technical_challenge_backend's People

Contributors

luks04 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.