- Node.JS > 20.13.1
- yarn ~1.15.0
- Docker (optional)
What's in the box?
- React
- Redux
- Express
- Webpack + Babel (ES6)
All dependencies are defined in package.json
and are managed with npm. To
initially install all dependencies and when the list dependency has changed,
run npm install
.
$ yarn install
Start node server with hot reloading middleware listening on port 3000.
$ yarn start
To use a different api set the NDLA_API_URL
environment variable.
Test framework: Jest with enzyme.
$ yarn test
tl;dr: Use eslint! Rules: [Airbnb Styleguide]https://github.com/airbnb/javascript.
Lint code with eslint, including eslint react plugin, eslint-plugin-import, eslint-plugin-jsx-a11y.
Beside linting with globally installed eslint, eslint can be invoked with npm
:
$ yarn run lint
Rules are configured in ./.eslintrc.js
and extends eslint-config-airbnb. If feeling brave, try eslint --fix
.
The eslint-plugin-graphql is used to check the queries against the GraphQL schema. Make sure you have an running instance of the GraphQL enpoint with your latest changes
yarn get-gql-schema-local
GraphQL code generator is used to generate TypeScript types from the local GraphQL schema and queries.
yarn generate-gql-types
The configuration is found in codegen.yml
.
# Create minified production ready build with webpack:
$ yarn run build
# Docker stuff
$ ./build.sh