{"id":14973924,"url":"https://github.com/flaviomarcio/qrpc","last_synced_at":"2025-04-26T23:31:43.446Z","repository":{"id":209546271,"uuid":"249057936","full_name":"flaviomarcio/qrpc","owner":"flaviomarcio","description":"Qt-Remote process call using http/rest, websocket, localsocket, tcp, udp, mqtt, amqp","archived":false,"fork":false,"pushed_at":"2023-11-25T22:06:55.000Z","size":834,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-04T18:22:48.634Z","etag":null,"topics":["amqp","cpp","http","iot","mqtt","mssql","odbc","oracle","postgres","psql","qt","rest","rpc","sqlite","websocket"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flaviomarcio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-03-21T20:46:17.000Z","updated_at":"2025-01-11T13:27:13.000Z","dependencies_parsed_at":"2023-11-28T00:36:47.206Z","dependency_job_id":null,"html_url":"https://github.com/flaviomarcio/qrpc","commit_stats":null,"previous_names":["flaviomarcio/qrpc"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flaviomarcio%2Fqrpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flaviomarcio%2Fqrpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flaviomarcio%2Fqrpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flaviomarcio%2Fqrpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flaviomarcio","download_url":"https://codeload.github.com/flaviomarcio/qrpc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251068038,"owners_count":21531475,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["amqp","cpp","http","iot","mqtt","mssql","odbc","oracle","postgres","psql","qt","rest","rpc","sqlite","websocket"],"created_at":"2024-09-24T13:49:41.346Z","updated_at":"2025-04-26T23:31:43.111Z","avatar_url":"https://github.com/flaviomarcio.png","language":"C++","readme":"# QRpc\n\n**Client/Server to working remote process call.**\n\n\n## Working architecture\n\n\u003e## Support\n\u003e\u003e## Request\n\u003e\u003e HTTP/REST, LocalSocket, TCP, UPD, WebSocket \n\u003e\u003e## Streaming\n\u003e\u003e Brokers Database, AMQP, MQTT, KAFKA\n\n```mermaid\ngraph TD;\nA[QRPCServer] \nA --\u003e B(QRPCListen)\nB --\u003e BA(QRPCListenHTTP/REST)--\u003e C\nB --\u003e BB(QRPCListenLocalSocket)--\u003e C\nB --\u003e BC(QRPCListenTCP)--\u003e C\nB --\u003e BD(QRPCListenUDP)--\u003e C\nB --\u003e BE(QRPCListenWebSocket)--\u003e C\nB --\u003e BF(QRPCListenBrokerAMQP)--\u003e C\nB --\u003e BG(QRPCListenBrokerDataBase)--\u003e C\nB --\u003e BH(QRPCListenBrokerKAFKA)--\u003e C\nB --\u003e BI(QRPCListenBrokerMQTT)--\u003e C\nC[QRPCListenQRPC]--\u003e CA[QRPCListenQRPCSlot] --\u003e CAA[QRPCController]\n```\n\n## Prerequisits\n\u003e```bash\n\u003e mkdir myproject;\n\u003e cd myproject;\n\u003e git clone git@github.com:flaviomarcio/qstm.git;\n\u003e git clone git@github.com:flaviomarcio/qrpc.git;\n\u003e```\n\u003eCheck example in QRpc/example/server-rest\n\n\n## CMake Build information\n\n\u003e```\n\u003e## initial CMake parameters \n\u003e\n\u003e-GNinja\n\u003e-DCMAKE_BUILD_TYPE:STRING=Debug\n\u003e-DCMAKE_PROJECT_INCLUDE_BEFORE:PATH=%{IDE:ResourcePath}/package-manager/auto-setup.cmake\n\u003e-DQT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}\n\u003e-DCMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}\n\u003e-DCMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}\n\u003e-DCMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}\n\u003e-DCMAKE_INSTALL_PREFIX=~/build/qcrosscache/install/Debug\n\u003e```\n\n\u003e```bash\n\u003e cd qrpc\n\u003e mkdir build;\n\u003e cd build;\n\u003e cmake ..\n\u003e make;\n\u003e make install;\n\u003e```\n\n## QMake Build information\n\n\u003e```bash\n\u003e cd qrpc\n\u003e qmake qrpc.pro\n\u003e make;\n\u003e make install;\n\u003e ls -l;\n\u003e```\n\n## QMake project\n\n\u003e```c++\n\u003eQT -= gui\n\u003e\n\u003eCONFIG += c++17 console silent\n\u003eCONFIG -= app_bundle\n\u003e\n\u003einclude($$PWD/../../../qstm/qstm.pri)\n\u003einclude($$PWD/../../qrpc.pri)\n\u003e\n\u003eSOURCES += \\\n\u003e        controllerMethods.cpp \\\n\u003e        main.cpp\n\u003e\n\u003eRESOURCES += \\\n\u003e    settings.qrc\n\u003e\n\u003eHEADERS += \\\n\u003e    controllerMethods.h\n\u003e```\n\n## Resource settings\n\n\u003eSettings http/rest server saved in setting.json and included in settings.qrc\n\u003e```json\n\u003e{\n\u003e   \"arguments\":[\"ws\"],\n\u003e   \"protocol\":{\n\u003e      \"default\":{\n\u003e         \"minThreads\":1,\n\u003e         \"maxThreads\":2000,\n\u003e         \"cleanupInterval\":1000,\n\u003e         \"readTimeout\":60000,\n\u003e         \"maxRequestSize\":104857600,\n\u003e         \"maxMultiPartSize\":1048576000,\n\u003e         \"enabled\":false,\n\u003e         \"sslKeyFile\":\"\",\n\u003e         \"sslCertFile\":\"\"\n\u003e      },\n\u003e      \"http\":{\n\u003e        \"enabled\":true,\"port\":[8888]\n\u003e      }\n\u003e   },\n\u003e   \"connection\":{\n\u003e       \"secret\": \"YzUxNDFhMDA5\",\n\u003e       \"enviroment\" : \"debug\",\n\u003e       \"paramaters\" : {\n\u003e           \"debug\":{\n\u003e               \"driver\":\"QPSQL\",\n\u003e               \"hostName\":\"localhost\",\n\u003e               \"userName\":\"localuser\",\n\u003e               \"password\":\"localuser\",\n\u003e               \"port\":5432,\n\u003e               \"dataBaseName\":\"postgres\",\n\u003e               \"schemaNames\":\"public\"\n\u003e           }\n\u003e       }\n\u003e   }\n\u003e}\n\u003e```\n\n## HTTP/REST Server\n\n\u003eCheck example in QRpc/example/server-rest\n\u003e```c++\n\u003e \n\u003e//main implementation\n\u003e#include \u003cQCoreApplication\u003e\n\u003e#include \u003cQRpc/Server\u003e\n\u003e\n\u003eint main(int argc, char *argv[])\n\u003e{\n\u003e    QCoreApplication a(argc, argv);\n\u003e\n\u003e    //server class\n\u003e    QRpc::QRPCServer server;\n\u003e\n\u003e    //set settings to run service\n\u003e    if(!server.setSettingsFileName(QStringLiteral(\":/settings.json\"))){\n\u003e        qWarning()\u003c\u003c\"invalid settings\";\n\u003e        return 0;\n\u003e    }\n\u003e\n\u003e    //start service\n\u003e    server.start();\n\u003e\n\u003e    //start eventloop application\n\u003e    return a.exec();\n\u003e}\n\u003e```\n\n## Methods implementations\n\n\u003eCheck example in QRpc/example/server-rest\n\u003e\n\u003e```c++\n\u003e#include \u003cQRpc/Server\u003e\n\u003e\n\u003e//!\n\u003e//! \\brief The ControllerMethods class\n\u003e//!\n\u003e//! inhetihed of QRpc::QRPCController\n\u003eclass ControllerMethods : public QRpc::QRPCController\n\u003e{\n\u003e    Q_OBJECT\n\u003epublic:\n\u003e    //!\n\u003e    //! \\brief ControllerMethods\n\u003e    //! \\param parent\n\u003e    //!\n\u003e    //! necessary Q_INVOKABLE\n\u003e    Q_INVOKABLE explicit ControllerMethods(QObject *parent = nullptr);\n\u003e\n\u003e\n\u003e    //!\n\u003e    //! \\brief authorization\n\u003e    //! \\return\n\u003e    //!\n\u003e    //! authorization validations\n\u003e    //! check more authorization methods:\n\u003e    //!     canAuthorization\n\u003e    //!     beforeAuthorization\n\u003e    //!     afterAuthorization\n\u003e    //!\n\u003e    virtual bool authorization();\n\u003e\n\u003e    //!\n\u003e    //! \\brief listObjects\n\u003e    //! \\return\n\u003e    //!\n\u003e    //! method to return object list, necessary Q_INVOKABLE\n\u003e    //! check more Invoke methods:\n\u003e    //!     requestBeforeInvoke\n\u003e    //!     requestAfterInvoke\n\u003e    Q_INVOKABLE QVariant listObjects();\n\u003e\n\u003e};\n\u003e\n\u003e//auto register interface\n\u003eQRPC_CONTROLLER_AUTO_REGISTER(ControllerMethods)   \n\u003e```\n\n\n## Example\n\n\u003eCheck example in QRpc/example/server-rest\n\u003e```bash\n\u003e curl -i http://localhost:8888/listObjects?limit=1\n\u003e ```\n\u003e```bash\n\u003eHTTP/1.1 200 (OK)\n\u003eVary: Accept-Encoding, Origin\n\u003eDate: Sat Jan 15 18:50:02 2022\n\u003eContent-Length: 59\n\u003eServer: Undef\n\u003e```\n\u003e\n\u003e```json\n\u003e[{\"index\":1,\"uuid\":\"ba01138f-f7b0-4874-a879-caa591ab9e55\"}]\n\u003e```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflaviomarcio%2Fqrpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflaviomarcio%2Fqrpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflaviomarcio%2Fqrpc/lists"}