Chinta Mat Karo 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

  1. Start the application using Docker Compose

The API will be available at http://localhost:3003

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:

Parameter
Type
Required
Description

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:

Parameter
Type
Required
Description

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:

Parameter
Type
Required
Description

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 successful

  • 201 Created - Resource created successfully

  • 400 Bad Request - Invalid request parameters

  • 404 Not Found - Resource not found

  • 500 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 3003 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

  1. Fork the repository

  2. Create your feature branch (git checkout -b feature/AmazingFeature)

  3. Commit your changes (git commit -m 'Add some AmazingFeature')

  4. Push to the branch (git push origin feature/AmazingFeature)

  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.


Chinta Mat Karo Bank - Banking without worries! 😌💸

Last updated