When you first load the website in the browser, or refresh we only send one network request which should grab all the necessary information to get going.
Notes
Creates GET /start endpoint which is the single network call the frontend needs to set itself up. It returns the available models, the system roles for all levels and the emails, history and defences for the current level.
The above network call acts as the frontend's health check so I've removed the healthcheck stuff from the frontend
removes GET /openai/validModels endpoint and all related code (no longer needed)
removes GET /systemRoles endpoint and all related code (no longer needed)
moves loadBackendData and openHandbook to mainComponent.tsx so that all the /start fetched state stuff can be managed by one component.
Adds UseIsFirstRender hook, for using with the useEffect hook. It indicates whether the useEffect is running on the first mount or on the change of a dependency.
Description
When you first load the website in the browser, or refresh we only send one network request which should grab all the necessary information to get going.
Notes
GET /start
endpoint which is the single network call the frontend needs to set itself up. It returns the available models, the system roles for all levels and the emails, history and defences for the current level.GET /openai/validModels
endpoint and all related code (no longer needed)GET /systemRoles
endpoint and all related code (no longer needed)loadBackendData
andopenHandbook
to mainComponent.tsx so that all the/start
fetched state stuff can be managed by one component.UseIsFirstRender
hook, for using with the useEffect hook. It indicates whether the useEffect is running on the first mount or on the change of a dependency.Checklist
Have you done the following?