Readme updated
This commit is contained in:
128
README.md
128
README.md
@ -1,54 +1,96 @@
|
|||||||
# React + TypeScript + Vite
|
# Deployer Project
|
||||||
|
|
||||||
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
|
Deployer is a React + TypeScript + Vite project designed to provide a robust and scalable foundation for building modern web applications. This project includes Tailwind CSS for styling, ESLint for linting, and a modular structure for easy development and maintenance.
|
||||||
|
|
||||||
Currently, two official plugins are available:
|
## Features
|
||||||
|
|
||||||
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
|
- **React**: A JavaScript library for building user interfaces.
|
||||||
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
|
- **TypeScript**: Strongly typed programming language that builds on JavaScript.
|
||||||
|
- **Vite**: A fast build tool and development server.
|
||||||
|
- **Tailwind CSS**: A utility-first CSS framework for rapid UI development.
|
||||||
|
- **ESLint**: A tool for identifying and fixing problems in JavaScript/TypeScript code.
|
||||||
|
|
||||||
## Expanding the ESLint configuration
|
## Project Structure
|
||||||
|
|
||||||
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
|
The project is organized as follows:
|
||||||
|
|
||||||
```js
|
```
|
||||||
export default tseslint.config({
|
public/
|
||||||
extends: [
|
- Static assets like images and icons.
|
||||||
// Remove ...tseslint.configs.recommended and replace with this
|
src/
|
||||||
...tseslint.configs.recommendedTypeChecked,
|
- Main application code.
|
||||||
// Alternatively, use this for stricter rules
|
- assets/: Contains images and other static resources.
|
||||||
...tseslint.configs.strictTypeChecked,
|
- components/: Reusable React components.
|
||||||
// Optionally, add this for stylistic rules
|
- context/: Context API for state management.
|
||||||
...tseslint.configs.stylisticTypeChecked,
|
- hooks/: Custom React hooks.
|
||||||
],
|
- layout/: Layout components like headers and sidebars.
|
||||||
languageOptions: {
|
- pages/: Page-level components.
|
||||||
// other options...
|
- icons/: SVG icons used in the application.
|
||||||
parserOptions: {
|
|
||||||
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
||||||
tsconfigRootDir: import.meta.dirname,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
```
|
```
|
||||||
|
|
||||||
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:
|
## Getting Started
|
||||||
|
|
||||||
```js
|
### Prerequisites
|
||||||
// eslint.config.js
|
|
||||||
import reactX from 'eslint-plugin-react-x'
|
|
||||||
import reactDom from 'eslint-plugin-react-dom'
|
|
||||||
|
|
||||||
export default tseslint.config({
|
- Node.js (>= 14.x)
|
||||||
plugins: {
|
- npm or yarn
|
||||||
// Add the react-x and react-dom plugins
|
|
||||||
'react-x': reactX,
|
### Installation
|
||||||
'react-dom': reactDom,
|
|
||||||
},
|
1. Clone the repository:
|
||||||
rules: {
|
```bash
|
||||||
// other rules...
|
git clone <repository-url>
|
||||||
// Enable its recommended typescript rules
|
```
|
||||||
...reactX.configs['recommended-typescript'].rules,
|
|
||||||
...reactDom.configs.recommended.rules,
|
2. Navigate to the project directory:
|
||||||
},
|
```bash
|
||||||
})
|
cd deployer
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Install dependencies:
|
||||||
|
```bash
|
||||||
|
npm install
|
||||||
|
# or
|
||||||
|
yarn install
|
||||||
|
```
|
||||||
|
|
||||||
|
### Development
|
||||||
|
|
||||||
|
Start the development server:
|
||||||
|
```bash
|
||||||
|
npm run dev
|
||||||
|
# or
|
||||||
|
yarn dev
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Build
|
||||||
|
|
||||||
|
Build the project for production:
|
||||||
|
```bash
|
||||||
|
npm run build
|
||||||
|
# or
|
||||||
|
yarn build
|
||||||
|
```
|
||||||
|
|
||||||
|
### Lint
|
||||||
|
|
||||||
|
Run ESLint to check for code issues:
|
||||||
|
```bash
|
||||||
|
npm run lint
|
||||||
|
# or
|
||||||
|
yarn lint
|
||||||
|
```
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
### Tailwind CSS
|
||||||
|
|
||||||
|
Tailwind CSS is configured in `tailwind.config.js`. You can customize the theme, plugins, and other settings as needed.
|
||||||
|
|
||||||
|
### ESLint
|
||||||
|
|
||||||
|
ESLint is configured in `eslint.config.js`. You can expand the configuration to include additional rules and plugins as described in the [README](./README.md).
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
This project is licensed under the MIT License. See the LICENSE file for details.
|
||||||
|
|||||||
Reference in New Issue
Block a user