/basic-payment-system

A payment backend system in Go, uses in-memory store, mutex and concurrency.

Primary LanguageGo


Payment API

A basic payment backend system in Go, uses in-memory store, mutex and concurrency.

Key FeaturesHow To UseHow To run testsDownload

Key Features

  • Utilizes Go Maps as in-memory stores for accounts & transfers.
  • Initializes storage with singleton pattern to avoid any data loss.
  • Uses Gin web framework to run a web server.
  • Multi-layered architecture (Controller, Service, Model, Storage) for easy expansion.
  • Starts with an initial dataset of accounts link, which is processes concurrently into the datastore.
  • Utilizes Go Mutex to grantee atomic transfers between accounts.
  • Covered with tests to verify the flow.
  • Runs on the CLI without any installations effort.

How To Use

To clone and run this application, you'll need Git and Go. From your command line:

# Clone this repository
$ git clone https://github.com/mohamedsaberibrahim/basic-payment-system

# Go into the repository
$ cd basic-payment-system

# Install dependencies
$ go build

# Run the app
$ go run .

How to run tests

If you have make installed, you can run make test. If not, you can you go test -v ./...

Download

You can download the latest installable version of Payment API for Windows, macOS and Linux.