feat: complete client-server architecture refactoring

Server:
- Split into views, routes, helpers, models modules
- Merged /ws/talk and /ws/update into single /ws/chat endpoint
- Replaced polling with push-based broadcast model
- Added username uniqueness validation on connect
- Fixed run_server arguments bug (workers parameter)
- Removed deprecated loop argument from Sanic listeners
- Replaced datetime.utcnow() with timezone-aware datetime.now(timezone.utc)

Client:
- Rewrote client as single-file module
- Migrated from websocket-client to websockets (asyncio)
- Fixed websocket-client conflict with asyncio event loop on Windows
- Added progress indicators for key generation, exchange, connection
- Added animated 3D spinning cube in UI
- Updated RSA key from 512 to 2048 bits

CLI:
- Removed unnecessary asyncio.run() wrapper
- Simplified entry point
This commit is contained in:
mirai
2026-01-02 14:42:33 +03:00
parent faaadd839b
commit 95f8a192b5
22 changed files with 682 additions and 441 deletions
+3 -3
View File
@@ -47,13 +47,13 @@ Everything happens in memory only. Nothing is written to disk.
`python -m venv venv ; .\venv\Scripts\activate ; pip install -r requirements.txt`
3. Start the server (set a password for client connections):
`python cmd_chat.py serve 0.0.0.0 1000 --password YOUR_PASSWORD`
`python cmd_chat.py serve 0.0.0.0 3000 --password YOUR_PASSWORD`
4. Connect a client:
`python cmd_chat.py connect SERVER_IP 1000 USERNAME YOUR_PASSWORD`
`python cmd_chat.py connect SERVER_IP 3000 USERNAME YOUR_PASSWORD`
Example (local run):
`python cmd_chat.py connect localhost 1000 tyler YOUR_PASSWORD`
`python cmd_chat.py connect localhost 3000 tyler YOUR_PASSWORD`
---