We assume you use yarn to install/run this project. If you would like to use npm instead, just replace yarn
with npm run
in any of the commands.
-
Open a terminal and run
yarn full-install
from the top level (idg2671-group3 folder) to install all packages. All commands will be run from the top level, unless something else is specified. -
Optional step: Replace any of the database or email credentials in the .env file with your own. The options are
- For AWS S3
- AWS_ACCESS
- AWS_BUCKET
- AWS_SECRET
- For MongoDB
- DATABASE_URL
- For Outlook
- MAIL_USER
- MAIL_PASS
If you decide to use your own MongoDB database, you will need to import the users collection with the name users to your database, in order to be able to log in and manage the system. Same goes for the locations collection, since this is supposed to be a static database and can not be managed through the application.
*We have also included backup files of all the other collections in the xtra_files folder, if you want your local app to be filled with mock data. They are not needed for the application to run. The collection should always be named the same as the JSON file.
- For AWS S3
-
To start the servers, you have several options
- To start both servers at the same time using concurrently, run
yarn full-start
- To start only the frontend server, run
yarn frontend-start
- To start only the backend server, run
yarn backend-start
- To start both servers at the same time using concurrently, run
If you have not changed the database credentials
-
Log in with either of these user accounts, depending on the functionality you want to test
manager@ntnu.no gardener@ntnu.no (uw7XRGE 2A"q>B\m
-
Optional step: If you want to test the "invite" and "reset password" functionality, log in with the manager profile and create a user with your own e-mail address. Then request to reset the password of this user to receive the e-mail.
-
Test away. Feel free to change anything in the database, we have saved backups of every collection.
📂frontend
|
└───📂public
| └───📂assets // Holds the public assets, like the logo
|
└───📂src
└───📂assets // Images, extra files
└───📂components // All components in the app
└───📂utils // Functions and context
|
└─📄App.js // Manages token and sets context
└─📄App.css // Main stylesheet
└─📄index.js // Runs App.js
└─📄index.css // Sets font for the app
└─📄setupProxy.js // Proxy setup
📁backend
|
└───📁auth // Authorization and authentication files
|
└───📁docs // Swagger documentation
|
└───📁models // Schema models for MongoDB/mongoose
|
└───📁routes // Endpoints and routes for API
| └───📁feedback // /api/feedback
| └───📁locations // /api/locations
| └───📁pictures // /api/pictures
| └───📁plants // /api/plants
| └───📁users // /api/users
| └─📄index.js // /api
|
└───📁services // Extra services / functions for the API
|
└─📄.env // Environment variables
└─📄server.js // Main server setup
- We have decided to include the .env file with the environment variables already filled out. We are aware that sharing this file is considered bad practice, since it contains sensitive information, but we wanted to make the project easy to test and trust that whoever is doing it will treat the credentials we included in a safe manner.