Coder Social home page Coder Social logo

banking's Introduction

Banking

This repo contain a small and simple approach to a initial banking solution.

This repo depends on the following:

To Run it locally:

Setup instructions

After getting poetry installed you should create a virtual environment and activate it $ python3 -m venv env $ source env/bin/activate Then install dependencies using poetry: $ poetry install

Run instructions

To execute the solution you have to provide a valid postgres connection: $ DATABASE_URL="postgresql://user:password@localhost:5432/database" $ uvicorn src.main:app --reload After that you would be able to see following output:

INFO:     Started server process [35568]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
A mock data was created and pre-inserted using a proper orm mapper. Needed person data pre inserted can be viewed at http://127.0.0.1:8000/docs#/people/get_people_people__get

/openapi.json especification is at http://127.0.0.1:8000/docs

Running using Dockerfile:

Execute following commands:

cd ~/banking
docker build -t banking
docker run -p 80:80 -e DB_URL=postgresql://user:pw@host:5432/db banking
Now you can access docs at

To run tests you need to execute:

pytest tests/routes/transaction.py
pytest tests/routes/account.py

Considerations:

  • A basic layered design patter was used to keep dependency only for inner layer
  • A much better approach would be use a complex messaging/events architecture as described here or at cosmic python.
  • It's simple test relates a admin view where user who is getting and inserting data at resources has access to all data. Otherwise will be a huge security issue an user accessing other's data.
  • I've used simple postgres dockerfile to support application. You can also ask me for already provisioned db url's.

banking's People

Contributors

gabriel-viviani avatar

Watchers

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