docs: add a real root README and rewrite the frontend one

The repository had no root README at all, and frontend/README.md was
still the stock Vite template. Add a bilingual (EN/RU) overview covering
the mod, site, and backend plus how they connect (%link, %config
save/load), replace the frontend README with the actual stack, layout,
and scripts, and fix the mod README's broken DEVELOPMENT.md link to
point at DEV_GUIDE.md.
This commit is contained in:
loki5512344 2026-09-28 17:24:34 +02:00
parent 95186ad49c
commit 0ecb4635d1
Signed by: boba
GPG key ID: 253067914055423B
3 changed files with 207 additions and 26 deletions

View file

@ -1,32 +1,49 @@
# React + TypeScript + Vite
# LoVisual Website
This template provides a minimal setup to get React working in Vite with HMR and some Oxlint rules.
The frontend for [LoVisual](../README.md) - a marketing site with a live in-game GUI demo,
download page, documentation, themes/showcase pages, and an account dashboard with a cloud
config manager. UI is fully bilingual (Russian default, English toggle, persisted in the URL).
Currently, two official plugins are available:
## Stack
- [@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 19 + TypeScript + Vite**, package manager: **bun**
- **Tailwind CSS v4** with custom design tokens (radii, glass panels, control sizing)
- **TanStack Query** for backend calls, **react-router** for pages
- **react-i18next** - `ru`/`en` resources per feature, compile-time key parity via `satisfies`
- **motion/react** for animation, **vitest + Testing Library** for tests
- **oxlint** for linting
## React Compiler
## Layout
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation).
## Expanding the Oxlint configuration
If you are developing a production application, we recommend enabling type-aware lint rules by installing `oxlint-tsgolint` and editing `.oxlintrc.json`:
```json
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": ["react", "typescript", "oxc"],
"options": {
"typeAware": true
},
"rules": {
"react/rules-of-hooks": "error",
"react/only-export-components": ["warn", { "allowConstantExport": true }]
}
}
```
src/
├── app/ router, providers, App shell
├── features/ one folder per domain (account, cloud, demo, themes, ...)
│ └── <f>/ api.ts · i18n/{ru,en}.ts · components/ · tests/
├── pages/ route-level pages composing features
├── shared/ ui primitives, i18n bootstrap, easter eggs, helpers
└── test/ vitest setup and utilities
```
See the [Oxlint rules documentation](https://oxc.rs/docs/guide/usage/linter/rules) for the full list of rules and categories.
Feature-folder rules: API calls, translations and components live together; no cross-feature
imports except through `shared/`.
## Scripts
```bash
bun install # install dependencies
bun run dev # dev server on http://localhost:5173 (proxies /api to the backend)
bun run test # vitest run
bun run build # tsc -b + vite build → dist/
bun run lint # oxlint
bun run gen:themes # regenerate theme tokens from the mod palette (scripts/extract-themes.ts)
```
The dev server expects the Rust gateway on `127.0.0.1:8080` (see [`backend/`](../backend));
without it, API-backed pages degrade to demo/offline states by design.
## Testing
Unit and component tests are colocated in `features/*/tests/` and `shared/**/tests/`;
run a single file with `bunx vitest run src/features/account/tests/account.test.tsx`.
Translation parity (ru ↔ en key sets) is enforced at compile time and in tests.