Giter VIP home page Giter VIP logo

workflow's Introduction

Workflow

CircleCI

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

Configuration

Development (api server)

  • Ensure that your version of Node.js supports async/await
  • Get packages using npm install, npm install --prefix app/ and npm 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 and npm 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 run sudo npm -g install prettier to install prettier)

Note: sudo service stop mongodb may be required on certain Linux distributions to free up the mongo port when running npm run localdb.

Development (React/admin app)

  • Ensure that you're in the app/ or admin/ directory
  • Ensure that the API server is started
  • Add some sample data with npm run populate
  • Run npm install
  • Run npm start

Production

Method 1 - Docker (manual deploy)

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.

Method 2 - Docker Heroku build (Automated build and deploy)

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).

Method 3 - npm (manual build/deploy)

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 instance
  • SESSION_SECRET: hashes user sessions
  • CORS_ORIGIN: origin (protocol + hostname + port) of frontend
  • PORT: port that API server should start on (if applicable)

Tests & Coverage

  • npm test
  • Run npm run report to generate coverage report

License

MIT, unless otherwise specified

Workflow

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.