This project is a Wallet Transactional API built with Ruby on Rails and PostgreSQL. It provides a generic wallet solution for money movement between different entities such as User, Stock, Team, etc. Each entity has its own defined "wallet" to which we can transfer money or withdraw.
- Wallet transactions between entities (User, Stock, Team, etc.)
- Database transactions to comply with ACID standards
- Simple Sign In
- LatestStockPrice library for fetching stock prices
POST /api/v1/sign_in
- Sign inDELETE /api/v1/sign_out
- Sign outPOST /api/v1/transactions/:wallet_id/transfer
- Transfer money from one wallet to anotherPOST /api/v1/transactions/:wallet_id/withdraw
- Simple Withdraw money from a walletPOST /api/v1/transactions/:wallet_id/topup
- Top up a walletGET /api/v1/transactions/:wallet_id/balance
- Get wallet balanceGET /api/v1/stocks/price
- Get the price of a specific stockGET /api/v1/stocks/prices
- Get the prices of multiple stocksGET /api/v1/stocks/price_all
- Get the prices of all stocks
- Ruby 3.0.0
- Rails 7.0.0
- PostgreSQL
- Clone the repository
git clone https://github.com/muhammadtaufan/wallet-app.git
- Run
bundle install
to install dependencies - Copy the
.env.sample
file to a new file named.env
and fill in the necessary environment variables - Run
source .env
to load the environment variables - Run
rails db:create db:migrate db:seed
to setup the database - Run
rails server
to start the server
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.