A high-performance, multi-threaded distributed inventory management system written in modern C++17.
This project utilizes a microservice architecture backed by PostgreSQL for persistent storage and Redis for high-speed queuing and caching. It is structured as a single Monorepo managed by CMake.
warehouse-c++/
βββ CMakeLists.txt # Master build orchestrator
βββ .gitignore # Global ignore rules
βββ libs/ # Shared Library Layer
β βββ Utility/ # Level 0: Foundation
β βββ FsLogger/ # Level 1: Core Systems
β βββ Storage/ # Level 2: Data Access
βββ services/ # Executable Layer
βββ PartMaster-API/ # Level 3: REST API Ingress
βββ PartMaster-Worker/ # Level 3: Background Processor
π§© Components
* libs/Utility: The foundational layer. It handles global configuration parsing (config.conf) and provides a tool for encrypting sensitive database credentials.
* libs/FsLogger: A custom, thread-safe logging framework used across all microservices to provide unified, file-based logging for auditing and debugging.
* libs/Storage: The Data Access Layer. It wraps libpqxx (PostgreSQL) and hiredis (Redis), managing the connection pools and executing CRUD operations for inventory parts.
* services/PartMaster-API: A high-speed, stateless REST API built with the Crow framework. It sits behind an Nginx Load Balancer, accepts incoming HTTP requests, and pushes "Write" jobs into a Redis queue.
* services/PartMaster-Worker: A multi-threaded backend processor. It listens to the Redis queue (BRPOP), executes heavy SQL transactions asynchronously, and rebuilds the global Redis cache to prevent database bottlenecks.
π How to Build
This project uses a top-down CMake build process. From the root directory:
mkdir build && cd build
cmake ..
make -j$(nproc)
The executables will be generated in build/services/PartMaster-API/ and build/services/PartMaster-Worker/.