marcos8896 / nutrition-care-node-api

A Node REST API to be consumed by nutrition-care-client project. Build on top of Loopback framework.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Nutrition Care - Node API

This project is meant to be the replacement for the old backend version that was made on PHP with the Laravel Framework.


Required Environment Variables

Environment variables that are needed to setup properly the database (in this project, it is a MySQL database). It will be required to put the following ENV variables inside a file called ".env" and such a file will have to be located at the project's root folder.


DATABASE ENV VARIABLES Description Example
DB_USER Database's user with enough privileges for the main database DB_USER=user
DB_PASSWORD User's password for the main database DB_PASSWORD=secret
DB_HOST Host where the main database is located DB_HOST=127.0.0.1
DB_PORT Port where the main database is listening to DB_PORT=3306
DB_NAME Main database name DB_NAME=mydb

Environment variables to setup all the test environment, like testing database, ports and so on. This ENV variables setup will be required to run the "npm test" command. Otherwise it won't work.


TEST ENV VARIABLES Description Example
TEST_API_PORT Test API PORT to use for integration tests TEST_API_PORT=8089
TEST_API_HOST The host to handle the test API TEST_API_HOST=127.0.0.1
TEST_DB_USER Testing database user with enough privileges for the testing database TEST_DB_USER=127.0.0.1
TEST_DB_PASSWORD User's password for the testing database TEST_DB_PASSWORD=secret
TEST_DB_HOST Host where the testing database is located TEST_DB_HOST=127.0.0.1
TEST_DB_PORT Port where the testing database is listening to DB_PORT=3306
TEST_DB_NAME Database testing name DB_NAME=mydb_test

Environment variables to setup the Administrator user.


ADMINISTRATOR ENV VARIABLES Description Example
ADMINITRATOR_ID The user's id that the administrator will have ADMINITRATOR_ID=17c5d698-7877-40d9-9fb3-eb7496091c93
ADMINITRATOR_NAME The administrator's name ADMINITRATOR_NAME=Santiago
ADMINITRATOR_LAST_NAME The administrator's lastname ADMINITRATOR_LAST_NAME=Wuenaonda
ADMINITRATOR_USERNAME The administrator's username ADMINITRATOR_USERNAME=admin
ADMINITRATOR_EMAIL The administrator's email (a valid one) ADMINITRATOR_EMAIL=admin@admin.com
ADMINITRATOR_PASSWORD The administrator's password ADMINITRATOR_PASSWORD=secret

General environment variables


GENERAL ENV VARIABLES Description Example
NODE_ENV The current node environment NODE_ENV=development
NOTE: The DBMS used on this project is MySQL

Instructions to use the Seed Model Tool

You can check the dedicated README for the Seed Model HERE.

The project is generated by LoopBack 3.x.

About

A Node REST API to be consumed by nutrition-care-client project. Build on top of Loopback framework.


Languages

Language:JavaScript 100.0%