Coder Social home page Coder Social logo

backbase-test's Introduction

mycurrency

Test for Backbase that consist of building a web platform that allows users to calculate currency exchanges rates

Built with Cookiecutter Django

License: MIT

Requirements

How to set up

  1. Open a terminal on the root folder of the project
  2. Execute docker-compose -f local.yml up to start the app (for a complete view on the start, go to local.yml)
    1. To clean the container, execute docker-compose -f local.yml down

Basic Commands

Because this project was built to be used only with docker, every command has to be done towards the container.

Always execute the commands from the root of the project!!!

Setting Up Your Users

  • To create a normal user account, just go to Sign Up and fill out the form. Once you submit it, you'll see a "Verify Your E-mail Address" page.

  • To create a superuser account, use this command:

    $ docker-compose -f local.yml run --rm django python manage.py createsuperuser
    

To verify the user, check your console for a simulated email verification message. Copy the link into your browser. Now the user's email should be verified and ready to go.

Running tests with django test

$ docker-compose -f local.yml run --rm django python manage.py test

Architecture

This project has two main Docker containers: a Python container to contain the django app and a postgres docker container.

Django app

This django app has the following parts (each of them has their own README.md):

  • currency: core of the django app, where there are the main models and django admin views
  • currency_rates: service that allows to retrieve the rate value of a given currency to the rest of them between two given dates
  • currency_converter: service that allows to obtain the latest exchange value from given currency to another given currency.
  • rate_of_return: service that allows to get the time-weighted rate of return by day from given source and exchanged currency of a given amount since a given start date.
  • providers: in order to get the exchange rates, it is needed to get it from external providers.
  • users: all the managing of users was made thanks to the cookie-cutter, so we won't go further on it.

API

To access the api:

  1. Once the app is running and having a superuser created, go to 0.0.0.0:8000/api/docs
  2. Execute the endpoint /auth-token (selecting application/json as type of payload) with the email and password. Copy the token given
  3. Click on any padlock symbol to authorize every request. On the text box put the prefix token followed by the token that you previously copied
  4. Execute any endpoint following the instructions (is given) on each endpoint.

Deployment

This test was made taking into consideration only local environment (not production) due to time limitations. The production docker-compose file was generated through cookie-cutter, but was not modified/adapted to this project.

Continuous Integration (CI)

This project includes a Continuous Integration (CI) pipeline using "GitHub Actions" that ensures every time a commit is done, it will execute the tests. The CI setup guarantees the reliability and stability of the codebase.

You can find more details about the CI pipeline in the GitHub ci yml file

backbase-test's People

Contributors

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