Project for Web Information Technologies (INFO30005) - Semester 1, 2018
Made by: Armaan Mcleod, Wei How Ng & Steven Tang
Built with: Node.JS, Express, MongoDB, React, Redux, React Admin
Credentials for demo:
User Type | Username | Password |
---|---|---|
Admin | admin | admin |
Manager | jsmith | manager |
User | barryw | berry |
- Ensure that your version of Node.js supports async/await
- Get packages using
npm install
,npm install --prefix app/
andnpm install --prefix admin/
(for the server, frontend app and admin interface respectively) - Install
mongo
(server) - Start a Mongo instance using
npm run localdb
or equivalent (a mongod instance could have also been started automatically) - Run
npm run watch
andnpm run devstart
to start the server in the development context (on port 5000 of localhost) - Use
npm run prettify
to prettify Javascript code (it may be necessary to runsudo npm -g install prettier
to installprettier
)
Note: sudo service stop mongodb
may be required on certain Linux distributions to free up the mongo port when running npm run localdb
.
- Ensure that you're in the
app/
oradmin/
directory - Ensure that the API server is started
- Add some sample data with
npm run populate
- Run
npm install
- Run
npm start
Set the REACT_APP_API_URL
environment variable in the Dockerfile
to reflect the setup of your API server before running the build.
Use sudo docker build -t flow .
to build a docker image and subsequently deploy the image.
Set the REACT_APP_API_URL
environment variable in the Dockerfile
to reflect the setup of your API server before running the build.
Use heroku stack:set container -a <app_name>
to set the app type before pushing the code (if using automated builds).
Install dependencies and run npm run build
to build the app without docker.
Ensure that the REACT_APP_API_URL
environment variable is set and available during the build process (as it is used by the frontend apps to determine the prefix of each request URL).
Deploy files in the generated build/
directory and use npm start
to run the app.
Additionally, please set the following environment variables and make them available to the deployed server:
MONGO_URL
: connection URL of mongo instanceSESSION_SECRET
: hashes user sessionsCORS_ORIGIN
: origin (protocol + hostname + port) of frontendPORT
: port that API server should start on (if applicable)
npm test
- Run
npm run report
to generate coverage report
MIT, unless otherwise specified