Skip to content

Commit ec2b4dc

Browse files
authored
Add user-configurable settings with complete i18n (9 languages), theme switching, and UI improvements (#143)
fix #144 fix #145 - Support for language preference setting (i18n), including English, Simplified Chinese, Traditional Chinese, Japanese, Korean, Russian, French, Spanish, and German - Support for theme preference setting (light/dark/auto)
2 parents 675d1cf + c91a3bb commit ec2b4dc

33 files changed

+2888
-1718
lines changed

.github/copilot-instructions.md

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ EasyTransfer is a free, anonymous, encrypted, and easy-to-use E2EE file transfer
1616
## Technology Stack
1717

1818
### Client
19+
1920
- **Framework**: Vue 3 with Composition API
2021
- **Language**: TypeScript
2122
- **Build Tool**: Vite
@@ -25,6 +26,7 @@ EasyTransfer is a free, anonymous, encrypted, and easy-to-use E2EE file transfer
2526
- **Code Quality**: ESLint, Prettier
2627

2728
### Server
29+
2830
- **Runtime**: Node.js
2931
- **Language**: TypeScript
3032
- **Framework**: Socket.io
@@ -34,6 +36,7 @@ EasyTransfer is a free, anonymous, encrypted, and easy-to-use E2EE file transfer
3436
## Development Commands
3537

3638
### Client (in `/client` directory)
39+
3740
```bash
3841
npm run dev # Start development server
3942
npm run build # Build for production
@@ -43,6 +46,7 @@ npm run format # Format code with Prettier
4346
```
4447

4548
### Server (in `/server` directory)
49+
4650
```bash
4751
npm run dev # Build and start with nodemon
4852
npm run build # Compile TypeScript
@@ -54,33 +58,38 @@ npm run format # Format code with Prettier
5458
## Code Style Guidelines
5559

5660
### General
61+
5762
- Use TypeScript for type safety
5863
- Follow existing code patterns and conventions
5964
- Write clear, self-documenting code
6065
- Keep functions small and focused
6166
- Use meaningful variable and function names
6267

6368
### Vue Components
69+
6470
- Use Composition API with `<script setup>` syntax
6571
- Define props with TypeScript interfaces
6672
- Use reactive state management with Pinia stores
6773
- Keep components focused on single responsibilities
6874
- Use Vue 3 best practices (ref, reactive, computed, watch)
6975

7076
### TypeScript
77+
7178
- Enable strict type checking
7279
- Avoid `any` type - use proper types or `unknown`
7380
- Define interfaces for complex data structures
7481
- Use type guards for runtime type checking
7582
- Export types that are used across files
7683

7784
### File Naming
85+
7886
- Vue components: PascalCase (e.g., `FileTransfer.vue`)
7987
- TypeScript files: camelCase (e.g., `socketManager.ts`)
8088
- Utilities: camelCase with descriptive names
8189
- Constants: UPPER_SNAKE_CASE or camelCase based on context
8290

8391
### Code Organization
92+
8493
- Keep related functionality together
8594
- Separate business logic from UI components
8695
- Use utility functions for shared logic
@@ -90,18 +99,21 @@ npm run format # Format code with Prettier
9099
## Key Features to Understand
91100

92101
### WebRTC Implementation
102+
93103
- Peer-to-peer connection establishment
94104
- STUN/TURN server configuration
95105
- Data channel management
96106
- ICE candidate handling
97107

98108
### Socket.io Integration
109+
99110
- Device code generation and management
100111
- Signaling server for WebRTC
101112
- Connection state management
102113
- Error handling and reconnection logic
103114

104115
### File Transfer Flow
116+
105117
1. Device code generation
106118
2. Peer connection via code
107119
3. WebRTC connection establishment
@@ -139,37 +151,40 @@ npm run format # Format code with Prettier
139151
## Common Patterns
140152

141153
### Pinia Store Usage
154+
142155
```typescript
143-
import { defineStore } from 'pinia'
144-
import { ref } from 'vue'
156+
import { defineStore } from "pinia";
157+
import { ref } from "vue";
158+
159+
export const useMyStore = defineStore("myStore", () => {
160+
const state = ref(initialValue);
145161

146-
export const useMyStore = defineStore('myStore', () => {
147-
const state = ref(initialValue)
148-
149162
const action = () => {
150163
// Action logic
151-
}
152-
153-
return { state, action }
154-
})
164+
};
165+
166+
return { state, action };
167+
});
155168
```
156169

157170
### Socket.io Event Handling
171+
158172
```typescript
159-
socket.on('event-name', (data) => {
173+
socket.on("event-name", (data) => {
160174
// Handle event
161-
})
175+
});
162176

163-
socket.emit('event-name', data)
177+
socket.emit("event-name", data);
164178
```
165179

166180
### WebRTC Connection Setup
181+
167182
```typescript
168-
const peerConnection = new RTCPeerConnection(config)
183+
const peerConnection = new RTCPeerConnection(config);
169184

170185
peerConnection.ondatachannel = (event) => {
171186
// Handle data channel
172-
}
187+
};
173188
```
174189

175190
## Important Files
@@ -184,6 +199,7 @@ peerConnection.ondatachannel = (event) => {
184199
## Documentation
185200

186201
When making changes:
202+
187203
- Update README.md if adding user-facing features
188204
- Update CONTRIBUTING.md if changing development process
189205
- Add comments for complex algorithms or non-obvious logic

0 commit comments

Comments
 (0)