The main goal of this web app is to provide a banking API service to users who want to integrate a dummy bank into their finance applications. Initially, this project was going to be only a backend service providing APIs, but then I decided to build the frontend too.
Frontend Link
Backend Link
- User Authentication (Login, Register)
- Add Money to Account
- Transfer Money Between Accounts
- View Transaction History
- View user account balance
- Responsive UI, mobile responsive UI
- Notifications received when request from other app
- Integrate payment service with BookNest (working on it)
- Node.js
- Ensure you have MongoDB Atlas set up. Obtain your connection string.
You can directly run container of this application using this docker image which is available publicly on dockerhub
- Clone the repo:
git clone https://github.com/yourusername/banking-service.git
- Install NPM packages for backend:
cd backend npm install
- Install NPM packages for frontend:
cd backend npm install
- Start the backend server
cd backend npm start
- Start the frontend server
cd frontend npm start
This section provides detailed documentation for the API endpoints available in this project. The API is divided into two main sections: /userAuth
and /userMoney
.
The API documentation currently is sort of outdated, will change and add all the additional routes that were created. Some api routes response data was also changed.
Will post the entire API documentation of the base path of the api link possibly.
- Endpoint:
/userAuth/register-new
- Method:
POST
- Description: Creates a new user in the MongoDB database and returns the user object.
- Request Body:
{ "username": "your_username", "password": "your_password" }
- Response: The whole user object is returned
- Endpoint:
/userAuth/login
- Method:
POST
- Description: Login for the user, required for using in the frontend.
- Request Body:
{ "username": "your_username", "password": "your_password" }
- Response: The whole user object is returned
- Endpoint: /userMoney/balance/:username
- Method: GET
- Description: Retrieves the balance amount for the specified user.
- URL Parameters: username (string): The username of the user.
- Response:
{ "balance": 1000 }
- Endpoint: /userMoney/addMoney
- Method: POST
- Description: Adds money to the user's account and returns the updated balance and transaction details.
- Request Body:
{ "username": "your_username", "amount": 100, "description": "Deposit" }
- Response:
{ "balance": 1100, "transaction": { "amount": 100, "description": "Deposit", "transactionType": "Debit" } }
- Endpoint: /userMoney/transferMoney
- Method: POST
- Description: Credits or debits money from the user's account and returns the updated balance and transaction details.
- Request Body:
{ "username": "your_username", "amount": 50, "description": "Transfer" }
- **Response:- **
{ "balance": 1050, "transaction": { "amount": 50, "description": "Transfer", "transactionType": "Credit" } }
- Endpoint: /userMoney/transaction-history/:username
- Method: GET
- Description: Retrieves the transaction history for the specified user.
- URL Parameters: username (string): The username of the user.
- Response:
{ "transactions": [ { "amount": 100, "description": "Deposit", "transactionType": "Debit", "date": "2024-06-12T12:34:56.789Z" }, { "amount": 50, "description": "Transfer", "transactionType": "Credit", "date": "2024-06-12T12:45:56.789Z" } ] }