Code Monkey home page Code Monkey logo

bankapi2-meirjc's Introduction

BankApi2 - MeirJC


Description

This is a bank API project built using node.js, express and mongoDB. in this repository you will find only the backend side of the project.

The Github repository of the front-end part for this project is here. and is still under development

Live deployment ( via Netlify ) is available here

live deployment of the API is available at https://bankapi-2-wa.onrender.com. (which is also the base adress for all API calls)


How to use this project:

This is how every account object is stored in the database:

{
    "_id": "639e27607310a399a4feaea0", // uniqu id of the account - auto generated
    "firstName": "Ben", // first name  - required for every account
    "lastName": "Gurion", // last name - required for every account
    "ownerID": "11111", // ownerID of the account - required for every account -
    Length of ownerID is 5 digits - just the way i defined it.
    "email": "[email protected]", // email of the account owner - optional
    "balance": 100, // balance of the account - default (if not declared) = 0
    "credit": 500000, // credit of the account - default (if not declared) = 0
    "isActive": true, // is the account active  - optional, default is true
    "createdAt": "2022-12-17T20:32:32.368Z", // creation date of the account - auto genreted
    "__v": 0
}

Get all accounts

GET https://bankapi-2-wa.onrender.com/BankApi

Get specific account

GET https://bankapi-2-wa.onrender.com/BankApi/getaccount

Request body:

{"id": "639de29ec9a0404b03c76f39"}

Get all accounts by ownerID

GET https://bankapi-2-wa.onrender.com/BankApi/getallbyowner Request body:

{"ownerID": "12345"}

Add an account

POST https://bankapi-2-wa.onrender.com/BankApi/add

Request body:

{

--- Required ---

"firstName": "Avi", "lastName": "Ron", "ownerID": "12321",

--- Opional ---

"email": "[email protected]", "balance": "0", (default = 0), "credit": "5000", (default = 0),"isActive": true (default = true)

// ID is auto generated while creating account

}

Update account by id

POST https://bankapi-2-wa.onrender.com/BankApi/update

Request body:

{ "id": "639e04fdf2bfb269f5b75484", "isActive": "false" // Or any other fields you wish to update }

Delete an account

DELETE https://bankapi-2-wa.onrender.com/BankApi/delete

Request body:

{ "id": "639e04fdf2bfb269f5b75484" }

Deposit to account

PATCH https://bankapi-2-wa.onrender.com/BankApi/deposit

Request body:

{ "id": "639c8e8058c499a29216d96a", "amount": "1500" // amount of money to deposit }

Withdraw from account

PATCH https://bankapi-2-wa.onrender.com/BankApi/withdraw

Request body:

{ "id": "639c8e8058c499a29216d96a", "amount": "1500" // amount of money to withdraw }

Transfer between two accounts

POST https://bankapi-2-wa.onrender.com/BankApi/transfer

Request body:

{ "receiverId": "639c8e8058c499a29216d96a", "senderId": "639de273c9a0404b03c76f37", "amount": "150" }


bankapi2-meirjc's People

Contributors

meirjc avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.