Skip to content

vladbagmet/financial_api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dummy Financial Organisation API Backend

Implements backend for managing accounts and funds for dummy financial organisation. Financial accounts can be created, owned and managed by their owners. The purposes of this application are:

  • to show how to set application fast
  • have JWT authentication implemented
  • have infrastructure for end-to-end API testing.

Prerequisites

Running Service Locally

Use terminal to run commands below

  • Clone repository by running git clone https://github.com/vladbagmet/financial_api.git
  • Go to the cloned repository by running cd financial_api
  • Create .env file with database credentials or use a template file with default dev credentials by running cp ./backend/.env.sample ./backend/.env
  • Run service by executing a shortcut command make start Service runs inside docker-container and can accept HTTP requests on http://0.0.0.0:8000/ address.

Running Tests

  • Run tests by executing a shortcut command make test

Api Service Documentation

All request should contain header with Content-Type: application/json. Requests against endpoints with authentication should also include header with Authorization: Bearer {{token}}

Authentication

[POST] /api/auth/register/ | [no_auth] Used to register new users

Body Parameters

  • username
  • password
  • first_name (optional)
  • last_name(optional)

[POST] /api/auth/login/ | [no_auth] Used to log in

Body Parameters

  • username
  • password

[POST] /api/auth/login/refresh/ | [no_auth] Used to get access token by providing a refresh token

Body Parameters

  • refresh

Account

[POST] /api/accounts/ | [auth] Used to create an account

Body Parameters

  • name Name of an account that will be created
  • balance (optional) Initial balance for newly-created account, if not specified, 0.0 will be set
  • currency (optional) Currency for newly-created account, if not specified, "USD" will be set
    • possible options ['USD']

[GET] /api/accounts/<uuid4:account_id>/ | [auth] Used to retrieve account balance

[POST] /api/accounts/<uuid4:account_id>/transfer/<uuid4:account_id>/ [auth] Used to transfer funds between 2 different accounts

Body Parameters

  • amount Decimal positive number to transfer
  • currency Indicates the currency of the transaction, for now only "USD" transfers are allowed

Transfers History

[GET] /api/transfers_history/<uuid4:account_id>/ | [auth] Used for retrieve transfers history for the given account

Demos

Log In

fin-demo-login

Create Account

fin-demo-account-creation

Retrieve Balance

fin-demo-retrieve-balance

Funds Transfers

fin-demo-funds-transfers

Retrieve Transfers History

fin-demo-transfers-history

About

Backend to manage accounts of some financial institution

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published