This is a banking app that uses PostgreSQL, MongoDB, and RabbitMQ to handle transaction processing and account management. In this app where data synchronization happens between different databases using messaging queues.
- Account Creation: Create new accounts.
- Transaction Processing: Handle deposits and withdrawals.
- Data Synchronization: Synchronize data between PostgreSQL and MongoDB.
- Messaging System: Process transactions using RabbitMQ.
- PostgreSQL: Used for storing account and transaction data.
- MongoDB: Used for logging transaction statuses.
- RabbitMQ: Used for processing transaction messages.
- Golang: The primary programming language.
- Gin Framework: Used for building REST APIs.
-
Go must be installed. Download Go I'm using go 1.23 for this project
-
Docker must be installed. Download Docker
-
Clone the repository:
git clone [email protected]:asadlive84/banking-app.git
-
go to project folder:
cd banking-app
-
Now you have to run this command for install dependencies for this project:
go mod tidy
-
Run this project with Docker compose:
docker compose up --build
-
Now you can look this project structure and you find
banking-api.postman_collection.json
this postman collection, and can import this file in your postman client app and test it or you can look this API Endpoints example
- URL:
/accounts
- Method:
POST
- Request Body:
{ "name": "John Doe", "account_number": "1234567890", "balance": 1000.00 }
- Response Body:
{
"message": "Account created successfully"
}
- URL:
/transactions/deposit
- Method:
POST
- Request Body:
{ "account_id": "1234567890", "amount": 500.00, }
- Response Body:
{
"message": "Deposit request submitted"
}
- URL:
/transactions/withdraw
- Method:
POST
- Request Body:
{ "account_id": "1234567890", "amount": 200.00, }
- Response Body:
{
"message": "Withdrawal request submitted"
}
- URL:
/accounts/ACC12345
- Method:
GET
- Response Body:
{
"account_id": "ACC12345",
"balance": 1499
}
- URL:
/transactions/ACC12345
- Method:
GET
- Response Body:
[
{
"_id": "67c97193dee000d89cee3e24",
"account_id": "ACC12345",
"amount": 500,
"status": "completed",
"timestamp": "2025-03-06T09:57:39.339Z",
"type": "deposit"
},
{
"_id": "67c97196dee000d89cee3e25",
"account_id": "ACC12345",
"amount": 1,
"status": "completed",
"timestamp": "2025-03-06T09:57:42.054Z",
"type": "withdraw"
},
{
"_id": "67c9738fdee000d89cee3e26",
"account_id": "ACC12345",
"amount": 1,
"status": "completed",
"timestamp": "2025-03-06T10:06:07.683Z",
"type": "withdraw"
},
{
"_id": "67c97392dee000d89cee3e27",
"account_id": "ACC12345",
"amount": 500,
"status": "completed",
"timestamp": "2025-03-06T10:06:10.364Z",
"type": "deposit"
}
]