Skip to content

Commit 09a3270

Browse files
committed
Feat: Update the README of the project
1 parent 32d2061 commit 09a3270

1 file changed

Lines changed: 114 additions & 17 deletions

File tree

README.md

Lines changed: 114 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,120 @@
1-
# React + TypeScript + Vite
1+
# CloudTown Website
22

33
[![Crowdin](https://badges.crowdin.net/ctec-website/localized.svg)](https://crowdin.com/project/ctec-website)
44

5-
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
5+
A modern, multilingual website built with React, TypeScript, and Vite.
66

7-
Currently, two official plugins are available:
7+
## 📋 Prerequisites
88

9-
- [@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
10-
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9+
Before you begin, ensure you have the following installed:
1110

12-
## Expanding the ESLint configuration
11+
- **Node.js** v20.x or higher ([Download here](https://nodejs.org/))
12+
- **Corepack** (included with Node.js 16.9+)
1313

14-
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
14+
## 🚀 Getting Started
1515

16-
- Configure the top-level `parserOptions` property like this:
16+
### 1. Enable Corepack
17+
18+
This project uses Yarn 4.x, which requires Corepack to be enabled:
19+
20+
```bash
21+
corepack enable
22+
```
23+
24+
> **Note:** Corepack is included by default with Node.js 16.9+ and will automatically use the correct Yarn version specified in `package.json`.
25+
26+
> **Windows Users:** You need to run this command in PowerShell **as Administrator** (Win + X → "Terminal (Admin)"). This is a one-time setup.
27+
28+
### 2. Install Dependencies
29+
30+
```bash
31+
yarn install
32+
```
33+
34+
If you encounter engine compatibility issues with the `sharp` package, use:
35+
36+
```bash
37+
yarn add sharp
38+
# The YARN_IGNORE_NODE environment variable can be set if needed
39+
```
40+
41+
### 3. Run Development Server
42+
43+
```bash
44+
yarn dev
45+
```
46+
47+
The development server will start at `http://localhost:5173` (or another available port).
48+
49+
## 📦 Available Scripts
50+
51+
| Command | Description |
52+
| ------------------- | -------------------------------------------- |
53+
| `yarn dev` | Start development server with HMR |
54+
| `yarn build` | Build for production |
55+
| `yarn preview` | Preview production build locally |
56+
| `yarn lint` | Run ESLint to check code quality |
57+
| `yarn format` | Format code with Prettier |
58+
| `yarn format:check` | Check code formatting without making changes |
59+
60+
## 🏗️ Tech Stack
61+
62+
- **Framework:** React 18 with TypeScript
63+
- **Build Tool:** Vite 6
64+
- **Styling:** Styled Components with Ant Design
65+
- **Internationalization:** i18next
66+
- **Routing:** React Router v6
67+
- **Package Manager:** Yarn 4.12.0 (Berry)
68+
69+
## 🌐 Internationalization
70+
71+
This project supports multiple languages:
72+
73+
- English (en)
74+
- Traditional Chinese (zh_TW)
75+
- Simplified Chinese (zh_CN)
76+
77+
Translations are managed via [Crowdin](https://crowdin.com/project/ctec-website).
78+
79+
## 🚢 Deployment
80+
81+
The website is automatically deployed to GitHub Pages via GitHub Actions when changes are pushed to the `main` branch.
82+
83+
### Manual Deployment
84+
85+
1. Build the project:
86+
87+
```bash
88+
yarn build
89+
```
90+
91+
2. Deploy the `dist` folder to your hosting service.
92+
93+
## 🔧 CI/CD
94+
95+
The project uses GitHub Actions for continuous deployment. Key features:
96+
97+
- **Corepack Integration:** Automatically uses Yarn 4.12.0
98+
- **Dependency Caching:** Caches Yarn dependencies for faster builds (~140 MB)
99+
- **Auto-deployment:** Deploys to GitHub Pages on push to `main`
100+
101+
## 📝 Development Notes
102+
103+
### Using Yarn 4.x
104+
105+
This project uses Yarn Berry (v4.12.0). Key differences from Yarn 1.x:
106+
107+
- ✅ Faster installs with better caching
108+
- ✅ More efficient dependency resolution
109+
- ✅ Better security with zero-installs support
110+
- ⚠️ Some CLI flags differ from Yarn 1.x (e.g., use `YARN_IGNORE_NODE=1` instead of `--ignore-engines`)
111+
112+
### ESLint Configuration
113+
114+
For production applications, consider enabling type-aware lint rules:
17115

18116
```js
19117
export default {
20-
// other rules...
21118
parserOptions: {
22119
ecmaVersion: 'latest',
23120
sourceType: 'module',
@@ -27,14 +124,14 @@ export default {
27124
};
28125
```
29126

30-
- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
31-
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
32-
- 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
127+
Then update to use `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`.
33128

34-
## Important Note
129+
## 📄 License
35130

36-
To fix the `sharp` package engine error on build, run the following command:
131+
This project is licensed under the [GNU General Public License v3.0](LICENSE).
37132

38-
```bash
39-
yarn add sharp --ignore-engines
40-
```
133+
You are free to use, modify, and distribute this software under the terms of the GPL-3.0 license.
134+
135+
## 🤝 Contributing
136+
137+
Contributions are welcome! Please ensure your code follows the project's ESLint and Prettier configurations.

0 commit comments

Comments
 (0)