NovaChatServer - is not a commercial educational project, just for fun.
- cmake
- doxygen
- boost-beast
- boost-asio
- openssl
- boost-uuid
- nlohmann-json
- libpqxx
- jwt-cpp
- boost program-options
- boost-algorithm
- googletest
This is an backend REST API server. The server supports endpoints for implementing chat functions. Key server features:
- Modular project structure;
- Asynchronous multithreaded architecture;
- SSL/TLS support for HTTPS;
- PostgreSQL support with secure connections;
- JWT authentication support;
- Registration, login, and logout;
- Access token update via refresh token;
- Password change;
- Account deletion;
- View user list with pagination and search;
- Search for users by login;
- Sending messages;
- Receiving messages (with unread filter);
- Marking messages as read;
- Password (MD5) and token (SHA-256) hashing;
- HTTPS/SSL;
- JWT authentication with token expiration time;
- Protection against web attacks;
- JSON file with server, SSL, database, JWT, and logging settings;
- Tables:
users,messages,refresh_tokens; - Triggers and functions for checking message validity and deleting expired tokens;
A description of the API look in this guide.
A description of the API for Swagger Editor look here.
- Install the database PostgreSQL;
- Configure a remote connection to the database;
- Generate SSL certificates and set up a secure connection to the database;
- Create a database user;
- Create tables, relationships, functions, triggers using this guide;
- Generate SSL certificates for the server;
- Copy the certificates to the
src/sslCertsfolder; - Edit the config file
src/config.jsonusing this guide;
vcpkg install boost-beast boost-asio openssl boost-uuid nlohmann-json libpqxx jwt-cpp boost-program-options boost-algorithm gtest
vcpkg integrate installGenerate cmake files:
cd NovaChatServer
mkdir build && cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE="path/to/vcpkg/scripts/buildsystems/vcpkg.cmake"Build:
# debug
cmake --build .
# release
cmake --build . --config ReleasectestA collection with tests for Postman look here.
