A lightweight and efficient C++ application to manage "rooms" and communication over sockets. It enables JSON-based file manipulation, dynamic ID creation, and provides a structured environment for networking and client-server interactions.
All the essentials of a JSON-based “database” over raw sockets, in one place.
The server listens on a TCP port, handles each connected client in its own thread, and accepts three text commands:
- CREATE
- READ
- UPDATE
The client is a simple command-line interface that connects to 127.0.0.1 on the chosen port, sends your text commands, and prints whatever the server responds.
C++
Make
C++ compiler (e.g., g++ or clang++)
CMake
Make
Unix-based system (Linux or macOS)
Clone the repository:
$ git clone git@github.com/hmartiins/rdb
$ cd rdb
Build the project using cmake and make:
$ cmake .
$ make
Run the server and client in separate terminals:
#In one terminal
$ cd build/out
$ ./server
#In another terminal
$ cd build/out
$ ./client
.
.
├── .github/
│ └── assets/
│ └── Image.jpeg # Image used in README
├── src/
│ ├── json/
│ │ ├── create-file.hpp # Create JSON files
│ │ ├── read-file.hpp # Read JSON files
│ │ └── update-file.hpp # Update JSON files
│ ├── utils/
│ │ ├── random-id.hpp # ID generation helper
│ │ └── split.hpp # String splitting utilities
│ ├── client.cpp # Client-side application logic
│ ├── room_manager.hpp # Room control logic
│ ├── server.cpp # Server-side application logic
│ └── socket_utils.hpp # Socket helper functions
├── .gitignore
├── CMakeLists.txt # CMake build config
├── Makefile # Alternative build option
└── README.md # Project documentation
A big thank you to everyone contributing to the project. Below are some of our main contributors: