/sysco-pos-nodejs-server

NodeJS Backend API for Sysco POS system

Primary LanguageHTML

Sysco Point of Sales System - REST API

Codacy Badge Build Status codecov GitHub Release Date Website GitHub repo size in bytes Repo description

This repository contains source code related to the back end REST API implemented as one of the requirements in Sysco LABS induction program 2019. Source code is developed using NodeJS using VSCode IDE. There are two branches maintained in this project.

  • development branch containing source code under development
  • deployment hosting branch in Heroku. Pushes to this branch will deploy the content in the hosted API

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

What things you need to install the software and how to install them

Installing

Configuring the project in your own workstation is easy. First, make sure the prerequisites tools and libraries are installed. Clone the project and install dependencies using npm install command. Once all the dependencies are set, go to root folder and run node server.js. It will display on which port the application has started and a link to access the API. You will require to set an environment variable for database connection.

$ export DATABASE_URL=mongodb://localhost:27017/[db name here]

Running the tests

API is fully integrated with unit testing and it covers almost 100% of source code. Tests can be run using the following command on a single test file by defining the file name or on the whole project by simply omitting the file name parameter.

$ npm test <file-name>

Deployment

This API is deployed in a free Heroku platform. There might be slight delays in responses due to the use of free dynos. In order to deploy your own version of this API, please follow deployment instructions provided in Heroku. URL for the API is sysco-pos-rest-api.herokuapp.com/api. Swagger documentation can be found in the swaggerhub

Maintainer