Skip to content

crgardner/bank-account-standalone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bank-account-standalone

bank-account-standalone is a Java 16 console application used as an example of the Clean Architecture. The application allows you to:

  • Open accounts
  • Adjust accounts with deposits and withdrawals
  • Prepare statements

It uses a separately running instance of DynamoDB local to store data.

Installation

AWS

AWS CLI

Install AWS CLI for your platform.

DynamoDB

  1. Setup Amazon DynamoDB locally.
  2. Start DynamoDB with the following command:
$ java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -sharedDb

Application

  1. Install JDK version 16. SDKMAN! makes it quite easy.
  2. Ensure a recent version of Maven is installed. SDKMAN! can help with that too.
  3. Clone this repo.
  4. Create the BankAccount table. In the script directory of the root of this clone, run the following:
$ ./create-account-table.sh
  1. In the root directory of the clone, run the following:
$ mvn clean package

Usage

  • After a successful installation, in the target directory of the root, execute the following:
$ java -jar bank-account-standalone.jar
  • Alternatively, start the application in your IDE by creating a run configuration for the com.crg.learn.account.application.start.Main Java file. There are no start up options.

After the application is started, navigate to the script directory and run the following scripts:

$ ./open_account.sh

$ ./deposit_amount.sh <account number from open_account.sh> 

$ ./withdraw_amount.sh <account number from open_account.sh> 

$ ./prepare_statement.sh <account number from open_account.sh>

Note these scripts hardcode the currency code "EUR," as the application currently supports only Euros. Also, if you are running behind a proxy, you may need to unset all your proxy-related environment variables in the shell. We observed connectivity problems to the local DynamoDB with those variables set.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published