Giter VIP home page Giter VIP logo

project-bank-heist's Introduction

Bank Heist

[]: # Language: markdown []: # Path: README.md

Description

The application provides a rudimentary online banking template. It is a full stack application that primarily utilises Node.js and it employs the MVC pattern.

The application has a front end that is built using Javascript and Bootstrap and a back end that is built using Node.js.

The back end database uses MySQL.

The back end also provides a REST API that is used serverside end as well as a REST API that can be accessed directly from the Front End. Both of these APIs require Authentication.

Table of Contents

Installation

'npm i' to install the necessary dependencies.

Create a file named .env with the following contents:

DB_NAME=bank_db
DB_USER=root
DB_PASSWORD=yourpassword
DB_HOST=yourDbHostIp
PORT=DBPort

Setting up the database

run schema.sql at a mySQL prompt to create the database and tables.

source ./db/schema.sql

run 'npn run seed' to seed the database with some data.

source ./db/seeds.sql

Usage

The application supports the follwing funcitonalities:

Users

1. Create a new user
2. Login an existing user

Accounts

1. Create a new account
2. View all accounts and balances
3. View an account and its associated transactions

Transactions

1. Create a new transaction

API

Logout

curl --request POST \
  --url http://localhost:3001/api/user/logout/ \
  --cookie connect.sid=s%253ArSlAvio9CwZvRZtFePi0QDUbS0-QQ9X8.kv9oK0dAJ6%252BEhgRbnFq0suJdSwDBfLA%252BhZUBC7od4%252B8

Login

curl --request POST \
  --url http://localhost:3001/api/user/login/ \
  --header 'Content-Type: application/json' \
  --cookie connect.sid=s%253ArSlAvio9CwZvRZtFePi0QDUbS0-QQ9X8.kv9oK0dAJ6%252BEhgRbnFq0suJdSwDBfLA%252BhZUBC7od4%252B8 \
  --data '{
	"email" : "[email protected]",
	"password" : "password123456"
}'

Create User

curl --request POST \
  --url http://localhost:3001/api/user/ \
  --header 'Content-Type: application/json' \
  --cookie connect.sid=s%253ArSlAvio9CwZvRZtFePi0QDUbS0-QQ9X8.kv9oK0dAJ6%252BEhgRbnFq0suJdSwDBfLA%252BhZUBC7od4%252B8 \
  --data '{
	"username" : "test7",
	"email" : "[email protected]",
	"password" : "password123456"
}'

Create Account

curl --request POST \
  --url http://localhost:3001/api/account/ \
  --header 'Content-Type: application/json' \
  --cookie connect.sid=s%253ArSlAvio9CwZvRZtFePi0QDUbS0-QQ9X8.kv9oK0dAJ6%252BEhgRbnFq0suJdSwDBfLA%252BhZUBC7od4%252B8 \
  --data '{
	"account_name" : "savings_account",
	"interest_rate" : 0.5,
	"balance" : 15000
}'

Get Account

curl --request GET \
  --url http://localhost:3001/api/account/6 \
  --header 'Content-Type: application/json' \
  --cookie connect.sid=s%253ArSlAvio9CwZvRZtFePi0QDUbS0-QQ9X8.kv9oK0dAJ6%252BEhgRbnFq0suJdSwDBfLA%252BhZUBC7od4%252B8

Get A Transaction

curl --request GET \
 --url http://localhost:3001/api/account/6 \
 --header 'Content-Type: application/json' \
 --cookie connect.sid=s%253ArSlAvio9CwZvRZtFePi0QDUbS0-QQ9X8.kv9oK0dAJ6%252BEhgRbnFq0suJdSwDBfLA%252BhZUBC7od4%252B8

Get All Transactions for an Account

    curl --request GET \
  --url http://localhost:3001/api/transaction/ \
  --header 'Content-Type: application/json' \
  --cookie connect.sid=s%253ArSlAvio9CwZvRZtFePi0QDUbS0-QQ9X8.kv9oK0dAJ6%252BEhgRbnFq0suJdSwDBfLA%252BhZUBC7od4%252B8 \
  --data '{
	"account_id": 34
}'

Creat a Transaction

curl --request POST \
  --url http://localhost:3001/api/transaction/ \
  --header 'Content-Type: application/json' \
  --cookie connect.sid=s%253ArSlAvio9CwZvRZtFePi0QDUbS0-QQ9X8.kv9oK0dAJ6%252BEhgRbnFq0suJdSwDBfLA%252BhZUBC7od4%252B8 \
  --data '{
	"amount": 20.00,
	"account_from_id": "6",
	"account_to_id":2,
	"user_id":1
}'

Screenshots

alt Homepage

alt Accounts

alt Transfer

alt Statement

API

alt Landing Page

Front End

Deployment

Deployed Version

Docker

Docker Repository

License

This project is licenced under MIT

Questions

More of my work can be found here

TODO: Add other team members Github links

ToDo

The applicaiton needs:

    * More robust authentication on endpoints.  The current application allows any      
      authenticated user to access any transactions.  This is not secure.
    * Tests adding
    

project-bank-heist's People

Contributors

chrisaylen avatar shingchan95 avatar muyawia avatar dependabot[bot] 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.