You'll need Node >= 8.x and Yarn >= 1.6 to be installed.
- Install dependencies:
yarn install
- Start the development server:
yarn start
- Visit
http://localhost:5000
in your favorite browser
NOTE: When running the server, you may see warnings about the 'history' package. You can safely ignore them.
In development, our app assumes that you will be running the GraphQL API on http://localhost:3000
.
The frontend is split up into three main sections: Admin
, Judge
, and Student
.
In each, we have:
actions.js
- Redux actions and action creatorsPage.js
- Top-level routing for this sectionreducers.js
- Redux reducer for this sectioncomponents/
- Presentational components (which may also manage their own internal React state)containers/
- Container components which wrap presentational components with Redux and GraphQL functionsmutations/
- GraphQL mutationspages/
- Layout for each page in this sectionqueries/
- GraphQL queries
Since Admin, Judge, and Student workflows are generally mutually exclusive, we aim for minimal overlap between each section.
We transpile our code using Babel and target IE 11 because there are still computers at RIT which run Windows 7 and IE 11.
ESLint is setup to warn you about style violations. Additionally, you should run yarn run format
to automatically format the code using Prettier.
To run tests, run yarn run test
. We use the testing libraries Jest and Enzyme.
This app assumes that the backend GraphQL API will be deployed at https://gallerygateway.rit.edu/backend
.
We use Webpack to compile our application. Our Webpack configuration files can be found in config/
To build the app for production, run yarn run build
. This will create a dist/
folder with the compiled output files.
To test that the compiled app is working correctly, you'll need to host the assets on a static server. The npm package serve
can be used to do this locally.
In production, we host our static files using nginx. You can find our nginx config in our deploy/
folder.