This is a simple financial business Rest API implemented using SparkJava + Google Guice (Inject and Repository) + HSQLDB + Hibernate.
- [Web Framework]
SparkJava
- [DI Framework]
Google Guice
- [ORM Framework]
Hibernate
- [JPA Layer]
Google Guice-Repository
which usesSpring Data JPA
as the underlying data abstraction layer - [In-Memory Database]
HSQLDB
- [Automatic Test Framework]
JUnit
This demo implements a simple financial business Rest API. It has a simple data model of an Account
with an One-to-Many
relationship to Transaction
. Through Rest API you are able to request for any CRUD
operation. Because of the Transactional
annotation provided by Google Guice Repository
all the CRUD operations are ACID-enabled.
All the data will be stored in an In-Memory HSQLDB
database named transferRestDB
.
By simply executing TransferRESTApp
class, the application starts listening on localhost:8080
with the following
API:
-
GET /health
: health-check -
GET /accounts
: get all the accounts -
GET /accounts/:id
: get a single account -
POST /accounts
: save an account -
PUT /accounts
: update an account -
DELETE /accounts/:id
: delete an account -
GET /accounts/:id/transactions
: get transactions of an account -
GET /accounts/:id/transactions/:tid
: get a single transaction of an account -
POST /accounts/:id/transactions
: save a transaction of an account -
PUT /accounts/:id/transactions
: update a transaction of an account -
DELETE /accounts/:id/transactions/:tid
: delete a transaction of an account