/learningpath-frontend

NDLA Learningpath Frontend at https://stier.ndla.no

Primary LanguageJavaScriptGNU General Public License v3.0GPL-3.0

NDLA Learningpath front-end

CI

The front-end code powering https://stier.ndla.no.

Norwegian Digital Learning Arena (NDLA) (Norwegian: Nasjonal digital læringsarena) is a joint county enterprise offering open digital learning assets for upper secondary education. In addition to being a compilation of open educational resources (OER), NDLA provides a range of other online tools for sharing and cooperation.

Requirements

  • Node.JS 20.13
  • yarn ~1.15
  • Docker (optional)

Getting started

What's in the box?

  • React
  • Redux
  • Express
  • Webpack + Babel (ES6) via Razzle

Dependencies

All dependencies are defined in package.json and are managed with yarn. To initially install all dependencies and when the list dependency has changed, run yarn.

$ yarn

Start development server

Start node server with hot reloading middleware listening on port 3000.

$ yarn start

To use a different api set the NDLA_ENVIRONMENT environment variable.

Unit tests

Test framework: Jest with Enzyme

$ yarn test

e2e tests

Cypress is used for end to end testing.

$ yarn e2e

Code style

Prettier is used for automatic code formatting.

$ yarn format
$ yarn format-check

ES Linting

Eslint is used for linting javascript code.

$ yarn lint-es

Rules are configured in ./eslintrc and extends esling-config-ndla.

CSS Linting

j Check for errors with stylelint:

$ yarn lint-style

Rules are configured in ./.stylelintrc.js and extends stylelint-config-standard.

Other scripts

# GTG? Checks code formating, linting and runs unit tests:
$ yarn check-all
# Create minified production ready build:
$ yarn build
# Start a production build:
$ yarn start-prod
# Do you TDD?
$ yarn tdd
# Docker stuff
$ ./build.sh