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.
- Unix-like OS (like MacOs or Linux)
- Docker-compose (if you do not have one, feel fre to get installation package here https://docs.docker.com/desktop/mac/install/)
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
.envfile with database credentials or use a template file with default dev credentials by runningcp ./backend/.env.sample ./backend/.env - Run service by executing a shortcut command
make startService runs inside docker-container and can accept HTTP requests onhttp://0.0.0.0:8000/address.
- Run tests by executing a shortcut command
make test
All request should contain header with Content-Type: application/json.
Requests against endpoints with authentication should also include header with Authorization: Bearer {{token}}
[POST] /api/auth/register/ | [no_auth] Used to register new users
Body Parameters
usernamepasswordfirst_name(optional)last_name(optional)
[POST] /api/auth/login/ | [no_auth] Used to log in
Body Parameters
usernamepassword
[POST] /api/auth/login/refresh/ | [no_auth] Used to get access token by providing a refresh token
Body Parameters
refresh
[POST] /api/accounts/ | [auth] Used to create an account
Body Parameters
nameName of an account that will be createdbalance(optional) Initial balance for newly-created account, if not specified, 0.0 will be setcurrency(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
amountDecimal positive number to transfercurrencyIndicates the currency of the transaction, for now only "USD" transfers are allowed
[GET] /api/transfers_history/<uuid4:account_id>/ | [auth] Used for retrieve transfers history for the given account




