Online Bank
Spring Boot/Spring Data/Spring Security/Hibernate/MySQL/REST
The project simulates online banking system. It allows to register/login, deposit/withdraw money from accounts, add/edit recipients, transfer money between accounts and recipients, view transactions, make appointments.
There are two roles user and admin.
The admin has there own fronent implemented in Angular2, which communicates with backend through REST services.
There is a sql dump with prepopulated data inside project folder. The username and password for database: root
You can login with: User - password; Admin - password
Deployment Steps on Docker:
Download application
git clone https://github.com/ravikalla/online-bank.git
Start MySQL Docker Container
docker run --detach --name=bankmysql --env="MYSQL_ROOT_PASSWORD=root" -p 3306:3306 mysql:5.7.22
Execute SQL scripts in MySQL
cd online-bank
docker exec -i bankmysql mysql -uroot -proot < sql_dump/onlinebanking.sql
Run Docker image of the application
docker run --detach -p 8888:8888 --link bankmysql:localhost -t ravikalla/online-bank:latest
Access the application by clicking the URL “http://localhost:8888!”
Deployment Steps without Docker:
Build application
mvn clean build
DB Setup
- Start MySQL server!
- Use MySQLWorkbench!
- Run SQL scripts! in MySQL database
Run application
java -jar target/online-bank-0.0.1-SNAPSHOT.jar
Things to know:
Build Docker image for the application
docker build -t ravikalla/online-bank:latest .
Create Jenkins image that has Maven
sudo chmod 777 /var/run/docker.sock && \
mkdir -p /jenkins_bkp/jenkins_home && \
chmod -R 777 /jenkins_bkp && \
git clone https://github.com/ravikalla/online-bank.git && \
cd online-bank && \
git checkout master && \
cp Dockerfile-Jenkins-Maven ../Dockerfile && \
cd .. && \
docker build -t ravikalla/jenkins-maven-docker:v0.1 .
Start Jenkins Server on Docker
docker run --detach -v /var/run/docker.sock:/var/run/docker.sock -v $(which docker):$(which docker) -p 9080:8080 -p 50000:50000 -v /jenkins_bkp/jenkins_home:/var/jenkins_home ravikalla/jenkins-maven-docker:v0.1
Setup “online-bank” project in Jenkins:
- Login to Jenkins and setup a pipeline project with source code from Link to OnlineBank GIT repo!
- Run the job to build and deploy the application
Debug H2 DB while testing
- Set a debug point in any test step and check the URL “http://localhost:8888/console” while testing
Code Quality Reports - (wiki)
For Online-Bank application, build happens in TravisCI and the test reports are generated in the same TravisCI server during the build process.
We are generating Cucumber test results in “ExtentReport” format. Extent Reports are open source and provides very good visuals for test reports - sample Extent report.
In the file .travis.yml, it is configured to push the generated test reports to “gh-pages” branch once the build is complete.
Once these test reports are uploaded to “gh-pages” branch in Online-Bank project, you can access various reports online using below links -
- Cucumber Native Test Results - https://ravikalla.github.io/online-bank/cucumber/cucumber-html-report
- Extent Report that has Cucumber Test Results - https://ravikalla.github.io/online-bank/extent-report.html
- JaCoCo Report for code coverage - https://ravikalla.github.io/online-bank/site/jacoco