Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
d3bca2d
Add RSA as submodule
LordofGhost Jun 25, 2026
e5b9095
Setup cmake with two executables
LordofGhost Jun 25, 2026
f994177
Create singleton in client and server
LordofGhost Jun 25, 2026
073b049
Add destructor to client and server
LordofGhost Jun 25, 2026
7a439ce
Rename executable
LordofGhost Jun 25, 2026
28b83f8
Add QT QML to project
LordofGhost Jun 26, 2026
e1c821a
Remove terminal window on client start
LordofGhost Jun 26, 2026
6173230
Add qml file
LordofGhost Jun 26, 2026
8ff9564
Update README
LordofGhost Jun 26, 2026
ff4075b
Update dependency chart in README
LordofGhost Jun 26, 2026
0a9b774
Refine labels in README diagram
LordofGhost Jun 26, 2026
82ee034
Add qt network module
LordofGhost Jun 30, 2026
387be6c
Add links to graphic
LordofGhost Jun 30, 2026
ea8b2c5
Update CI pipeline for multi platform support
LordofGhost Jun 30, 2026
de76c2f
Add pipeline support for recursive submodules
LordofGhost Jun 30, 2026
64b82b3
Apply Clang formatting
LordofGhost Jun 30, 2026
71c755a
fix windows at install
LordofGhost Jun 30, 2026
0f04226
Merge remote-tracking branch 'origin/feature/setup' into feature/setup
LordofGhost Jun 30, 2026
dc2f9ac
fix ubuntu runner
LordofGhost Jun 30, 2026
d23ec67
Cleanup ci pipeline
LordofGhost Jul 1, 2026
24b35d2
Update CI
LordofGhost Jul 1, 2026
dbd686d
Rollback CI to previous state
LordofGhost Jul 1, 2026
dad7ef9
Fix ubuntu runner
LordofGhost Jul 1, 2026
ca0d2a6
try new ubuntu runner pipeline
LordofGhost Jul 1, 2026
18bfda5
Set Qt version
LordofGhost Jul 1, 2026
75ad0e8
different qt version
LordofGhost Jul 1, 2026
7b2b30e
user macos 26
LordofGhost Jul 1, 2026
f0b703f
rollback to macos 15 because of AGL framework
LordofGhost Jul 1, 2026
e9fb357
Add macos 26 with later qt version
LordofGhost Jul 1, 2026
41f9912
Remove old macos version
LordofGhost Jul 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 54 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,22 @@ jobs:
fail-fast: false
matrix:
config:
- { name: "Windows gcc", os: windows-latest, cc: "gcc", cxx: "g++" }
- { name: "Ubuntu gcc", os: ubuntu-latest, cc: "gcc", cxx: "g++" }
- { name: "MacOS clang", os: macos-latest, cc: "clang", cxx: "clang++" }
- { name: "Windows gcc", os: windows-latest, cc: "gcc", cxx: "g++", qt-version: "", qt-arch: "", cmake-extra: "" }
- { name: "Ubuntu gcc", os: ubuntu-latest, cc: "gcc", cxx: "g++", qt-version: "6.5.3", qt-arch: "gcc_64", cmake-extra: "" }
- { name: "MacOS 26 clang", os: macos-26, cc: "clang", cxx: "clang++", qt-version: "6.9.2", qt-arch: "clang_64", cmake-extra: "-DCMAKE_OSX_ARCHITECTURES=arm64" }
build-configuration: [ Debug, Release ]

steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
submodules: true
submodules: recursive

- name: Install Ninja (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y ninja-build
sudo apt-get install -y ninja-build libgl1-mesa-dev

- name: Install Ninja (macOS)
if: runner.os == 'macOS'
Expand All @@ -41,22 +41,63 @@ jobs:
fi


- name: Install Ninja (Windows)
- name: Install Qt (Linux/macOS)
if: runner.os != 'Windows'
uses: jurplel/install-qt-action@v4
with:
version: ${{ matrix.config.qt-version }}
target: 'desktop'
arch: ${{ matrix.config.qt-arch }}

- name: Verify Qt tool dependencies (Linux)
if: runner.os == 'Linux'
run: |
ldd "$QT_ROOT_DIR/libexec/qmlimportscanner"
! ldd "$QT_ROOT_DIR/libexec/qmlimportscanner" | grep "not found"

- name: Install Qt (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: choco install ninja -y
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: >-
mingw-w64-x86_64-gcc
mingw-w64-x86_64-cmake
mingw-w64-x86_64-ninja
mingw-w64-x86_64-qt6-base
mingw-w64-x86_64-qt6-declarative

- name: Configure CMake (Linux/macOS)
if: runner.os != 'Windows'
run: |
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.build-configuration }} -DCMAKE_C_COMPILER=${{ matrix.config.cc }} -DCMAKE_CXX_COMPILER=${{ matrix.config.cxx }} -DCMAKE_PREFIX_PATH="${{ env.QT_ROOT_DIR }}" ${{ matrix.config.cmake-extra }}

