GithubHelp home page GithubHelp logo

godfrey-ndungu / django-clean-architecture Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sdediego/django-clean-architecture

0.0 0.0 0.0 178 KB

Clean Architecture approach for Django project code structure implementation.

License: MIT License

Shell 0.69% Python 98.44% Dockerfile 0.87%

django-clean-architecture's Introduction

Forex - Django Clean Architecture

This repository contains the code for Forex API backend. The application aims to provide information for all currencies, latests and historical time series exchange rates for currency pairs, currency conversion and time weighted rates calculation.

Documentation

This project has been developed using Django and Django Rest Framework, with Celery as background tasks runner, Postgres as relational database and Redis as cache service.

Code structure implementation follows a Clean Architecture approach, emphasizing on code readability, responsibility decoupling and unit testing.

For API backend endpoints documentation refer to the forex yaml file in the docs directory.

Setup

Download source code cloning this repository:

git clone https://github.com/sdediego/django-clean-architecture.git

Get free API Key for the following exchange rate services:

  1. https://fixer.io/
  2. https://xchangeapi.com/
  3. https://www.exchangerate-api.com/

Later update database with each value for the corresponding provider api_key setting using the backend admin panel.

Run the API backend:

Create docker images and execute the containers for development. From the project directory:

docker-compose -f ./docker/docker-compose.yaml -f ./docker/docker-compose.dev.yaml up

Shutdown the application and remove network and containers gracefully:

docker-compose -f ./docker/docker-compose.yaml -f ./docker/docker-compose.dev.yaml down

Execute tests suite

  1. Execute the docker containers with environment variables setup for testing:
docker-compose -f ./docker/docker-compose.yaml -f ./docker/docker-compose.test.yaml up
  1. Access running api backend forex_api docker container shell:
docker exec -it forex_api bash
  1. Execute pytest command from project directory:
pytest

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.