An online bank system built with node.js & express.js
- User
Endpoint | Method | Body |
---|---|---|
/user/register |
POST |
{ "ssn" : [number] , "first_name" : [string] , "last_name" : [string] , "email" : [string] , "password" : [string] , "address" : [string] , "phone" : [number] } |
/user/auth |
POST |
{ "email" : [string] , "password" : [string] , } |
/user/update |
PUT |
{ "first_name" : [string] , "last_name" : [string] , "email" : [string] , "password" : [string] , "address" : [string] , "phone" : [number] } |
/user/delete |
DELETE |
- Account
Endpoint | Method | Body |
---|---|---|
/account/open |
POST |
{ "balance" : [number] , "type" : [string] , "pin" : [number] } |
/account/close |
DELETE |
{ "account_no" : [number] } |
/account/transaction/:account_no |
GET |
|
/account/balance/:account_no |
GET |
|
/account/withdraw |
POST |
{ "account_no" : [number] , "amount" : [number] , } |
/account/deposite |
POST |
{ "account_no" : [number] , "amount" : [number] , } |
/account/deposite/card |
POST |
{ "number" : [number] , "cvv" : [number] , "pin" : [number] , "amount" : [number] , } |
/account/withdraw/card |
POST |
{ "number" : [number] , "cvv" : [number] , "pin" : [number] , "amount" : [number] , } |
/account/transfer |
POST |
{ "source" : { "number" : [number] , "cvv" : [number] , "pin" : [number] , } , "destination: : { "number" : [number] , "cvv" : [number] , "pin" : [number] , } "amount" : [number] , } |
The application uses Bearer authentication
. The token is generated by /user/auth
call and will last for 30 mins by default. The protocol used is https
for a secure data transmission.
Each response for the listed API calls above will have error
key, if its value is 0
that means the operation succeeded otherwise which is 1
means it's failed
For now, you can use the application locally by cloning the project in your local machine then
run : npm install
to install the required packages
run : npm start
to initialize database tables and run server
Customer should first create a profile providing his personal info, then using a valid token he can then open an account with any amount of money. The account generated will be attached with a debit card, the card will have number , CVV and PIN. User can make any transactions using this info or with his account number and a valid authentication token.
The application is hosted on : https://sprints-bank-system.herokuapp.com/
You can change the default configurations found in config.js
file such as the session_timeout
for each token generated in minutes