Simple example of Scala power.
From source:
sbt run
Or just download the current release from release pages and run:
java -jar money-transfer-assembly-{VERSION}.jar
Go to http://localhost:9000
Properties:
Property | Description | Default |
---|---|---|
-Dorg.chebba.mt.port | Http port | 9000 |
The main goal to show different aspects of modern scala development:
- Scala simplicity in business logic parts
- Scala power in DSL
- Usage of Java and Scala modern libraries
So, what is inside?
Simple application for money transfers between accounts. It contains few functions to manage accounts and work with account balances.
Application provides REST-like API described with OpenAPI aka Swagger Swagger implementation is done by my old DSL lib. It's not so cool as can be (have an idea to reimplement it with macros and combinators for model description), but anyway is much better than Swagger annotations.
Http server is a simplified version of an implementation used in my previous projects. It's based on Netty and works pretty well for fast simple use-cases.
Simple functional testing is done with ScalaTest and dispatch
- Better error handling and data validation
- Better test coverage
- Shorter test syntax for JSON assertions