in a Python3 virtualenv
pip install -r requirements.txt
Run the tests:
py.test
Run the server:
hug -f payments.py
There're 3 api endpoints:
https://localhost:8000/accounts
This will return all the accounts (with their name, email, balance)
https://localhost:8000/transactions?account_id=2
This will return all the transactions involving a single account
https://localhost:8000/pay?source=1&recipient=2&amount=1
This will make a payment, while respecting the constraints (source and recipient have to exist, no negative balance)
By accessing https://localhost:8000/index
the Elm frontend can be used to interact with the api
To rebuild index.html
simply run
elm-make frontend/Main.elm