- Run
bundleto install project dependencies; - Run
rails db:createto create database; - Run
rails sto start server, port: 3000.
To run Specs, use the command rspec
- Send a
POSTrequest to/accountwith the following payload:
{
"name": "<username>",
"email": "<email>",
"password": "<password>"
}
- Send a
POSTrequest to/auth/loginwith the following payload:
{
"id": "<account id>",
"password": <password>
}
- You will receive a JWT and it's expiration date
- To see account's balance, send a
GETrequest to/accounts/:account_id, with the JWT obtained in previous steps
- Send
POSTrequest to/accounts/:account_id/transactionswith the following payload:
{
"destination_account_id": "<account_id>",
"amount": <amount>
}