diff --git a/frontend/.env.sample b/frontend/.env.sample index d994df4..e1e9b82 100644 --- a/frontend/.env.sample +++ b/frontend/.env.sample @@ -1,4 +1,5 @@ VITE_API_URL="http://localhost:8002" VITE_API_PREFIX="/api/v1" -GROQ_API_KEY="your_groq_key_here" VITE_AWS_PUBLIC_URL="https://assets.threadzip.com" +VITE_ANALYTICS_ENABLED="false" +VITE_GA_MEASUREMENT_ID="" diff --git a/frontend/README.md b/frontend/README.md index e900a6a..216519b 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -1,12 +1,36 @@ -# TZ-Fabric +# TZ-Fabric frontend - +## Requirements + +- Node.js `^20.19.0` or `>=22.12.0` +- npm 10 or newer + +## Development ```sh -npm install +npm ci npm run dev ``` -Note: create `.env` file and put content from `.env.sample` file +Copy `.env.sample` to `.env` and configure the documented `VITE_` variables. +The development proxy target can be changed with `VITE_API_PROXY_TARGET`. + +## Quality checks + +```sh +npm run lint +npm test +npm run build +``` + +## Production preview process + +Build first, then serve the generated `dist` directory on port 5173: + +```sh +npm run build +npm start +``` -NOTE: the `VITE_API_URL` and it should be same as _vite.config.ts_ +`npm start` is intended for the repository's existing PM2 deployment workflow. +A dedicated static web server or CDN is preferable for a larger production setup. diff --git a/frontend/biome.json b/frontend/biome.json index 893a4ff..eee8c0f 100644 --- a/frontend/biome.json +++ b/frontend/biome.json @@ -1,5 +1,5 @@ { - "$schema": "https://biomejs.dev/schemas/2.3.10/schema.json", + "$schema": "https://biomejs.dev/schemas/2.5.4/schema.json", "vcs": { "enabled": false, "clientKind": "git", @@ -24,8 +24,21 @@ "linter": { "enabled": true, "rules": { - "recommended": true, - "a11y": "off", + "preset": "recommended", + "a11y": { + "recommended": true, + "useButtonType": "off", + "noSvgWithoutTitle": "off", + "useSemanticElements": "off", + "useKeyWithClickEvents": "off", + "noStaticElementInteractions": "off", + "useMediaCaption": "off", + "useFocusableInteractive": "off", + "noLabelWithoutControl": "off", + "noRedundantAlt": "off", + "noNoninteractiveElementToInteractiveRole": "off", + "noInteractiveElementToNoninteractiveRole": "off" + }, "suspicious": { "noArrayIndexKey": "off", "noExplicitAny": "warn" @@ -52,5 +65,22 @@ "organizeImports": "on" } } - } -} \ No newline at end of file + }, + "overrides": [ + { + "includes": [ + "src/**/*.css" + ], + "linter": { + "rules": { + "style": { + "noDescendingSpecificity": "off" + }, + "suspicious": { + "noDuplicateProperties": "off" + } + } + } + } + ] +} diff --git a/frontend/index.html b/frontend/index.html index 29be038..e68001e 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -5,6 +5,7 @@ +
+ The JavaScript entry file did not finish loading. Restore the network or + disable any DevTools Request Blocking rule, then reload the page. +
+