Skip to content

vivek-344/banking-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Banking System

This project provides APIs for a banking system backend with the following functionalities:

Features

  1. Bank Account Management

    • Create and manage bank accounts.
    • Bank accounts consist of:
      • Owner’s Name
      • Balance
      • Currency
  2. Transaction Records

    • Record every balance change for each account.
    • Create an account entry record for every deposit, withdrawal, or transfer.
  3. Money Transfers

    • Perform money transfers between two accounts.
    • Ensure transactional integrity: updates to both accounts occur together, or none of the updates are applied.

Tools and Dependencies

Core Tools

  • Docker
    For running postgres image.

  • TablePlus
    A GUI tool for interacting with the database.

  • Golang
    The programming language used for backend development.

Database Migrations

  • Migrate
    Used for database schema migrations.

    Installation:

    curl -L https://packagecloud.io/golang-migrate/migrate/gpgkey | apt-key add -
    echo "deb https://packagecloud.io/golang-migrate/migrate/ubuntu/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/migrate.list
    apt-get update
    apt-get install -y migrate

SQL Code Generation

  • Sqlc
    Used to generate type-safe Go code from SQL queries.

    Installation:

    sudo snap install sqlc

Mock Testing

  • Gomock
    Used for generating mock objects for unit testing.

    Installation:

    go install github.com/golang/mock/mockgen

Setup Instructions

  1. Install Dependencies
    Ensure all tools mentioned above are installed on your system.

  2. Run Migrations
    Use migrate to apply database migrations. For example:

    migrate -path db/migrations -database "postgres://user:password@localhost:5432/dbname?sslmode=disable" up
  3. Run Tests
    To run tests:

    make test
  4. Build and Run the Application
    To run the application and start the server:

    make server

Contributing

  • Follow the Git workflow for feature development.
  • Ensure your code is covered by unit tests.
  • Run all tests before submitting a pull request.

This README serves as a guide for setting up and understanding the Banking System project.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published