My customer asked to develop a simple μService with embedded database and RESTful API. This is simple application emulating money accounts and transfers among them. The customer had "ostracized" Spring framework for some reasons, so I chose the following tech stack to build the application:
- Java 8
- Vert.x
- Guice
- Jackson
- JDO : Datanucleus
- RxJava
- RAML : RESTful API Modeling Language
- RAML console : The RAML Console allows browsing of API documentation and in-browser testing of API methods.
(I fixed a minor bug while working on this project) - H2 database
- Junit
- slf4j + logback
- Gradle & Groovy
- Handlebars.java
GitHub → TravisCI → AWS S3 → AWS CodeCommit
Deployment phase's files for SDLC are stored in src/deploy/aws/codedeploy
and .travis.yml
The sample instance is running on AWS at http://test.itranga.com
Some assumptions was made in the project to facilitate development
- RESTful API supports
application/json
only—application/xml
was discarded for simplicity. - API doesn't support security
- If
Transfer
sent without fieldfrom
then it is considered as incoming transaction from another system and that system is responsible for balancing debit/credit - An account may have negative balance—there is no policy.
- Direct debit is allowed, i.e. negative amount in a transfer is valid:
{"from": 12, "to": 1, "amount": -45.42}
Download binary file as zip
-archive. The file also contains sources and javadoc.
Javadoc API is available online.