Giter Club home page Giter Club logo

akvelon_python_internship_3_alexander_ten's Introduction

Financial manager REST API.

In Development...

Technical Task:

Imagine you are to implement a tool for managing personal finances for money planning.
You would need to build a REST API for storing user and transactions information.
The user entity represents an agent who is adding transactions and contains following fields:
id
first name
last name
email
The second entity is a transaction - either income or withdrawal. 
Each transaction needs to have a reference to some user. The Transaction entity contains:
id
user_id
amount - the sum of a transaction
date

Functional requirements: Ability to create / view / edit / delete information about user Ability to create / view / edit / delete transactions information Ability to view all user’s payments Ability to view sum of income/outcome grouped by dates (say, an array of {“date”: “2021-05-11”, “sum”: 2543.50} jsons, so that as a user I know how much I’ve spent/received each day). Will be a plus if you also add start date and end date filter to it. To view users, and payments you need to provide various filtering methods (by payment date, type of transaction (either income or outcome, based on the sign of amount)) and sorting (by date, by amount)

Host on:

http://206.189.100.117:8000/

Swagger:

https://app.swaggerhub.com/apis/juridetochkin/financial_manager_api/v1

To run tests:

run /manage.py test
(Make sure your Postgres admin has a permission to create new Database!
Django will create a temporary db for testing.)

To deploy:

The project is deployed with the following requirements:

Ubuntu 20.04
PostgreSQL 13.2
nginx 1.18.0
Python 3.8
... for Python requirements follow requirements.txt

Install Python 3.8, pip, and python virtualenv
Install Nginx 1.18.0
Install PostgreSQL and create a new DB.
Make sure that the DB admin has a permissions to create new databases,
it's needed for Django to create a test DB if you need to use unittests.

'git clone' the repo.

pip install -r requirements.txt in your activated virtualenv

To store and pass Postgres and Django secret variables to settings.py,
python dotenv package is used in this project. It's already installed with the previous step,
so create a .env file in the projects directory and fill it with variables you need,
then configure settings.py.

Run /manage.py migrate

Configure:

  • fin.uwsgi.ini
  • nginx.conf
  • uwsgi_params
    with parameters and paths you need

Create a symlink for Nginx to get your nginx.conf :
sudo ln -s /full/path/to/your/nginx.conf /etc/nginx/sites-enabled/

Start Nginx

Strart uWSGI:
uwsgi --ini /fin_uwsgi.ini

Congrats!
If you have any questions feel free to email

akvelon_python_internship_3_alexander_ten's People

Contributors

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