This is pure functional bank written in Scala 2.13.2 using Typelevel (cats stack).
- Scala 2.13.2
- Sbt
- Docker
To build the Tiny bank, follow these steps:
- Clone the repository to your local machine or download the source code as a ZIP file.
- Navigate to the project directory.
- Compile project using:
This command compiles the source code.
sbt compile
- Create docker image:
sbt docker:publishLocal
- Run docker-compose
docker-compose up
In order to see all Tiny bank features and functions you need to proceed to:
http://<host>:<port>/docs
- Create Tiny bank client using
/clients/register
endpoint. - In order to run any operations with client, firstly you need to login. Do it by using
/clients/login
login. After calling that endpoint, you will receive session-token in cookie. - Now, after you logged in into the system, you can create your first bank account. Do it by using
/accounts/create
endpoint. You will receive a bank account id. Number of bank accounts not more than three. - You can do following operations with your bank account, using very same id you received early:
- Top up:
/accounts/deposit/{your_id}
- Withdraw:
/accounts/withdraw/{your_id}
- Current Balance:
/accounts/balance/{your_id}
- Transaction to other account:
/accounts/transfer/{your_id}
- Top up:
- This project was developed using Scala 2.13.2 and tapir. Ensure you have Scala 2.13 installed and properly configured on your system.
Contributions to this project are welcome! If you'd like to contribute, please follow these steps:
- Fork the repository on GitHub.
- Clone the forked repository to your local machine.
- Create a new branch for your contribution:
git checkout -b feature/your-feature
- Make your changes and commit them with descriptive commit messages.
- Push your changes to your forked repository.
- Create a pull request on the original repository, explaining your changes.
This project is licensed under the MIT License. See the LICENSE file for more information.