Skip to content
/ Banka Public

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.

Notifications You must be signed in to change notification settings

Shegsdev/Banka

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Coverage Status Maintainability

Banka

Banka is a lightweight 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 sign up and create bank accounts online, but must visit the branch to withdraw or deposit money.


Features

  1. User signup.
  2. User sign-in.
  3. User can create a bank account.
  4. User can view account details.
  5. User can view account transaction history.
  6. User can view a specific account transaction.
  7. Admin can view a specific user account.
  8. Admin/Staff can view all bank accounts.
  9. Admin/Staff can view a specific bank account.
  10. Admin/Staff can activate or deactivate a bank account.
  11. Admin/Staff can view all active bank accounts.
  12. Admin/Staff can view all dormant bank accounts.
  13. Staff can credit an account.
  14. Staff can debit an account.
  15. Admin/Staff can delete a bank account.

Templates

UI Templates for this application can be accessed via this link


Technologies Used

  • 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 patterns in JavaScript.
  • Airbnb style guide was followed.
  • PostgreSQL - Relational Database Management System.
  • Swagger - Document your code and keep a live and reusable OpenAPI (Swagger) specification.

Testing Tools

  • Mocha - A JavaScript test framework.
  • Chai - A test assertion library for JavaScript.
  • Supertest - A module that provides a high-level abstraction for HTTP testing.

API Information

  • The API for this application is documented using Swagger
  • 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 Get a specific user account api/v1/users/:id
POST Create a bank account api/v1/accounts
GET Get all bank accounts api/v1/accounts
GET Get a specific bank account api/v1/accounts/:acccountNumber
GET Get an account's transaction history api/v1/accounts/:accountNumber/transactions
GET Get a specific account's transaction api/v1/transactions/:transactionId
GET Get all accounts owned by specific user api/v1/user/:userEmail/accounts
GET Get a list of all active bank accounts api/v1/accounts?status=active
GET Get a list of all dormant bank accounts api/v1/accounts?status=dormant
PATCH Activate or Deactivate a bank account api/v1/accounts/:acccountNumber
POST Credit a bank account api/v1/transactions/:acccountNumber/credit
POST Debit a bank account api/v1/transactions/:acccountNumber/debit
DELETE Delete a bank account api/v1/accounts/:acccountNumber
DESCRIPTION REQUIRED FIELDS
Sign Up firstName, lastName, email, password
Sign In email, password
Create bank account firstName, lastName, email, type, password
Credit account cashier, amount
Debit cashier, amount
Activate/deactivate status

The Endpoints can be accessed remotely or locally.

Database setup

Before getting started, make sure to configure the database as follows:

  1. Download and install PostgreSQL using this link.

  2. In the project's root directory, create a .env file and add the following variables: SECRET=your_secret_key_here DB_URL=postgresql:https://username:password@host:port/database where your_secret_key_here refers to a custom secret key for the application (you can choose a secured key). username - username of the currently logged-in user on your local machine. password - password of the currently logged-in user on your local machine. host - database hostname, default is 127.0.0.1. port - database port, default is 5432.

  3. After successfully configuring the database, run the following commands to create the database: $ psql CREATE DATABASE banka $ npm run migration:create

    Optionally, you can seed the database by running: $ npm run migration:seed

    To drop the tables, run the following: $ npm run migration:drop

Accessing the endpoints remotely via POSTMAN

You will need to have POSTMAN app installed on your computer.

Example
Sign In
  1. Launch POSTMAN
  2. Click the dropdown menu to the left of the URL bar and select POST as a method.
  3. 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
  4. https://surebanka.herokuapp.com/api/v1/auth/signin
  5. Then paste the full URL in the URL bar.
  6. Click 'Body' tab below the URL, then select x-www-form-urlencoded radio button.
  7. Fill in the required fields correctly.
  8. Click the blue Send button to the right of the URL bar.
  9. And wait for a response.

Accessing the endpoints locally via POSTMAN

  1. On the terminal of your computer, navigate into the cloned repo's folder
  2. Make sure you have Node installed. If not click npm and Node.js to download npm and node.
  3. Clone the repo https://github.com/Shegsdev/Banka.git on your local machine.
  4. Run $ npm install to install all dependencies.
  5. Configure database (See Database setup above).
  6. Run $ npm run dev to power up the server.
  7. The procedure for using POSTMAN here is the same as when accessing the endpoint remotely except that you make use of http:https://localhost:5000 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:https://localhost:5000/api/v1/auth/signin

Test

You can locally run the test by running npm run dev and in a separate terminal window, run npm test.


Author

Shegsdev

You can follow me on Twitter

About

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.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published