docs: refresh frontend onboarding
This commit is contained in:
@@ -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)
|
||||
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/)
|
||||
|
||||
## 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...
|
||||
},
|
||||
},
|
||||
])
|
||||
Требуется Node 22 (`.nvmrc`). Создайте `.env` из примера и установите
|
||||
зависимости строго из lockfile:
|
||||
|
||||
```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`.
|
||||
|
||||
Reference in New Issue
Block a user