Skip to content

Latest commit

 

History

History
36 lines (28 loc) · 1.92 KB

README.md

File metadata and controls

36 lines (28 loc) · 1.92 KB

REST API using SparkJava + Google Guice (Inject and Repository) + HSQLDB + Hibernate

This is a simple financial business Rest API implemented using SparkJava + Google Guice (Inject and Repository) + HSQLDB + Hibernate.

Libraries and Tools

How it works

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.

How to run

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