Chai Pani Bank API
A modern banking system API built with Node.js that provides account management and card services.
Table of Contents
Getting Started
Prerequisites
Docker
Docker Compose
Installation
Start the application using Docker Compose
The API will be available at http://localhost:3002
API Endpoints
Account Management
Create New Account
Creates a new bank account for a customer.
Endpoint: POST /api/v1/account/new
Headers:
Request Body:
Response:
Parameters:
accountHolderName
string
Yes
Full name of the account holder
accountHolderContactNo
string
Yes
Contact number of the account holder
panCardNo
string
Yes
PAN card number
Card Management
Create New Card
Creates a new debit or credit card linked to an existing bank account.
Endpoint: POST /api/v1/card/new
Headers:
Request Body:
Response:
Parameters:
bankAccountNo
string
Yes
Bank account number to link the card
cardType
string
Yes
Type of card (DEBIT/CREDIT)
provider
string
Yes
Card provider (VISA/MASTERCARD)
Update Card PIN
Updates the PIN for an existing card.
Endpoint: PATCH /api/v1/card/pin
Headers:
Request Body:
Response:
Parameters:
cardNumber
string
Yes
Card number to update PIN for
newPin
number
Yes
New 4-digit PIN
Response Format
All API responses follow a consistent structure:
Status Codes
200 OK- Request successful201 Created- Resource created successfully400 Bad Request- Invalid request parameters404 Not Found- Resource not found500 Internal Server Error- Server error
Error Handling
Error responses include detailed information about what went wrong:
Data Models
Account Model
Card Model
Environment Configuration
The application runs on port 3002 by default. You can modify the configuration in your docker-compose.yml file.
Security Notes
PINs are stored securely (consider implementing proper hashing in production)
All timestamps are in UTC
Account numbers and card numbers are auto-generated
IFSC codes follow the bank's internal format
Contributing
Fork the repository
Create your feature branch (
git checkout -b feature/AmazingFeature)Commit your changes (
git commit -m 'Add some AmazingFeature')Push to the branch (
git push origin feature/AmazingFeature)Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Chai Pani Bank - Serving your banking needs with a cup of tea! ☕
Last updated

