Giter VIP home page Giter VIP logo

simple-bank-system's Introduction

Bank System Simulator

An API with educational purposes that simulates bank operations. At first created to improve my knowledge of Node.js, Express and MongoDB but now it is available to everyone enjoy and build their own Frontend Applications (web or mobile).

Installation

If you want to test it locally, you can follow the following steps to install and run it successfully.

Requirements:

  • Git installed
  • Node.js installed

Steps

First, clone the repository: git clone https://github.com/mablds/simple-bank-system.git

Then install it using the dependecy manager of your preference like NPM: npm install

Usage

This API is public and hosted by Heroku for education purposes. So if you are interest to test it without clone and run locally, feel free to play around consulting this Documentation.

Routes

There are just few routes that were created to study about APIs and how to deal with NoSQL databases.

Home

- URL: '/'
- HTTP Method: GET
- Params: None
- Headers: None

Bank Queries

Requests:

Methods Rotas Admin Action Expected response Status Code
GET /bank ✔️ List of all bank accounts Bank accounts array 200
GET /bank/:account Get the informations about an specific account User object 200
POST /bank/create Create a bank account Bank Account created 201
POST /bank/deposit Deposit a value to the account informed Value deposited 200
POST /bank/withdraw Withdraw a value of an account informed Value withdrawed 200
PUT /bank/transfer Transfer a value between accounts informed Value transfered 200
DELETE /bank/delete ✔️ Delete an bank account Bank Account deleted 202

How to authenticate:

Route: /auth
Method: POST,
AdminPrivilege: false,
Header: --,
Body: {
        email: [email protected],
        password: "teste"
    }

How to get all Account's info:

Route: /bank
Method: GET,
AdminPrivilege: true,
Params: Account number
Header: --,
Body: --

How to get an Account's info:

Route: /bank/:account
Method: GET,
AdminPrivilege: false,
Params: Account number
Header: x-access-token: token,
Body: --

How to create a Bank Account:

Route: /bank/create
Method: POST,
AdminPrivilege: false,
Header: --,
Body: {
    "owner": "teste",
    "email": "[email protected]",
    "password": "teste"
}

How to deposit to a Bank Account:

Route: /bank/deposit
Method: POST,
AdminPrivilege: false,
Header: --,
Body: {
    "account": 000,
    "value": 3000
}

How to withdraw of a Bank Account:

Route: /bank/withdraw
Method: POST,
AdminPrivilege: false,
Header: x-access-token: token,
Body: {
    "owner": "teste",
    "account": 000,
    "value": 3000
}

How to transfer between accounts:

Route: /bank/transfer
Method: PUT,
AdminPrivilege: false,
Header: x-access-token: token,
Body: {
    "outAccount": 7233,
    "incAccount": 265,
    "value": 1000
}

How to delete accounts:

Route: /bank/delete
Method: DELETE,
AdminPrivilege: true,
Header: x-access-token: token,
Body: {
    "account": 0000,
}

simple-bank-system's People

Contributors

mablds avatar sumangalakm1 avatar nivigh 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.