The Supervisor Lookup Frontend
is a Next.js project bootstrapped with create-next-app
.
npm run dev
Assuming you also started the backend, you should be able to access the frontend at http://localhost:3000.
We use typescript types automatically generated from the graphql-schema. Whenever the schema is changed in the backend, run either of this commands:
npm run generate ## uses the local node dependencies
nix develop ..#frontendCodegen ## provides reproducible dependencies
End-to-end integration tests are written with Cypress. You can inspect them using either of this commands:
npx cypress open ## requires an existing Cypress installation
nix run ../#cypress -- open ## provides reproducible dependencies
All pages can be statically rendered:
npm run build && npm run export && npm run serve
You should configure the Webserver to rewrite /token/*
to out/token/\[token\].html
.
If you don't, access is only possible from other pages using next/router
.
A trivial server doing this rewrite is implemented in serve.js
.
The backend also supports serving the frontend.
Whenever dependencies are changed, rebuild default.nix
, node-env.nix
and node-packages.nix
in ./nix/deps/
:
nix run ..#frontendUpdatedDeps
This allows to build by:
nix build ..#frontend