Client from zero

This commit is contained in:
2024-06-19 12:55:18 +08:00
parent 9e56b56e9d
commit bc4c9dac6b
35 changed files with 291 additions and 4109 deletions

View File

@@ -1,50 +1,30 @@
# Vite & NextUI Template
# React + TypeScript + Vite
This is a template for creating applications using Vite and NextUI (v2).
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
[Try it on CodeSandbox](https://githubbox.com/nextui-org/vite-template)
Currently, two official plugins are available:
## Technologies Used
- [@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
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
- [Vite](https://vitejs.dev/guide/)
- [NextUI](https://nextui.org)
- [Tailwind CSS](https://tailwindcss.com)
- [Tailwind Variants](https://tailwind-variants.org)
- [TypeScript](https://www.typescriptlang.org)
- [Framer Motion](https://www.framer.com/motion)
## Expanding the ESLint configuration
## How to Use
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
To clone the project, run the following command:
- Configure the top-level `parserOptions` property like this:
```bash
git clone https://github.com/nextui-org/vite-template.git
```js
export default {
// other rules...
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json'],
tsconfigRootDir: __dirname,
},
}
```
### Install dependencies
You can use one of them `npm`, `yarn`, `pnpm`, `bun`, Example using `npm`:
```bash
npm install
```
### Run the development server
```bash
npm run dev
```
### Setup pnpm (optional)
If you are using `pnpm`, you need to add the following code to your `.npmrc` file:
```bash
public-hoist-pattern[]=*@nextui-org/*
```
After modifying the `.npmrc` file, you need to run `pnpm install` again to ensure that the dependencies are installed correctly.
## License
Licensed under the [MIT license](https://github.com/nextui-org/vite-template/blob/main/LICENSE).
- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list