- name: Configure CMake
- name: Configure CMake (Windows)
if: runner.os == 'Windows'
shell: msys2 {0}
run: |
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.build-configuration }} -DCMAKE_C_COMPILER=${{ matrix.config.cc }} -DCMAKE_CXX_COMPILER=${{ matrix.config.cxx }}
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.build-configuration }} -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_PREFIX_PATH=/mingw64

- name: Build Project (Linux/macOS)
if: runner.os != 'Windows'
run: cmake --build build --config ${{ matrix.build-configuration }}

- name: Build Project
- name: Build Project (Windows)
if: runner.os == 'Windows'
shell: msys2 {0}
run: cmake --build build --config ${{ matrix.build-configuration }}

- name: Run Catch2 Unit Tests
- name: Run Catch2 Unit Tests (Linux/macOS)
if: runner.os != 'Windows'
# Runs the unit tests you specified
run: ctest --test-dir build -C ${{ matrix.build-configuration }} --output-on-failure

- name: Run Catch2 Unit Tests (Windows)
if: runner.os == 'Windows'
shell: msys2 {0}
run: ctest --test-dir build -C ${{ matrix.build-configuration }} --output-on-failure

# We only package and upload 'Release' builds to save storage and time
- name: Compress Release Build Directory
if: matrix.build-configuration == 'Release'
Expand Down Expand Up @@ -107,4 +148,4 @@ jobs:
gh release create "$TAG_NAME" ./release-artifacts/*.zip \
--title "Development Build $TAG_NAME" \
--prerelease \
--generate-notes
--generate-notes
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "lib/RSA"]
path = lib/RSA
url = https://github.com/ParallelEngineering/RSA.git
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
cmake_minimum_required(VERSION 3.28.3)
project(Messenger)

# Enforce C++20 and disable compiler-specific extensions
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

add_subdirectory(lib)
add_subdirectory(src)

#target_link_libraries(Messenger PRIVATE RSA)
60 changes: 59 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,60 @@
# Messenger
A client to server chat system based on RSA

Messenger is a cross-platform client-server messenger application based on the RSA algorithm. The project is still in an early stage and currently provides the foundation for the client and server.

## Architecture

The repository contains two applications: `Messenger-Client` and `Messenger-Server`. The client is built with Qt/QML; the server is a terminal program.

Both applications use a singleton through `getInstance()`. The project is built with CMake and C++20, with the RSA library included as a submodule.

## Dependencies

```mermaid
flowchart TD
Client["Messenger-Client"]
Server["Messenger-Server"]
RSA["RSA"]
QtGUI["Qt QML"]
QtNetwork["Qt Network"]

Client --> QtGUI
Client --> QtNetwork
Server --> QtNetwork
Client --> RSA
Server --> RSA

click QtGUI "https://doc.qt.io/qt-6/qtquick-index.html" "Qt Quick/QML documentation"
click QtNetwork "https://doc.qt.io/qt-6/qtnetwork-index.html" "Qt Network documentation"
click RSA "https://github.com/ParallelEngineering/RSA"
```

The application depends on the RSA library for encryption, Qt Quick/QML for the graphical client, and Qt Network for networking functionality.

## Setup

> [!NOTE]
> Qt must be installed locally for the client so CMake can resolve `find_package(Qt6 COMPONENTS Quick Qml REQUIRED)`. The official installation guide is available in the [Qt documentation](https://doc.qt.io/qt-6/get-and-install-qt.html).

Clone the repository including its submodules:

```bash
git clone --recurse-submodules https://github.com/ParallelEngineering/Messenger.git
```

If the repository has already been cloned without submodules, they can be initialized recursively with remote updates:

```bash
git submodule update --init --recursive --remote
```

## Build

The project can be configured and built with CMake:

```bash
cmake -S . -B cmake-build-debug
cmake --build cmake-build-debug
```

This creates the `Messenger-Client` and `Messenger-Server` targets.
4 changes: 4 additions & 0 deletions lib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
if(NOT EXISTS "${CMAKE_CURRENT_LIST_DIR}/RSA/CMakeLists.txt")
message(FATAL_ERROR "RSA submodule not initialized. Run: git submodule update --init --recursive")
endif()
add_subdirectory(RSA)
1 change: 1 addition & 0 deletions lib/RSA
Submodule RSA added at 480dfb
3 changes: 3 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
add_subdirectory(shared)
add_subdirectory(client)
add_subdirectory(server)
28 changes: 28 additions & 0 deletions src/client/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
find_package(Qt6 COMPONENTS Quick Qml Network REQUIRED)

qt_standard_project_setup(REQUIRES 6.5)

qt_add_executable(Messenger-Client
WIN32
MACOSX_BUNDLE
client.cpp
)

set_target_properties(Messenger-Client PROPERTIES
MACOSX_BUNDLE_BUNDLE_NAME Messenger
MACOSX_BUNDLE_GUI_IDENTIFIER de.ParallelEngineering.Messenger
)

qt_add_qml_module(Messenger-Client
URI Messenger.Client
VERSION 1.0
QML_FILES
Main.qml
)

target_link_libraries(Messenger-Client
PRIVATE
Qt6::Quick
Qt6::Qml
Qt6::Network
)
10 changes: 10 additions & 0 deletions src/client/Main.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import QtQuick

Window {
width: 960
height: 640
visible: true
title: qsTr("Messenger Client")

color: "#f7f8fa"
}
36 changes: 36 additions & 0 deletions src/client/client.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#include "client.h"

#include <QGuiApplication>
#include <QQmlApplicationEngine>

client& client::getInstance() {
static client instance;
return instance;
}

client::client() = default;

client::~client() = default;

int client::run(QGuiApplication& app) {
engine_ = std::make_unique<QQmlApplicationEngine>();
engine_->loadFromModule("Messenger.Client", "Main");

if (engine_->rootObjects().isEmpty()) {
engine_.reset();
return -1;
}

const auto exitCode = app.exec();
engine_.reset();

return exitCode;
}

int main(int argc, char* argv[]) {
QGuiApplication app(argc, argv);

auto& clientInstance = client::getInstance();

return clientInstance.run(app);
}
27 changes: 27 additions & 0 deletions src/client/client.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#ifndef MESSENGER_CLIENT_H
#define MESSENGER_CLIENT_H

#include <memory>

class QGuiApplication;
class QQmlApplicationEngine;

class client {
public:
static client& getInstance();
~client();

int run(QGuiApplication& app);

client(const client&) = delete;
client& operator=(const client&) = delete;
client(client&&) = delete;
client& operator=(client&&) = delete;

private:
client();

std::unique_ptr<QQmlApplicationEngine> engine_;
};

#endif // MESSENGER_CLIENT_H
5 changes: 5 additions & 0 deletions src/server/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
find_package(Qt6 REQUIRED COMPONENTS Network)

add_executable(Messenger-Server server.cpp)

target_link_libraries(Messenger-Server PRIVATE Qt6::Network)
19 changes: 19 additions & 0 deletions src/server/server.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include "server.h"

#include <iostream>

server& server::getInstance() {
static server instance;
return instance;
}

server::server() { std::cout << "Starting Messenger Server ...\n"; }

server::~server() { std::cout << "Stopping Messenger Server ...\n"; }

int main() {
auto& serverInstance = server::getInstance();
(void)serverInstance;

return 0;
}
18 changes: 18 additions & 0 deletions src/server/server.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#ifndef MESSENGER_SERVER_H
#define MESSENGER_SERVER_H

class server {
public:
static server& getInstance();
~server();

server(const server&) = delete;
server& operator=(const server&) = delete;
server(server&&) = delete;
server& operator=(server&&) = delete;

private:
server();
};

#endif // MESSENGER_SERVER_H
Loading