Before start working on this project, make sure you installed Nodejs and MongoDB in your machine and MQTT Broker service are available.
This project used Apollo Graphql to create a api server. For more information, check this link.
For running this project, follow the steps below:
-
Clone repository
-
Go to project directory
- cd back-end
-
Set Environment Variables
- Create
.envfile - Copy content of
.env.examplefile to.envfile - Set variables ( Default values are in
.env.default).
- Create
-
Install Dependencies
- npm install
-
Start Server
- npm start
* MongoDB and MQTT Broker are required. Make sure this services are available.
In the project directory, you can run:
Install dependencies of the project.
After you clone the repository, you have to install dependencies by running this command.
Runs the app in the development mode.
The server will start at http://localhost:4000.
Open http://localhost:4000/graphql to view Graphql Playground in your browser.
The server will reload automatically if you make edits.