Contribute on the WIMP system
To contribute on the backend or the frontend of the WIMP system, you need to setup the development environment.
#
Setup the Backend development environmentTo setup the backend developement environment you need to :
- Pull the Github project of the backend.
- Install the dependencies:
cd ~/wimp-backend/ExpressNodeRednpm install
- Install Redis :
sudo apt-get install redis-server
- Configure the dotenv environment as followed:
- Create a
.env
file - Write in the file the following line (you need to fill the
ENV=devPROTOCOL=httpFRONTEND_HOST=localhostFRONTEND_PORT=3000BACKEND_HOST=localhostBACKEND_PORT=8000SESSION_SECRET=**Generare a session secret to manage the session**BACKEND_SECRET=**Encrypted secret of the Backend with Bcrypt**BACKEND_RESTRICTED_ACCESS=/node/currentStatesEXTERNAL_DEVICES_ROUTES=**List of the Node-RED endpoints in your flows**NODE_RED_SECRET=**Clear password of Node-RED API**NODE_RED_SECRET_ENC=**Encrypted password of Node-RED API with Bcrypt**REDIS_URL=redis://127.0.0.1:6379/0
- Create a
note
The field EXTERNAL_DEVICES_ROUTES
field must be formatted like /myroute1,/myroute2,/myroute3
.
- Start the backend:
npm run start
- You can also start the backend with nodemon:
npm run dev
#
Setup the Backend development environmentTo setup the frontend developement environment you need to :
- Pull the Github project of the frontend.
- Install the dependencies:
cd ~/wimp-frontendnpm install
Configure the dotenv environment as followed:
Create a
.env
fileWrite in the file the following line (you need to fill the **fields**)
ENV=devPROTOCOL=httpFRONTEND_HOST=localhostFRONTEND_PORT=3000BACKEND_HOST=localhostBACKEND_PORT=8000SESSION_SECRET=**Generare a session secret to manage the session**BACKEND_SECRET=**Generare a backend secret to manage the backend access**
note
The field EXTERNAL_DEVICES_ROUTES
field must be formatted like /myroute1,/myroute2,/myroute3
.
- Start the frontend:
npm run start
- You can also start the frontend with nodemon:
npm run dev