Banka is a light-weight core banking application that powers banking operations like account creation, customer deposit and withdrawals. This app is meant to support a single bank, where users can signup and create bank accounts online, but must visit the branch to withdraw or deposit money..
Features Implemented
- User can sign up.
- User can sign in.
- Admin can fetch a specific user account.
- User can upload a profile photo.
- User can create a bank account.
- Admin/staff can fetch a specific bank account.
- Admin/staff can activate or deactivate a bank account.
- User can retrieve his/her account balance.
- Staff can credit an account.
- Staff can debit an account.
- Admin/staff can delete a bank account.
UI Templates for this application are live on Github Pages
- Node.js - A runtime environment based off of Chromes's V8 Engine for writing Javascript server-side applications.
- Express.js - Web application framework based on Node.js.
- ESLint - A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript.
- Airbnb style guide was followed.
- Mocha - A JavaScript test framework.
- Chai - A test assertion library for JavaScript.
- Supertest - A module that provides high-level abstraction for HTTP testing.
The API endpoints are hosted on Heroku - Banka
METHOD | DESCRIPTION | ENDPOINT |
---|---|---|
POST | Sign Up | api/v1/auth/signup |
POST | Sign In | api/v1/auth/signin |
GET | Fetch a specific user account | api/v1/users/:id |
POST | Upload profile photo | api/v1/users/:id/profilephotos |
POST | Create a bank account | api/v1/accounts |
GET | Fetch a specific bank account | api/v1/accounts/:acccountNumber |
PATCH | Activate or Deactivate bank account | api/v1/accounts/:acccountNumber |
GET | Check account balance | api/v1/accounts/:acccountNumber/balance |
POST | Credit account | api/v1/transactions/:acccountNumber/credit |
POST | Debit account | api/v1/transactions/:acccountNumber/debit |
DELETE | Delete bank account | api/v1/accounts/:acccountNumber |
DESCRIPTION | REQUIRED FIELDS |
---|---|
Sign Up | firstName, lastName, email, password |
Sign In | email, password |
Upload profile photo | profilePhoto |
Create bank account | firstName, lastName, owner, email, type, openingBalance |
Credit account | cashier, amount, remark |
Debit | cashier, amount, remark |
amount and openingBalance should be in two decimal places e.g 200.50
You will need to have POSTMAN app installed on your computer.
- Launch POSTMAN
- Click the dropdown menu to the left of the URL bar and select POST as a method.
- To access the Sign In endpoint, at the end of Banka's URL attach the sign in endpoint to it as seen in step 4
- https://hibanka.herokuapp.com/api/v1/auth/signin
- Then paste the full URL in the URL bar.
- Click 'Body' tab below the URL, then select x-www-form-urlencoded radio button.
- Fill in the required fields correctly.
- Click the blue Send button to the right of the URL bar.
- And wait for a response below.
Upload profile photo endpoint uses form-data instead of x-www-form-urlencoded
- On the terminal of your computer, navigate into the cloned repo's folder
- Click npm and Node.js to get npm and node respectively.
- Clone Banka repo
https://github.com/VictorMaria/Banka.git
on your local machine. - Run
$ npm install
to install All of Banka's dependencies. - Run
$ npm start
to power up the server. - The procedure for using POSTMAN here is the same as when accessing the endpoint remotely except that you make use of http://localhost:3000 as the full URL's prefix in place of the app's URL on heroku e.g To access Sign In endpoint you will have a full URL like http://localhost:3000/api/v1/auth/signin
You can locally run the test by running npm test
in the cloned repo directory opened in a new terminal window while the server runs on the first window. It is important that the server is running for the tests to pass.