Skip to content

Backend service to control an appliance such as a washing machine

Notifications You must be signed in to change notification settings

Yaro96/Appliance

Repository files navigation

Appliance

This is an example of an implementation in NodeJS of a backend service used to control an appliance such as a washing machine.

Installation

Requirements
  • Node.js v8.2.1+
  • npm v5.3.0+
  • MySQL environment such as XAMPP if on Windows

First create a database called "appliance" and import the strucure from the file "appliance.sql" found in the root folder of the project.

Modify the ./config/mysql.config.js file according to your MySQL environment, setting the host address, the user and the password.

const parameters={
    host: 'localhost',
    user: 'root',
    password: '',
    database: 'appliance'
};

Check if you are running npm in development environment

$ npm config get production

It should return false, if not set it with:

$ npm config set -g production false

Install the dependencies and start the server, it will run on localhost:3000

$ cd Appliance
$ npm install
$ npm start

Run the unit test from another console window

$ npm test

It should pass 43 tests.

Routes

For executing the API calls manually, I suggest using Postman

Reset
Models
Centrifuges
Units

About

Backend service to control an appliance such as a washing machine

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages