Giter Club home page Giter Club logo

support's Introduction

customer-service-app

Build Status Coverage Status

Overview

The customer-service-app is an application that allows users logs complaints or request for support.

  • Key Application features
  1. Functional requirements

    • Creation of Support requests
    • Fetching support requests
    • Updating support requests
    • Closing support requests logged
    • Download CSV file of closed support requests for the last month
  2. Comment

    • Users can comment on a support request

Technology Stack

  • Nodejs
  • Typescript
  • Express
  • Mongodb
  • Jest

Libraries used

  • You can get the details of the libraries used in the package.json file in the root directory of this project

Setting Up For Local Development and Testing

  • Check that NodeJs is installed on your machine, if not installed follow this link to download and install nodejs:

  • Clone the repo and cd into it:

    #!/bin/bash
    git clone https://github.com/dbytecoderc/test-app.git
  • Install dependencies using the command bellow:

    #!/bin/bash
    yarn install
  • Make a copy of the .env.sample file in the app folder and rename it to .env and update the variables accordingly, it important that you copy the email and password details in that file just the way it is, you would need it to test admin functionalities and make sure the db urls are set to make sure the tests run:

    #!/bin/bash
    PORT=3000
    MONGODB_URI="mongodb://127.0.0.1/fliqpay"
    MONGO_URI_TEST="mongodb://127.0.0.1/fliqpay-test"
    SECRET_KEY="secretKey"
    ADMIN_PASSWORD="Admin0007"
    NON_ADMIN_PASSWORD="User0007"
    HASHED_ADMIN_PASSWORD='$2a$10$4IIoa9h4th7aPsMhWP7/Xu97SdwcUjImhyDHDsSK1wssiaIr0M.hm'
    HASHED_NON_ADMIN_PASSWORD='$2a$10$WSwcXM1dIaygWLaSQMxAD.cNBDZmykPNJOWOkjwpiFiPr8CrT68ha'

NOTE: It is important that the MONGO_URI_TEST is set because the integration tests depend on it to run

  • Run the application with the command
  #!/bin/bash
yarn start:dev
  • Data is seeded into the application as soon as you fire up the server, without needing to create a user you can login and create a json web token which is to be attached to the header in this format
  #!/bin/bash
Bearer 'sample token'
  • Use these details to login an admin user
  #!/bin/bash
{
    "email": "[email protected]",
    "password": "Admin0007"
}
  • Use these details to login a non-admin user
  #!/bin/bash
{
    "email": "[email protected]",
    "password": "User0007"
}

Running tests

Make sure the environment variable for the test database MONGO_URI_TEST is set for this to work

  #!/bin/bash
yarn test

NOTE: All the seed data are baked into the testing process, you won't need to run any script to seed data for tests, and as soon as the application relevant data is seeded into the application to ease manual testing

API Endpoints

  • Use the link below in the thumbnail to download a postman collection for the endpoints Run in Postman

  • Alternatively you can use this link to view the api documentation in your browser.

  • After visiting the link you can click on the dropdowns of each request to view preset examples of request edge-cases covered.

support's People

Contributors

oldmonad avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.