Skip to content

Installation instructions

Ville Hänninen edited this page Aug 31, 2018 · 1 revision

If you want to run this app in locally, you need MongoDB-database and Cloudinary-account. The App use Cloudinary for storing images.

Clone the project.

Create .env -file and type the following variables:

  • CLOUDINARY_KEY (copy it from your Clodinary-account)
  • CLOUDINARY_SECRET (copy it from your Clodinary-account)
  • DATABASE_URL
  • SECRET (for password hashing)
  • TEST_DATABASE_URL
  • FRONT_PORT = 3000 (if you want to run tests in locally)

Note: Your cloudName must be luupeli or else you need to change a tag cloudName inside the code.

By running the command npm install at the root, you can install all dependencies (root, back end and front end).

You can build the application by running npm run build at the root.

Then you can run the application by command npm start at the root. After this front end is running on port 3000 and back end is on port 3001.

You can't add body parts or animals by using browser. You need to do this for example by Postman or by writing directly to the database.

When everything is ready, you can run the application locally by running the command npm start. If you are at the root, this will run both, front and back end. If you are at sub folder (for example ../backend), only back end will be run and same for front end.

If front end and back end is running and you navigate to http://localhost:3000, the software is on development mode and you see every changes in real time.

If you navigate to http://localhost:3001, the backend uses the build folder (../frontend/build) to show static context.