Skip to content

Web application for academic digital repository

Notifications You must be signed in to change notification settings

uqaheath/fez-frontend

 
 

Repository files navigation

Fez frontend

Codeship Status for uqlibrary/fez-frontend Dependency Status Dev Dependency Status

Fez frontend is a web interface application for digital repository.

UQ's branding for Fez is UQ eSpace.

Technology

  • Code: React (~0.15), Javascript (ES2015 - Babel), Immutable, SASS
  • State: Redux, ReduxForm
  • Design: Google Material Design - Material UI
  • Build and dev tools: Webpack
  • Tests: Jest/Nightwatch

Development

This project is using yarn for dependency management. Make sure yarn is installed on your machine.

  • npm install yarn -g - install yarn globally
  • yarn
  • yarn start - The website is now running on http://localhost:3000/ on dev api (requires additional setup of uqlibrary/api project)
  • yarn start:mock - The website is now running on http://localhost:3000/ on mock data
  • for Hot Reloading to work in IntelliJ products, turn "safe write" off in the settings
  • yarn start:build will run production build version on http://dev-espace.library.uq.edu.au:9000/ (add dev-espace.library.uq.edu.au to your /etc/hosts)

Mock data is provided for all pages and actions under src/mock/.

Development notes

Exception handling

  • any custom reject() by promises should return an object with status and message defined {status: 401, message: 'Unauthorised user'} Example
  • any custom catch() methods of promises should process known errors and throw other errors. Example

Testing

Unit testing

Jest is used as testing tool for unit tests. Any HTMl markup is to be tested with snapshots.

  • install jest npm install jest -g
  • run tests npm test

Before committing changes, locally run tests and update stapshots (if required). To update snapshots run npm test -- -u.

E2E testing

Nightwatch.js is used to run end to end tests.

  • start dist version of the project by yarn start:build:e2e - runs application in mock mode
  • while dist version of the project is running, start tests by yarn test:e2e

Codeship setup:

  • nohup bash -c "yarn start:build:e2e 2>&1 &" && sleep 20; cat nohup.out
  • yarn test:e2e

Mocking

To run website on mock data run yarn start:mock webserver will start on http://localhost:3000/

The project allows the user to "login" as any test user. Simply add ?user=<username> to the request and it will log you in as that user. Usernames can be found in the src/mock/data/accounts.js file.

Deployment

Application deployment is 100% automated using Codeship, and is hosted in S3. All deployment data is stored within Codeship. Deployment pipelines are setup for branches: "master", "production" and any branch starting with "feature-".

Google Analytics integration

Fez-frontend includes GTM (Google Tag Manager). GTM is set at webpack build time in webpack configuration. It can be setup as an environmental variable at CI level if required.

GTM is very flexible and easy to configure to track required events. See more details on Google Analytics

About

Web application for academic digital repository

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 94.0%
  • CSS 5.8%
  • HTML 0.2%