You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This project is a high-performance **CLI Instant Messaging (IM) System** written in **C++20**, evolving from a web server foundation. It utilizes a Reactor pattern with **Linux Epoll** for networking, **Google Protobuf** for data serialization, and relies on **MySQL** and **ScyllaDB** for data persistence.
1
+
# MyWebserver (CLI IM System) Context
2
+
3
+
## Project Overview
4
+
This project is a high-performance C++ application evolving from a WebServer into a **CLI Instant Messaging (IM) System**. It utilizes modern C++20 standards, a Reactor-based networking model, and Google Protobuf for efficient binary communication. The system features a server backend and a terminal-based client user interface.
-`.devcontainer/`: Development environment configuration (Dockerfile, docker-compose).
25
-
-`sql/`: Database schema definitions.
35
+
*`server/src/`: Core server source code.
36
+
*`client/`: Client application source code.
37
+
*`proto/`: Protobuf definition files.
38
+
*`tests/`: Python functional tests and C++ unit tests.
39
+
*`sql/`: Database schema definitions.
40
+
*`vcpkg.json`: Project dependencies.
41
+
*`docker-compose.yml`: Deployment configuration.
26
42
27
43
## Build & Run
28
44
29
-
### 1. Build
30
-
The project uses **CMake Presets** (`debug`, `release`).
45
+
**Prerequisites:**
46
+
The project is best developed using the provided **DevContainer** (requires Docker & VS Code). Alternatively, ensure `cmake`, `vcpkg`, `clang`, and necessary DB drivers are installed.
31
47
32
-
**Debug Build:**
48
+
**Build Commands (inside DevContainer or configured env):**
33
49
```bash
50
+
# Configure (Release or Debug)
51
+
cmake --preset release
52
+
# OR
34
53
cmake --preset debug
35
-
cmake --build build/debug
36
-
```
37
54
38
-
**Release Build:**
39
-
```bash
40
-
cmake --preset release
55
+
# Build
41
56
cmake --build build/release
57
+
# OR
58
+
cmake --build build/debug
42
59
```
43
60
44
-
### 2. Run Server
45
-
The server listens on port **1316**.
61
+
**Run Server:**
46
62
```bash
47
-
# Debug
48
63
./build/debug/server/src/server
49
-
50
-
# Release
64
+
# OR
51
65
./build/release/server/src/server
66
+
# Note: Server listens on port 1316 by default.
52
67
```
53
68
54
-
### 3. Run Client
55
-
The client connects to `127.0.0.1:1316`.
69
+
**Run Client:**
56
70
```bash
57
-
# Debug
58
71
./build/debug/client/client
72
+
# OR
73
+
./build/release/client/client
59
74
```
60
75
61
76
## Testing
62
-
Python scripts are used for integration testing. They send raw Protobuf packets over TCP.
63
-
64
-
**Prerequisites:**
65
-
Ensure the server is running.
77
+
The project includes Python scripts for functional testing of specific features.
66
78
67
-
**Run Tests:**
68
79
```bash
69
-
# Test Authentication (Register/Login)
80
+
# Test Authentication
70
81
python3 tests/test_auth.py [username] [password]
71
82
72
83
# Test Friend System
@@ -76,18 +87,14 @@ python3 tests/test_friend.py
76
87
python3 tests/test_message.py
77
88
```
78
89
79
-
## Infrastructure
80
-
The project relies on Docker for database services.
81
-
-**MySQL**: 3306 (User/Auth)
82
-
-**Scylla**: 9042 (Messages)
83
-
84
-
**Start Infrastructure:**
85
-
```bash
86
-
docker-compose -f .devcontainer/docker-compose.yml up -d
87
-
```
88
-
(Or use the DevContainer which handles this automatically).
89
-
90
-
## Development Conventions
91
-
-**Code Style**: Google C++ Style (PascalCase for classes/functions, snake_case for variables).
92
-
-**Protobuf**: When modifying `.proto` files, re-run CMake to regenerate C++ and Python headers.
93
-
-**Database**: Schema changes require database re-initialization or migration.
90
+
## Development Status & Roadmap
91
+
***Transitioning to ScyllaDB:** The project is moving from MySQL to ScyllaDB for better scalability.
92
+
***Current Focus:**
93
+
* Password Encryption (bcrypt/Argon2)
94
+
* P2P Message persistence and delivery guarantees.
95
+
* Offline message storage.
96
+
***Completed:** User Auth (JWT), Friend System, Real-time Push, Connection Pool.
97
+
98
+
## Conventions
99
+
***Code Style:** Google Style (PascalCase for classes/functions, snake_case for variables).
100
+
***Formatting:**`clang-format` used on `.h` and `.cpp` files.
0 commit comments