@@ -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
3841npm run dev # Start development server
3942npm 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
4751npm run dev # Build and start with nodemon
4852npm 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+
1051171 . Device code generation
1061182 . Peer connection via code
1071193 . 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
170185peerConnection .ondatachannel = (event ) => {
171186 // Handle data channel
172- }
187+ };
173188```
174189
175190## Important Files
@@ -184,6 +199,7 @@ peerConnection.ondatachannel = (event) => {
184199## Documentation
185200
186201When 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