The Oak National Academy Web Application code base.
Other documentation can be found in standalone README documents:
- Build
- Components
- Docs
- Error Handling
- React Context
Create an environment configuration file by running:
cp .env.example .envNote
This project has support for dev containers, if you use vscode and have the Dev Containers extension installed, you should be prompted to "Reopen in container" when opening this repo in vscode.
There is various support in other editors (for example zed) and a CLI
Now populate the file with values from the 1Password developers vault, search for "OWA .env (22/04/2026)".
Now select the correct versions of node/pnpm
nvm use
corepack use pnpm@10Now install dependencies
pnpm installThen, run the development server:
pnpm devIf successful two further config files .env.development.local and .env.local will have been automatically generated. You can access the running web app on http://localhost:3000
For more detail please see the test documentation.
We run Pa11yCI in CI to check for deterministic accessibility issues. To run Pa11y locally start the dev server with pnpm run dev, then in another process run Pa11y with pnpm run pa11y.
Unit tests live next to the code they are testing wherever possible. Next does not allow any files under the src/pages/ directory other than routes, so those test file are under the src/__tests_/pages/ directory, mirroring the src/pages file structure.
pnpm run testwill run the tests using--watch, with coverage statistics disabled.pnpm run test:coveragewill run tests using--watchwith coverage statistics enabled.pnpm run test:ciwill run the tests once and create a coverage report.
Once you've run a build with pnpm run build you can see a report in the ./reports/ directory.
You can also run the following to open the report in your browser.
pnpm run report:openWe use WebdriverIO.
See the testing docs for further details.
We use Husky to run pre-commit and commit message validating hooks, including unit tests, code linting, type checking, and commit message format checking.
Currently this hook
- Formats the code using Prettier
- Runs style and code linting
- Runs the unit tests
We use Commitlint to validate that commit message meet the conventional commit standard. If you want help with the format you can use the interactive commit message prompt by running the script pnpm run cc, note you will need to have staged Git changes first or it will error (because there will be nothing to commit).
A_SECRET_VALUE- Some config or tool auth.
The app is built statically, with two caveats.
- On dynamic routes, an empty array and
fallback: "blocking"is returned fromgetStaticPaths. This means that those pages are built on first request, then stored as if they had been built at build time. This allows us to build an app with tens of thousands of pages in a few minutes. - All pages that use
getStaticPropshave incremental static regeneration turned on, which re-runsgetStaticPropsperiodically on the server in order to rebuild the page with the latest data.
The upshot of these two pieces of config is that new pages become available automatically when the underlying data is updated, and existing pages get updated data when it is available, all without having to rebuild the app.
Oak preview and production builds are on Netlify.
- All changes to the
mainbranch must happen through pull requests. - Changes on the
mainbranch trigger thecreate_semantic_releaseGithub workflow which creates a Github release, and updates the package.json version number. The commit message has a structure set inrelease.config.js. - All commits on
mainwill trigger a Vercel deploy, but non-release commits (according to the commit message structure), will be cancelled. - The Vercel deployment will trigger the
deployment_checksGithub workflow.
Please see our security.txt file.
We don't currently accept external contributions to the code base, but this is under review and we hope to find an approach the works for us and the community.
As with all web projects we are dependent on open source libraries maintained by others. While it is not practical to acknowledge them all, we would nevertheless like to express our gratitude for the contributions and efforts of the OSS community. Our dependency list can be found in our package.json file.
Unless stated otherwise, the codebase is released under the MIT License. This covers both the codebase and any sample code in the documentation. Where any Oak National Academy trademarks or logos are included, these are not released under the MIT License, and should be used in line with Oak National Academy brand guidelines.
Any documentation included is © Oak National Academy and available under the terms of the Open Government Licence v3.0, except where otherwise stated.