diff --git a/.gitignore b/.gitignore index e69de29..0e00ad1 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,3 @@ + +*/build/* +*.log diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..e69de29 diff --git a/DEVELOPING.md b/DEVELOPING.md new file mode 100644 index 0000000..79edffb --- /dev/null +++ b/DEVELOPING.md @@ -0,0 +1,10 @@ + +### Developing +This will eventually house useful information regarding the development of this software suite: + - Commands that would not be appropriate in scripts + - Obscure functionality + - Development guidelines + - Gitea repository recommendations + - and more! because I'm lazy right now + +🦭🦭 diff --git a/README.md b/README.md new file mode 100644 index 0000000..0354647 --- /dev/null +++ b/README.md @@ -0,0 +1,82 @@ +# Accordion + +A chat app built with C++ and raw networking. The client is built with C++ & QML; the server is headless C++ process intended to run in a docker container along with a PostgreSQL database. + +This project is an experiment and learning experience, not a discord clone. Eventually though, with enough maturity, this app can evolve to handle media sharing and real-time voice telemetry. + +### Design +The Accordion user space app (don't call it accordionUSA) is built with C++ + QML. Design principles are modularity, configurability, and performance (reactNative real quiet rn). In the future, +RtAudio shall be used for real-time audio management (wishful thinking 🥺). If not specified, "Accordion" shall refer to the client app, whereas the server must be explicitly mentioned. + +Networking on both sides will utilize OpenSSL for TLS security. The performance focus intends to bypass HTTP in favor of raw TCP. Therefore, this app will not expose a universal api (sadly) +and extra features like request methods and response checking are entirely up to us. Authentication, data streaming, and media handling are also made more difficult to the benefit of complete +packet control. + +The server is a headless C++ process that connects to a PostgreSQL database using libpqxx. A single server process along with a single database instance should represent the equivalent of one +discord server, with multiple users and text channels. Users are localized to only one server in this case, so external account tracking would be needed if per-server anonymity is not desired. +An Accordion server allows clients to view and publish chat messages; authentication is up in the air currently. 🤯 + +Total running list of external software source packages: + - OpenSSL: TLS Networking Security + - RtMidi: Realtime Audio I/O Processing + - libconfig++: Configuration File Interfacing + - more to come in the future 🐰 +Similarly, a list of dependent linux packages: + - openssl: needed for secure networking + - anything else that was fixed by running `sudo apt install package` + +## Development plan: +- [x] Build & project setup, get working hello-world program. +- [ ] TCP Demo between client and server +- [ ] Add TLS with OpenSSL on top of the TCP +- [ ] Build and deploy server to a Docker container in a CI/CD pipeline +- [ ] Implement PostgreSQL interfacing for the server +- [ ] Checkpoint the client<->server model for basic crud actions +- [ ] Create client GUI with QML: display responded messages and textbox + button for sending +- [ ] Support mutliple clients per server- identify unique users and attach them to messages +- [ ] Check Windows networking capabilities for cross-platform support on the client app +- [ ] Anything below here is future goals +- [ ] Test UDP packet sending +- [ ] RtAudio through UDP demo: simple loop-back test from client -> server -> back to client +- [ ] Multiple text channels, maybe a new table for each channel? might be overkill idk +- [ ] I think soundboards are really cool + +## Build Instructions + +Note: The server is intended for Linux only, and development for the client is still in Linux-only mode, at least in WSL. + +Prerequisites: +CMake: https://cmake.org/download/ \ +Qt6::QML: https://www.qt.io/development/download-qt-installer-oss \ +Note: you must export the Qt install location to your environment. E.g. add the following to a powershell profile: `$env:Qt6_DIR = "C:\Qt\6.10.1\msvc2022_64"` + +Compiler that supports C++20. Builds have been tested with GCC12 & MSVC17 + +Clone repository +```PowerShell +git clone https://git.vxbard.net/homeburger/accordion.git +git clone --recurse-submodules https://git.vxbard.net/homeburger/accordion.git # if there's submodules +git submodule update --init --recursive # if you cloned without submodules and need them +``` + +Build: +```PowerShell +# configure +> cmake -S . -B build +# build +> cmake --build build -j +``` +The top-level cmake will automatically build both the client and the server. If you don't want to bother with the server, cd into client directory first. + +Execute: +```Powershell +> .\build\Debug\accordion.exe +> .\build\Release\accordion.exe +``` +```bash +$ ./build/accordion +``` + +## Configurations +Configuration files are located in the config directory. They offer options to change the program's settings without recompiling. Eventually I might make a user's guide for the configurations, but there's not too much there right now. +Configurations also exist for the server, but must involve rebuilding and restarting the docker container (hip hip hooray for CI/CD) diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt new file mode 100644 index 0000000..e69de29 diff --git a/client/src/main.cpp b/client/src/main.cpp new file mode 100644 index 0000000..6bb9e4f --- /dev/null +++ b/client/src/main.cpp @@ -0,0 +1,8 @@ + +#include + +int main(int argc, char* argv[]) { + + std::cout << "hi mom from client!" << std::endl; + +} diff --git a/lib/.gitkeep b/lib/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/scripts/test.sh b/scripts/test.sh new file mode 100644 index 0000000..e69de29 diff --git a/server/CMakeLists.txt b/server/CMakeLists.txt new file mode 100644 index 0000000..e69de29 diff --git a/server/src/main.cpp b/server/src/main.cpp new file mode 100644 index 0000000..2c64d89 --- /dev/null +++ b/server/src/main.cpp @@ -0,0 +1,8 @@ + +#include + +int main(int argc, char* argv[]) { + + std::cout << "hi mom from server!" << std::endl; + +}