Spaces:
Sleeping
Sleeping
Commit ·
f409d20
1
Parent(s): cfc278b
update readme
Browse files
README.md
CHANGED
|
@@ -1,112 +1,28 @@
|
|
| 1 |
# VinClassroom UI
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
## 🚀 Tính năng
|
| 6 |
-
|
| 7 |
-
- **Space Management**: Tạo và quản lý không gian học tập
|
| 8 |
-
- **Room Chat**: Chat theo phòng học với hỗ trợ reply, edit message
|
| 9 |
-
- **Direct Messages (DM)**: Nhắn tin trực tiếp giữa các thành viên
|
| 10 |
-
- **Theme Toggle**: Chế độ Dark/Light mode
|
| 11 |
-
- **Member Management**: Quản lý thành viên, tìm kiếm
|
| 12 |
-
- **AI Assistant**: Tích hợp trợ lý AI trong các phòng học
|
| 13 |
-
- **Real-time UI**: Giao diện responsive, smooth transitions
|
| 14 |
-
|
| 15 |
-
## 🛠️ Công nghệ sử dụng
|
| 16 |
-
|
| 17 |
-
- **Frontend**: React 19, Vite
|
| 18 |
-
- **State Management**: Redux Toolkit + React-Redux
|
| 19 |
-
- **Styling**: TailwindCSS v4
|
| 20 |
-
- **Icons**: React Icons
|
| 21 |
-
- **Real-time**: Socket.io Client
|
| 22 |
-
- **HTTP Client**: Axios
|
| 23 |
-
|
| 24 |
-
## 📦 Cài đặt
|
| 25 |
|
| 26 |
```bash
|
| 27 |
-
# Clone repository
|
| 28 |
-
git clone https://github.com/anotherath/vinclassroom-ui.git
|
| 29 |
-
cd vinclassroom-ui
|
| 30 |
-
|
| 31 |
# Cài đặt dependencies
|
| 32 |
npm install
|
| 33 |
|
| 34 |
-
# Chạy
|
| 35 |
npm run dev
|
| 36 |
|
| 37 |
# Build production
|
| 38 |
npm run build
|
| 39 |
```
|
| 40 |
|
| 41 |
-
##
|
| 42 |
-
|
| 43 |
-
```
|
| 44 |
-
src/
|
| 45 |
-
├── components/ # React components
|
| 46 |
-
│ ├── chatarea/ # Chat area components
|
| 47 |
-
│ ├── createspace/ # Create space components
|
| 48 |
-
│ ├── memberlist/ # Member list components
|
| 49 |
-
│ ├── roomlist/ # Room list components
|
| 50 |
-
│ ├── settings/ # Settings components
|
| 51 |
-
│ └── sidebar/ # Sidebar components
|
| 52 |
-
├── context/ # React Context (legacy)
|
| 53 |
-
├── data/ # Mock data
|
| 54 |
-
├── services/ # API services
|
| 55 |
-
├── store/ # Redux store
|
| 56 |
-
│ └── slices/ # Redux slices
|
| 57 |
-
│ ├── appSlice.js # App state (navigation, views)
|
| 58 |
-
│ ├── chatSlice.js # Chat state (reply, edit, selectedUser)
|
| 59 |
-
│ ├── memberSlice.js # Member list state
|
| 60 |
-
│ └── themeSlice.js # Theme state (dark/light)
|
| 61 |
-
└── styles/ # Global styles
|
| 62 |
-
```
|
| 63 |
-
|
| 64 |
-
## 🎨 Redux State Management
|
| 65 |
-
|
| 66 |
-
### App Slice
|
| 67 |
-
|
| 68 |
-
- `activeView` - View hiện tại (space, messages, createSpace, settings)
|
| 69 |
-
- `activeSpace` - Space đang chọn
|
| 70 |
-
- `activeRoom` - Room đang chọn
|
| 71 |
-
- `searchQuery` - Từ khóa tìm kiếm
|
| 72 |
-
- `isSettings` - Trạng thái settings
|
| 73 |
|
| 74 |
-
|
| 75 |
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
- `replyTo` - Tin nhắn đang reply
|
| 81 |
-
- `editMessage` - Tin nhắn đang edit
|
| 82 |
-
- `selectedUser` - User được chọn
|
| 83 |
-
|
| 84 |
-
### Member Slice
|
| 85 |
-
|
| 86 |
-
- `memberSearchQuery` - Tìm kiếm thành viên
|
| 87 |
-
- `selectedMember` - Thành viên được chọn
|
| 88 |
-
|
| 89 |
-
## 📝 Scripts
|
| 90 |
-
|
| 91 |
-
| Command | Description |
|
| 92 |
-
| ----------------- | ------------------------ |
|
| 93 |
-
| `npm run dev` | Chạy development server |
|
| 94 |
-
| `npm run build` | Build production |
|
| 95 |
-
| `npm run preview` | Preview production build |
|
| 96 |
-
| `npm run lint` | Chạy ESLint |
|
| 97 |
-
|
| 98 |
-
## 👥 Đóng góp
|
| 99 |
-
|
| 100 |
-
1. Fork repository
|
| 101 |
-
2. Tạo feature branch (`git checkout -b feature/amazing-feature`)
|
| 102 |
-
3. Commit changes (`git commit -m 'Add amazing feature'`)
|
| 103 |
-
4. Push to branch (`git push origin feature/amazing-feature`)
|
| 104 |
-
5. Tạo Pull Request
|
| 105 |
-
|
| 106 |
-
## 📄 License
|
| 107 |
-
|
| 108 |
-
MIT License
|
| 109 |
|
| 110 |
-
|
|
|
|
|
|
|
| 111 |
|
| 112 |
-
|
|
|
|
| 1 |
# VinClassroom UI
|
| 2 |
|
| 3 |
+
## Chạy dự án
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
```bash
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
# Cài đặt dependencies
|
| 7 |
npm install
|
| 8 |
|
| 9 |
+
# Chạy dev server
|
| 10 |
npm run dev
|
| 11 |
|
| 12 |
# Build production
|
| 13 |
npm run build
|
| 14 |
```
|
| 15 |
|
| 16 |
+
## Cấu hình `.env`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
+
Copy `.env.example` thành `.env` và chỉnh sửa:
|
| 19 |
|
| 20 |
+
```bash
|
| 21 |
+
# API backend (REST)
|
| 22 |
+
VITE_API_URL=http://localhost:3000/api
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
+
# WebSocket (Socket.IO)
|
| 25 |
+
VITE_SOCKET_URL=http://localhost:3000
|
| 26 |
+
```
|
| 27 |
|
| 28 |
+
> **Lưu ý:** `VITE_SOCKET_URL` để `http://`, không phải `ws://`. Socket.IO client tự động upgrade lên WebSocket.
|