- Rails API for Clark Bank Application
- Rails 5 API with minimal dependencies and middlewares
- A minimal docker alpine container
- Automatically pushes it to dockerhub if tests pass
git clone https://github.com/ClarkBank/clark_api.git
cd clark_api
bundle
rails s
In order to trigger events you must to create a vhost on rabbitmq admin, login as user:guest
pass:guest
, create the vhost events
and set guest permission for it.
curl -H 'Content-Type: application/json' -d '{"email": "[email protected]", "password": "12345678"}' -X POST 'http://localhost:9292/registrations'
curl -H 'Content-Type: application/json' -d '{"name": "City Bank", "user_id": 1}' -H "Authorization: Bearer <ACCESS_TOKEN>" -X POST 'http://localhost:9292/accounts'
curl -H 'Content-Type: application/json' -d '{"amount": 9.99}' -H "Authorization: Bearer <ACCESS_TOKEN>" -X POST 'http://localhost:9292/accounts/123456/deposit'
curl -H 'Content-Type: application/json' -d '{"amount": 9.99}' -H "Authorization: Bearer <ACCESS_TOKEN>" -X POST 'http://localhost:9292/accounts/123456/withdraw'
curl -H 'Content-Type: application/json' -d '{"recipient_id": "654321", "amount": 9.99}' -H "Authorization: Bearer <ACCESS_TOKEN>" -X POST 'http://localhost:9292/accounts/123456/transfer'
This repository has automated image builds on hub.docker.com after successfully building and testing. See the deployment
section of circle.yml for details on how this is done. Note that three environment variables need to be set on CircleCI for the deployment to work:
- DOCKER_EMAIL - The email address associated with the user with push access to the Docker Hub repository
- DOCKER_USER - Docker Hub username
- DOCKER_PASS - Docker Hub password (these are all stored encrypted on CircleCI, and you can create a deployment user with limited permission on Docker Hub if you like)
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
GitHub @rafaeljesus · Twitter @rafaeljesus