refactor(auth): replace dashboard sessions with stateless tokens and session control (#6329)
* refactor(auth): replace dashboard sessions with stateless tokens * feat(auth): harden session issuance and distributed enforcement * fix(proxy): preserve trusted proxy compatibility defaults * refactor: address dashboard auth review feedback * refactor: remove classic frontend and flatten web app
This commit is contained in:
@@ -35,10 +35,8 @@ types/ — Type definitions (relay formats, file sources, errors)
|
||||
i18n/ — Backend internationalization (go-i18n, en/zh)
|
||||
oauth/ — OAuth provider implementations
|
||||
pkg/ — Internal packages (cachex, ionet)
|
||||
web/ — Frontend themes container
|
||||
web/default/ — Default frontend (React 19, Rsbuild, Base UI, Tailwind)
|
||||
web/classic/ — Classic frontend (React 18, Vite, Semi Design)
|
||||
web/default/src/i18n/ — Frontend internationalization (i18next, zh/en/fr/ru/ja/vi)
|
||||
web/ — Frontend (React 19, Rsbuild, Base UI, Tailwind)
|
||||
src/i18n/ — Frontend internationalization (i18next, en/zh/zh-TW/fr/ru/ja/vi)
|
||||
```
|
||||
|
||||
## Internationalization (i18n)
|
||||
@@ -47,12 +45,12 @@ web/ — Frontend themes container
|
||||
- Library: `nicksnyder/go-i18n/v2`
|
||||
- Languages: en, zh
|
||||
|
||||
### Frontend (`web/default/src/i18n/`)
|
||||
### Frontend (`web/src/i18n/`)
|
||||
- Library: `i18next` + `react-i18next` + `i18next-browser-languagedetector`
|
||||
- Languages: en (base), zh (fallback), fr, ru, ja, vi
|
||||
- Translation files: `web/default/src/i18n/locales/{lang}.json` — flat JSON, keys are English source strings
|
||||
- Languages: en (base), zh (fallback), zh-TW, fr, ru, ja, vi
|
||||
- Translation files: `web/src/i18n/locales/{lang}.json` — flat JSON, keys are English source strings
|
||||
- Usage: `useTranslation()` hook, call `t('English key')` in components
|
||||
- CLI tools: `bun run i18n:sync` (from `web/default/`)
|
||||
- CLI tools: `bun run i18n:sync` (from `web/`)
|
||||
|
||||
## Rules
|
||||
|
||||
@@ -126,14 +124,14 @@ Do NOT directly import or call `encoding/json` in business code. `json.RawMessag
|
||||
|
||||
### Frontend Rules
|
||||
|
||||
- Use `bun` as the preferred package manager and script runner for the frontend (`web/default/`):
|
||||
- Use `bun` as the preferred package manager and script runner for the frontend (`web/`):
|
||||
- `bun install` for dependency installation
|
||||
- `bun run dev` for development server
|
||||
- `bun run build` for production build
|
||||
- `bun run i18n:*` for i18n tooling
|
||||
- Frontend UI text must support i18n with `i18next`/`react-i18next`. Use flat JSON locale files in `web/default/src/i18n/locales/{lang}.json`, with English source strings as keys.
|
||||
- Frontend UI text must support i18n with `i18next`/`react-i18next`. Use flat JSON locale files in `web/src/i18n/locales/{lang}.json`, with English source strings as keys.
|
||||
- In React components, use `useTranslation()` and call `t('English key')` for user-facing text.
|
||||
- Follow `web/default/AGENTS.md` for detailed frontend conventions, including TypeScript, component structure, styling, accessibility, testing, and build checks.
|
||||
- Follow `web/AGENTS.md` for detailed frontend conventions, including TypeScript, component structure, styling, accessibility, testing, and build checks.
|
||||
|
||||
### Project Governance
|
||||
|
||||
|
||||
Reference in New Issue
Block a user