yulapshun aledavide96 AanchalChugh
- Make sure MongoDB is install and running locally
- Change working directory to
backend
- Run
npm install
- Run
cp env-example .env
- Modify
.env
if necessary to fill in with the correct values - Start the server with
npm start
- The API server will be started on the
PORT
specified in .env
- Run
npm install
- Run
cp env-example .env
- Modify
.env
if necessary to fill in with the correct values - Run
npm start
- The development server will be started on port 3000
- Follow the same steps 1 to 5 as in development setup
- Start the server with
npm run start-prod
- The API server will be started on the
PORT
specified in .env
- Follow the same steps 1 to 3 as in development setup
- Build with
npm run build
- Serve with
npm run serve
- The frontend will be served on port 3000
A smaller set of bare minimum test data can be imported with the command npm run importDummy
.
Data downloaded from the Internet can be imported with the command npm run importData
, manufactuers all have usernames with their names turned to lower case and non alphanumeric characters removed.
A relative clean set of data can be imported with the command npm run import
, this is the command you are looking for if you want to test out this application, must have mongoimport
installed
Create product, deprecated
Import minimal set of test data, execute with npm run importDummy
, deprecated
Run these scripts in the order specifieed in the title to download data from Walgreens and PubChem. Takes a long time to run and all necessary data is already contained inside of data
directory so it is not neccessary to rerun theme
Import the data downloaded from Walgreens and PubChem, takes a few minutes to run, execute with npm run importData
, deprecated
Export the database as JSON files into data/export
, execute with npm run export
, must have mongoexport
installed
Import the exported data into the database, execute with npm run import
, must have mongoimport
installed
Recalculate overall, cancer, allergy & environment scores for products and ingredients, executed aynchronously everytime the backend starts or with the command npm run calculateScores
Approve certificates with pending status, execute with npm run approveCertificates
To check the code styles for the frontend, use React's default linter,
for the backend, run npm run lint
inside backend directory.
Most important rules to follow are:
- Indent with 2 spaces
- Use single quotes for strings
- Use semi colons