docs: Update README with setup instructions

This commit is contained in:
2026-04-11 00:41:33 +03:00
parent e176c00e52
commit d238930b7c

View File

@@ -1,73 +1,46 @@
# React + TypeScript + Vite # Bonch Material You Client
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. A modern Material You (Material 3) client for the `bonch-open-api`.
Currently, two official plugins are available: ## Features
- **Material 3 Design:** Clean UI following Material You principles with support for light/dark modes.
- **Dynamic API Configuration:** Easily switch API domains and keys.
- **Profile View:** View student profile information (Full Name, Group, Faculty, Email).
- **Responsive:** Works well on mobile and desktop.
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Oxc](https://oxc.rs) ## Stack
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) - **Frontend:** React + TypeScript + Vite
- **State Management:** Zustand (with persistence)
- **API Client:** Axios
- **Icons:** Lucide React
- **Routing:** React Router DOM
## React Compiler ## Getting Started
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). 1. **Clone the repository**
```bash
git clone https://gitea.snusxd.site/adminxd/bonch-md-client.git
cd bonch-md-client
```
## Expanding the ESLint configuration 2. **Setup environment**
Copy `.env.example` to `.env` and set your default API domain.
```bash
cp .env.example .env
```
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules: 3. **Install dependencies**
```bash
npm install
```
```js 4. **Run development server**
export default defineConfig([ ```bash
globalIgnores(['dist']), npm run dev
{ ```
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...
// Remove tseslint.configs.recommended and replace with this ## Configuration
tseslint.configs.recommendedTypeChecked, The API domain can be configured via the `VITE_API_DOMAIN` environment variable or changed directly in the app's login screen.
// Alternatively, use this for stricter rules
tseslint.configs.strictTypeChecked,
// Optionally, add this for stylistic rules
tseslint.configs.stylisticTypeChecked,
// Other configs... ## License
], Private
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])
```
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:
```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...
},
},
])
```