How gobblergang/cplusplusclient works
Project type and purpose
• This is a C++-based Qt desktop client for secure vault management. It provides a GUI (Qt 6) through which users authenticate, manage encrypted vaults, store metadata in a local SQLite database, perform cryptographic operations (via OpenSSL, Argon2, Ed25519/X25519, etc.), and communicate with a remote server over HTTPS.
File structure
• Top-level:
• CMakeLists.txt, vcpkg files → build and dependency configuration
• main.cpp, UI.cpp → application entry point and Qt UI glue
• templates/FileOperationHandlers.hpp → generic handlers for file-based operations
• include/
• database/ → ORM schema, models.h, db_instance.h (using sqlite_orm)
• nlohmann/json.hpp → JSON parsing
• utils/ → Config, CryptoUtils, key classes (Ed25519Key, X25519Key, MasterKey, VaultManager), plus dataclasses (PAC, Vault)
• src/
• Auth.cpp/h → authentication flows (Argon2 hashing, login requests)
• DataManager.h → orchestration of data requests between UI, DB, crypto, and server
• FileOperations.cpp → low-level file I/O handlers
• Server.h → REST/HTTP client code to talk to remote server
• src/models/ → domain models (user, keys, PAC, KEK, file)
Key insights from README
• Dependencies: Qt 6.4+, OpenSSL, SQLite3, Argon2
• Build: Uses CMake + vcpkg for dependency management
• Configuration:
• local_config.cmake for library paths
• config.json (in build dir) for “server-url”
Main components
a. Frontend / UI Layer
• Components: Qt widgets, UI.cpp, main.cpp
• Role: Render views, capture user input, forward commands to application logic
b. Application Logic Layer
• Auth module (Argon2 hashing, login/logout flows)
• DataManager (coordinates DB access, crypto, remote calls)
• FileOperations (local file reads/writes)
c. Crypto Utilities
• Config, CryptoUtils, key management (Ed25519, X25519, MasterKey)
• VaultManager (encrypt/decrypt vault data)
d. Local Persistence Layer
• SQLite database via sqlite_orm
• Schema and models under include/database and src/models
e. Remote Server / Network Layer
• Server.h (HTTP/HTTPS client)
• External service: Remote vault-management API (configured via config.json)
f. External Dependencies
• Qt 6, OpenSSL, Argon2, SQLite3, nlohmann/json
Relationships & interactions
• UI → Application Logic (DataManager, Auth, FileOperations)
• Application Logic ↔ Local DB (ORM calls for CRUD on user, keys, vault metadata)
• Application Logic ↔ Crypto Utils (encrypt/decrypt operations, key generation)
• Application Logic ↔ Remote Server (REST API calls over HTTPS)
• FileOperations ↔ Local file system (storing encrypted payloads)
Architectural patterns & design principles
• Layered architecture (Presentation, Business Logic, Data, Infrastructure)
• MVC-style separation:
• View: Qt UI
• Controller: DataManager / Auth
• Model: database models + dataclasses
• Repository pattern: sqlite_orm abstracts persistence
• Dependency Injection via CMake + vcpkg toolchain
Final checklist for the principal software engineer
• Call out CMake/vcpkg as the build/configuration boundary
• Config.json → Server URL is represented as an external configuration input
• Be detalied: split “utils” into individual crypto/key components, split “database” into schema + models