A light-weight core banking application that supports a single bank and allows users create bank accounts and make withdrawals & deposits by visiting a local branch
https://tolulope-od.github.io/banka/
- Hosted App
- Pivotal Tracker Board
- API Documentation
- Built With
- Getting Started
- Application Features
- Installation
- Running Tests
- Deployment
- API endpoints
- License
- Author
- Acknowledgments
https://bankaa-app.herokuapp.com
https://www.pivotaltracker.com/n/projects/2319922
https://bankaa-app.herokuapp.com/api-docs/
Development
To clone and run this application, you'll need Git installed on your computer. From your command line:
# Clone this repository
$ git clone https://github.com/tolulope-od/banka.git
Refer to the .env.sample file for the required environment variables to get the application up and running.
Production
This application's frontend is served on this url and accomodates two types of users; a client and an admin/staff. All types of users share the same login page. The idea is to check the type of user upon login and then redirect to the appropriate pages. A sample admin login credential as it's stored in the database is:
email: obiwan@therebellion.com
password: password123
Upon successful login, the sole admin has the ability to add other staff and/or admin.
- User Registration
- Bank Account Creation
- Bank deposits and withdrawals
- Bank account management
To run this application in development mode, you'll need Node.js (which comes with npm) installed on your computer. From your command line:
# Enter the project directory
$ cd banka
# Install dependencies
$ npm install
# Start the development server
$ npm run dev
When the development server is up and running (i.e displays a success message on your command line), you can test the server response by visiting the following endpoint using Postman:
GET localhost:5000/
For a sample response from the server
Unit tests are available on this repository and dependencies to enable them work are included in the package.json
file. To run unit tests, you can do the following:
# Enter the project's directory
$ cd banka/
# To run the available unit tests
$ npm test
Install nyc globally to generate and view coverage reports via the command line
npm install -g nyc
Using Postman
If you have Postman installed, you can test routes listed below. An example response spec would be:
# on successful request to the sign in route /api/v1/auth/signin
{
"status": 200,
"data": [
{
"token": "kjkskjhfdsjhf_o.jkshdjhsj",
"id", 1,
"firstName": "Kylo",
"lastName": "Ren",
"email": "[email protected]"
}
]
}
# on errored request to the sign in route /api/v1/auth/signin
{
"status": 404,
"error": "User not found"
}
To build out the source code of this project into a browser-friendly and easily depolyable module, an npm script has been provided for that. Simply run the build script and deploy to the platform of your choice
# cd into project directory
$ cd banka/
# run build script
$ npm run build
Method | Endpoint | Description | Access |
---|---|---|---|
POST |
/api/v1/auth/signup |
Register a new user on the app | Clients |
POST |
/api/v1/auth/signin |
Login an existing user | Clients & Staff/Admin |
POST |
/api/v1/accounts |
Create an account | Client |
PATCH |
/api/v1/accounts/<account-number> |
Edit an accounts status | Admin/Staff |
DELETE |
/api/v1/account/<account-number> |
Delete an account | Admin/Staff |
POST |
/api/v1/transactions/<account-number>/debit |
Debit an account | Admin/Staff |
POST |
/api/v1/transactions/<account-number>/credit |
Credit an account | Admin/Staff |
GET |
api/v1/accounts/<account-number>/transactions |
View an account's Transaction history | Clients & Admin/Staff |
GET |
api/v1/user/<user-email-address>/accounts |
View all accounts owned by a specific user | Clients & Admin/Staff |
GET |
api/v1/accounts/<account-number> |
View aspecific account's details | Clients & Admin/Staff |
GET |
api/v1/accounts |
View a list of all bank accounts | Admin/Staff |
GET |
api/v1/accounts?status=active |
View a list of all active bank accounts | Admin/Staff |
GET |
api/v1/accounts?status=dormant |
View a list of all dormant bank accounts | Admin/Staff |
GET |
api/v1/user/<user-email-address>/accounts |
View all accounts owned by a specific user | Admin/Staff |
GET |
api/v1/users |
Admin get all staff | Admin/Staff |
PATCH |
api/v1/users |
Upgrade a client to a staff | Admin Only |
POST |
api/v1/users |
Admin create cashier | Admin Only |
Refer to the API Documentation for detailed information on all endpoints
This project is licensed under the MIT License - see the LICENSE file for details
- Tolulope Odueke
- Brad Traversy - MERN Stack Front To Back
- Bolaji Olajide - Intro to Building APIs