crabfit/frontend
transifex-integration[bot] cea1ad6f8a
Translate home.json in pt_PT
100% translated source file: 'home.json'
on 'pt_PT'.
2023-06-12 17:29:06 +00:00
..
.vscode Start setting up Next js with the new app router 2023-05-19 23:59:44 +10:00
public Remove PWA functionality 2023-06-09 03:29:42 +10:00
src Translate home.json in pt_PT 2023-06-12 17:29:06 +00:00
.env.local Move Google calendar import to Nextjs 2023-06-09 23:02:55 +10:00
.eslintrc.json Migrate privacy policy to Nextjs 2023-05-24 22:17:08 +10:00
.gitignore Setup actions to deploy frontend and run checks 2023-06-09 23:57:01 +10:00
next-env.d.ts Start setting up Next js with the new app router 2023-05-19 23:59:44 +10:00
package.json Update translation URL and add frontend docs 2023-06-11 03:53:18 +10:00
README.md Update translation URL and add frontend docs 2023-06-11 03:53:18 +10:00
tsconfig.json Move Google calendar import to Nextjs 2023-06-09 23:02:55 +10:00
yarn.lock Move Google calendar import to Nextjs 2023-06-09 23:02:55 +10:00

Crab Fit Frontend

This is the frontend for Crab Fit, written in TypeScript and SCSS, using Next.js app router.

Environment

Default environment variables are provided in .env.local. This should work out of the box while developing with the API. To change or add variables, create a .env file which will override any values in .env.local.

Using VSCode

If you're using VSCode to edit the frontend, be sure to open the frontend folder specifically as your workspace, so you can select the workspace typescript version. This will give you type safety for css modules using the typescript-plugin-css-modules package.

Translations

Translation files are located in frontend/src/i18n/locales. If you need to add any new strings, make sure you only edit the resources in the en folder. Any changes to the other languages including translation of new strings and deletion of removed strings are handled by Transifex.

Temporal API

Crab Fit uses the new Temporal API for all date/time calculations and comparisons. Because this API is not yet supported by any browsers, the @temporal-js/polyfill library is used, with the intention to remove this eventually once support is stable in all major browsers.

Note that much of the Temporal logic is run only when necessary, as the polyfill being used is not optimised and will slow down the frontend otherwise.