Giter VIP home page Giter VIP logo

maimabank's Introduction

Maima Bank

MaimaBank is a service that provides APIs to enable the frontend to perform the following tasks:

  1. Create and manage bank accounts, which consist of the account owner's name, balance, and currency.
  2. Record all balance changes made to each account. Every time an amount is added to or subtracted from an account, an account entry record is generated.
  3. Transfer funds between two accounts. This happens as a transaction, ensuring that both accounts' balances are either successfully updated or not updated at all.
  4. Generate account statements for a given account, which consist of a list of account transfers.
  5. Add support for multiple currency transfers. Each account can only hold one currency, and transfers between accounts with different currencies will be automatically converted using the latest exchange rate.

To-do

  1. Add support for loan accounts. Loan accounts are accounts that can have a negative balance. When a loan account is created, a loan limit is set. The account balance can go down to the negative of the loan limit. For example, if the loan limit is 1000, the account balance can go down to -1000. When a loan account is created, the account balance is set to 0.
  2. Add support for loan repayments. Loan accounts can be topped up by transferring funds from another account. The transfer amount is added to the loan account balance. For example, if the loan account balance is -500 and the transfer amount is 200, the new loan account balance will be -300.
  3. Add support for loan repayments with interest. Loan accounts can be topped up by transferring funds from another account. The transfer amount is added to the loan account balance, and an interest amount is added to the transfer amount. For example, if the loan account balance is -500, the transfer amount is 200, and the interest rate is 10%, the new loan account balance will be -280.
  4. Add support for loan repayments with interest and fees. Loan accounts can be topped up by transferring funds from another account. The transfer amount is added to the loan account balance, an interest amount is added to the transfer amount, and a fee is deducted from the transfer amount. For example, if the loan account balance is -500, the transfer amount is 200, the interest rate is 10%, and the fee is 5, the new loan account balance will be -285.
  5. Add support for creating and managing savings accounts. Savings accounts are accounts that can only hold one currency and cannot have a negative balance. When a savings account is created, an interest rate is set. The interest rate is used to calculate the interest amount that is added to the account balance at the end of each month. For example, if the interest rate is 10% and the account balance is 1000, the interest amount added to the account balance at the end of the month will be 100.
  6. Add support for creating and managing savings accounts with fees. Savings accounts are accounts that can only hold one currency and cannot have a negative balance. When a savings account is created, an interest rate is set. The interest rate is used to calculate the interest amount that is added to the account balance at the end of each month. For example, if the interest rate is 10% and the account balance is 1000, the interest amount added to the account balance at the end of the month will be 100. A fee is deducted from the account balance at the end of each month. For example, if the fee is 5, the account balance will be deducted by 5 at the end of each month.
  7. Add Mpesa integration. Mpesa is a mobile money service that allows users to send and receive money. Mpesa integration allows users to transfer funds from their Mpesa account to their bank account and vice versa.
  8. Security Upgrade. Add support for two-factor authentication, security questions, and other security features.
  9. Do let me know of other features you would like to see in the service by raising an issue.

Last Step: Deploy to production and build an Android/Web app to consume the Bank API.

Setup local development

Install tools

Before setting up the service locally, you need to install the following tools:

Setup infrastructure

After installing the above tools you can proceed to setup your environment with below steps:

  1. Run the following command to setup postgres:

    make postgres
  2. Create a new database:

    make createdb

How to generate code

Use the following commands to generate code:

  • Generate schema SQL file with DBML:

    make db_schema
  • Generate SQL CRUD with sqlc:

    make sqlc
  • Generate DB mock with gomock:

    make mock
  • Create a new db migration:

    migrate create -ext sql -dir db/migration -seq <migration_name>

How to run

Use the following commands to run the service:

  • Run server:

    make server
  • Run test:

    make test

maimabank's People

Contributors

malcolmmaima avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.