This application is an exercise of the following technologies:
- Domain Driven Design
- CQRS
- Event Sourcing
- Spring Boot
- Axon Framework
- RESTful service
- MongoDB
- AngularJs
- Bootstrap
- Single Page Application
$ mvn clean package
java -jar target/tradingac-0.2.0.jar
curl -X POST -d '{"name":"John Smith"}' -H "Content-Type:application/json" http://localhost:8080/api/traders
curl http://localhost:8080/api/traders
curl http://localhost:8080/api/traders/87b5dc8e-b95a-42d8-93d7-eeb7773195a3
curl -X POST -d '{"symbol":"GOOG", "shares": 100,"price":560.9, "type": 1}' -H "Content-Type:application/json" http://localhost:8080/api/traders/87b5dc8e-b95a-42d8-93d7-eeb7773195a3/buy
curl -X POST -d '{"symbol":"GOOG", "shares": 100,"price":560.9, "type": 0}' -H "Content-Type:application/json" http://localhost:8080/api/traders/87b5dc8e-b95a-42d8-93d7-eeb7773195a3/sell
curl http://localhost:8080/api/traders/87b5dc8e-b95a-42d8-93d7-eeb7773195a3/trades
curl http://localhost:8080/api/traders/87b5dc8e-b95a-42d8-93d7-eeb7773195a3/trades/FB
curl http://localhost:8080/api/traders/87b5dc8e-b95a-42d8-93d7-eeb7773195a3/trades/FB/1
curl http://localhost:8080/api/traders/87b5dc8e-b95a-42d8-93d7-eeb7773195a3/balance
curl http://localhost:8080/api/traders/87b5dc8e-b95a-42d8-93d7-eeb7773195a3/balance/FB
mongo
db show dbs use test show collections db.user.find()
$ curl -X POST -d '{"symbol":"FB", "shares": 20,"price":93.6, "type": 1}' -H "Content-Type:application/json" http://localhost:8080/api/trades
mongo
show dbs use axonframework switched to db axonframework
show collections domainevents system.indexes
db.domainevents.find()
use test
show collections system.indexes tradeEntry
db.tradeEntry.find()
This version is just a rough sketch. Still lots to do:
- Add tests, cover basic tests yet.
- Add Javadocs
- Add REST API docs
- Improve web UI
- Add authentication and authorization
- Fix TODOs
- Clean-up the code