docs: refresh frontend onboarding

This commit is contained in:
2026-08-24 10:29:55 +03:00
parent 6d892da9ce
commit be80ef2f1b
2 changed files with 33 additions and 68 deletions
+1
View File
@@ -18,6 +18,7 @@ Node 22 обязателен (`.nvmrc`). `npm run openapi:sync` - единств
## Документация для агента ## Документация для агента
- Перед изменением поставленного поведения или доменных терминов прочитать [`../docs/architecture/system-overview.md`](../docs/architecture/system-overview.md) и [`../docs/architecture/domain-glossary.md`](../docs/architecture/domain-glossary.md).
- Перед изменением API или transport types прочитать [`docs/API-LAYER.md`](docs/API-LAYER.md). - Перед изменением API или transport types прочитать [`docs/API-LAYER.md`](docs/API-LAYER.md).
- Перед созданием формы, страницы или UI-состояний прочитать [`docs/UI-PATTERN.md`](docs/UI-PATTERN.md). - Перед созданием формы, страницы или UI-состояний прочитать [`docs/UI-PATTERN.md`](docs/UI-PATTERN.md).
- Перед изменением структуры слайса или импортов прочитать [`docs/STRUCTURE.md`](docs/STRUCTURE.md). - Перед изменением структуры слайса или импортов прочитать [`docs/STRUCTURE.md`](docs/STRUCTURE.md).
+32 -68
View File
@@ -1,77 +1,41 @@
# React + TypeScript + Vite # WealthLedger frontend
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. React/Vite-клиент WealthLedger. Клиент получает данные только через typed API
backend; прямые вызовы T-Bank из frontend не допускаются.
Currently, two official plugins are available: ## Быстрый старт
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Oxc](https://oxc.rs) Требуется Node 22 (`.nvmrc`). Создайте `.env` из примера и установите
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) зависимости строго из lockfile:
## React Compiler
The React Compiler is enabled on this template. See [this documentation](https://react.dev/learn/react-compiler) for more information.
Note: This will impact Vite dev & build performances.
## Expanding the ESLint configuration
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
```js
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...
// Remove tseslint.configs.recommended and replace with this
tseslint.configs.recommendedTypeChecked,
// Alternatively, use this for stricter rules
tseslint.configs.strictTypeChecked,
// Optionally, add this for stylistic rules
tseslint.configs.stylisticTypeChecked,
// Other configs...
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])
```bash
cp .env.example .env
npm ci
npm run dev
``` ```
You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules: `VITE_API_BASE_URL` по умолчанию указывает на `http://localhost:3000`.
```js ## Проверка
// eslint.config.js
import reactX from 'eslint-plugin-react-x'
import reactDom from 'eslint-plugin-react-dom'
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...
// Enable lint rules for React
reactX.configs['recommended-typescript'],
// Enable lint rules for React DOM
reactDom.configs.recommended,
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])
```bash
npm run verify
``` ```
Команда проверяет committed OpenAPI snapshot, strict TypeScript, Biome, unit
tests и coverage, Knip, dependency rules и production build. Для обновления
OpenAPI artifacts применяется только `npm run openapi:sync`; обычный
`openapi:check` обращается лишь к committed snapshot.
## Документация
- [Структура и FSD](docs/STRUCTURE.md)
- [API layer и OpenAPI](docs/API-LAYER.md)
- [UI-паттерны](docs/UI-PATTERN.md)
- [Conventions](docs/CONVENTIONS.md) и [тестирование](docs/TESTING.md)
- [Обзор поставленной системы](../docs/architecture/system-overview.md)
- [Frontend workflow](../docs/development/frontend-workflow.md)
- [Remediation registry](../docs/development/audit-remediation.md)
Runtime OpenAPI backend сверяется с frontend snapshot отдельной read-only
командой из workspace: `bash specs/scripts/verify-runtime-openapi.sh`.