No description
Find a file
Augusto Dwenger 99cb294e3c Merge branch 'dev' into 'master'
Releasing 1.0 to master

See merge request berufsschul-ae/solatium!13
2019-09-27 07:46:18 +00:00
.mvn/wrapper add mvn wrapper 2019-09-02 13:44:21 +02:00
jdkDocker remove local java var 2019-09-23 21:43:34 +02:00
src Merge branch 'feature/website_redesign' into 'dev' 2019-09-26 11:45:44 +00:00
.dockerignore add docker image to be automatically build and pushed with the ci 2019-09-23 19:28:45 +02:00
.gitignore add ignore to the directory for the persistence block save 2019-09-24 21:30:55 +02:00
.gitlab-ci.yml fix template 2019-09-26 11:10:07 +02:00
apiE2ETest.sh add param to skip maven test on startup 2019-09-25 10:53:52 +02:00
docker-compose.example.yml setup for release 2019-09-27 09:20:56 +02:00
Dockerfile add docker image to be automatically build and pushed with the ci 2019-09-23 19:28:45 +02:00
entrypoint.sh change directory to run app in path 2019-09-25 10:54:19 +02:00
mvnw add mvn wrapper 2019-09-02 13:44:21 +02:00
mvnw.cmd add mvn wrapper 2019-09-02 13:44:21 +02:00
pom.xml use maven wrapper for building docker image and change jacoco merge directory 2019-09-23 19:40:55 +02:00
README.md setup for release 2019-09-27 09:20:56 +02:00

Solatium

pipeline status coverage report

Solatium is a program that simulates an ATM. The users can login into their accounts and check their balance, send transactions and disburse and deposit their money.

Features

  • Login with Verification
  • Persistent Account Balance
  • Deposit & disburse
  • All in a Blockchain (with validation)

Setup

Download one of the newest builds and run it with java -jar filename.jar

Setup with Docker

This project can be executed with Docker. To do so pull the image from registry.gitlab.com/berufsschul-ae/solatium:latest.
To start the application run docker run --name solatium -p 8080:8080 registry.gitlab.com/berufsschul-ae/solatium:latest.
To persist the transactions you have to mount a volume to /tmp/persistence.
There is also a docker-compose file with all the config done, just start it with docker-compose -f docker-compose.example.yml up and take a look at localhost.

How to use

Go to the root of you server it will ask you for a login Currently there are only the following hardcoded users:
"user" with password "foo"
"user1" with password "bar"
"blazej" with password "blazej123"
"augusto" with password "augusto123"
"bjarne" with password "bjarne123"
"Bank" with password "Bank"
"heiko" with password "heiko123"

After a successful login you can see your balance. You can also send the transaction and disburse and deposit your money.

API

You can also use the included API to check for the balance of a user or send transaction etc.

The API has the following schema: /api/(action)?(params)

You still need to be authorized to access this API. We suggest using curl for this. Here are the request made with curl and some explanations.

Checking the balance

curl -u user:foo localhost:8080/api/balance
If you'd run the code locally, your curl request could look like this.
This request uses the balance action to the balance for the user specified after the curl parameter "-u". After the parameter we need to provide the user credentials with the following schema "(username):(password)".

Sending transactions

curl -u user:foo "localhost:8080/api/transaction?receiverId=user1&amount=100"
This request requires an receiverId and the amount as parameters. Here we are sending a transaction from user to user1 with an amount of 100.

Depositing money

curl -u user:foo localhost:8080/api/deposit?amount=100 Deposit only takes one parameter and that's amount.

Disburse money

curl -u user:foo localhost:8080/api/disburse?amount=100 Disburse also only takes one parameters; amount.

Setup for development

Clone the project and do a mvn clean install
Run the project with mvn spring-boot:run