Skip to content

oleesir/banka

Repository files navigation

Build Status Maintainability Test Coverage codecov

banka

A banking application that helps users perform banking transactions.

Table of Contents

  1. Hosted App
  2. Pivotal Tracker Board
  3. API Documentation
  4. Built With
  5. Supporting packages
  6. Application Features
  7. Getting Started
  8. Running Tests
  9. API endpoints
  10. License
  11. Author

Hosted App

https://wayfarer-appy.herokuapp.com

Pivotal Tracker Board

https://www.pivotaltracker.com/n/projects/2320085

API Documentation

coming soon

Built With

Supporting packages

Linter

Compiler

Test Tools

  • Mocha - JavaScript Test Framework for API Tests (Backend)
  • Chai - TDD/BDD Assertion Library for Node
  • Supertest - Super-agent driven library for testing node.js HTTP servers

Application Features

  • User Registration
  • User can book a trip
  • User can view all trips
  • Admin can create a trip
  • Admin can cancel a trip
  • Admin can view all trips and bookings
  • Admin can get a list of filtered trips based on origin and destination.

Getting Started

Installation

  • Install NodeJS and PostgreSQL on your computer
  • Clone this repository using git@github.com:oleesir/wayfarer-api.git
  • Use the .env.example file to setup your environmental variables and rename the file to .env
  • Run npm install to install all dependencies
  • Run npm run build to build the project
  • Run npm start to start the server
  • Navigate to localhost:3000 in browser to access the application

Running Tests

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 wayfarer/

# To run the available unit tests
$ npm run test

Install nyc globally to generate and view coverage reports via the command line

npm install --save-dev 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": "success",
  "data": {
      "token": "jbhfuhbfhrb_r.iufnr3uinrufrf",
      ​“user_id”​:​Integer,​ 
 ​     “is_admin”:Boolean​ 
    } 
}
# on errored request to the sign in route /api/v1/auth/signin
{
  "status": 404,
  "error": "User not found"
}

API endpoints

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> View aspecific account's details Clients & Admin/Staff
GET api/v1/accounts View a list of all bank accounts Admin/Staff

License

This project is licensed under the MIT License - see the LICENSE file for details

Author

Olisa Emodi

About

A banking application that helps users perform banking transactions.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published