Demonstration of Requirements understanding, proposing a solution and implementation by using the latest tools and techniques.
- Distribution
- Problem Statement
- Proposed Solution
- Entities
- Deliverable Content
- Deliverable Content
- Development Cycle
- How to Setup
- Pre-reqs
- Tools Included
- External Tools
- Deployments
- Contribute
- Swagger API Docs - Deployed on EC2 Instance - Bonus Requirement
- A docker repository is created, the latest image can be downloaded
- Sonar Project - Bonus Requirement
- Docker Compose - Bonus Requirement
- This app is built as assignment for FunMid.
- Adds different libs to enhance the application quality and performance.
- Using SWAGGER.IO for documentation and as a working REST-API client
- CI/CD Demonstration using Github Actions
- Docker containers are used for Build Deployment
- The live environment is established on an EC2 instance to run dockerized build
- Version 1.0.0
- By keep the provided instructions in mind, I would prefer to use a Spring Boot application for the implementation of required functionality.
- MySQL Database will be used for Dev, Test and Prod environments.
- For testing, I would prefer to use JUnit and Mockito
- There will be a Dockrized Build distribution
- As we are mocking a banking system, there should be a locking system on JPA to avoid auto change in schema.
- There shouldn't be a possibility to modify the database via JPA
- There should be a separate database to be used for testing purposes along with pre-populated data if required.
- For demonstration purpose, an API frontend should be provided...i.e Swagger
- As per the given statement, there will be two entities
- I would like to use database constraints to avoid deletion of account which is used as a reference in some transaction
- For symbolic use of locks, I would have locking annotations in required repositories
- POST
{baseURL}/api/accounts
- creates a new account with a default balance of100
- GET
{baseURL}/api/accounts/{accountId}
- Returns an account with balance - POST
{baseURL}/api/transaction
- creates a new transaction between the provided accounts
- GET
{baseURL}/api/health
- Checks the health of the system, - GET
{baseURL}/api/accounts
- Returns List of all accounts (to have an idea of the updated balance for multiple accounts after a transaction) - GET
{baseURL}/api/accounts
- Returns List of all transactions
- Distributes the whole development into Small tasks
- Each Issue shows a feature
- Each commit shows a small progress
- Pull Requests are done for major tasks
To run the project locally using docker;
docker compose up --detach --wait
To tear down:
docker compose down --remove-orphans
To setup the project locally you need to clone this repo, from main
branch or some latest TAG
- Please sync and resolve the
maven
dependencies - Run
mvn clean install
- To run tests
mvn clean test
docker build -t fun-bank-service .
- Run
docker run -d -p 80:8080 fun-bank-service
- You may access the running docker app on
http://localhost/swagger-ui.html
- Docker Image Repository
- Run
docker run -d --name fun-bank-service -p 80:8080 naeemark/fun-bank-service
- You may access the running docker app on
http://localhost/swagger-ui.html
- Run
docker kill {container-id}
- JDK 1.8
- Spring Boot
- Docker
- MySQL
- Junit
- Mockito
- Swagger
- IntelliJ IDEA
- Jacoco
- Sonar
- Swagger
- JPA
- Hibernate
- Github Actions
- EC2 Instance for deployment
- No auth system is included in this solution
-
When a
pull request
is merged inmaster
,Github Action
starts and following steps are done by automated CI/CD:- Creates Environment and Runs all tests
- Complete a SonarQube analysis and pushes the results to Live Project
- Makes a deployment to Github packages (Mock)
- Creates the Docker Image and pushes to Docker Repository
-
As a next step, it is deployed manually in an ec2 instance.
- Forks are always appreciated