+
Channel: {channel}
+
+ {connected ? 'Connected' : 'Waiting for connection...'}
+
+
+
+ );
+};
+```
+
+### 3.3 Главное окно Electron
+
+```typescript
+// src/main.ts
+import { app, BrowserWindow } from 'electron';
+import * as path from 'path';
+
+function createWindow() {
+ const mainWindow = new BrowserWindow({
+ width: 1200,
+ height: 800,
+ webPreferences: {
+ nodeIntegration: true,
+ contextIsolation: false,
+ webSecurity: false // Для разработки, в продакшене нужно настроить правильно
+ }
+ });
+
+ if (process.env.NODE_ENV === 'development') {
+ mainWindow.loadURL('http://localhost:3001');
+ mainWindow.webContents.openDevTools();
+ } else {
+ mainWindow.loadFile(path.join(__dirname, '../build/index.html'));
+ }
+}
+
+app.whenReady().then(createWindow);
+```
+
+---
+
+## 🔐 ЭТАП 4: БЕЗОПАСНОСТЬ
+
+### 4.1 Аутентификация пользователей
+
+```typescript
+// auth/AuthService.ts
+import jwt from 'jsonwebtoken';
+import bcrypt from 'bcrypt';
+
+export class AuthService {
+ private static readonly JWT_SECRET = process.env.JWT_SECRET || 'your-secret-key';
+
+ static async hashPassword(password: string): Promise