A comprehensive inventory management system for electronic components with advanced tracking, multi-location support, and project management capabilities.
Invelog is a robust inventory management solution designed to track electronic components across multiple locations, containers, and projects. Built with scalability and flexibility in mind, it provides real-time tracking of components with unique identification and comprehensive activity logging.
- Multi-Location Support: Manage inventory across multiple physical locations
- Container Management: Organize items in containers and subcontainers
- Category System: Classify components by categories for easy organization
- UUID Tracking: Every subcontainer and item is assigned a unique identifier for precise tracking
- Main Storage Containers: Designated inventory containers for primary storage
- Project-Specific Containers: Create dedicated containers for individual projects
- Item Movement: Seamlessly transfer items between main inventory and project containers
- Component Tracking: Monitor individual components regardless of their current location
- Usage Tracking: Log all activity for each item in the system
- Check-In/Check-Out: Track when items are checked out and checked in
- Time Monitoring: Record the duration items spend in different containers or projects
- Audit Trail: Maintain complete history of component movements and usage
- Project Creation: Set up projects with dedicated container allocation
- Resource Allocation: Move components from main inventory to project-specific containers
- Project Tracking: Monitor component usage per project over time
- Local File-Based Storage: Perfect for single-user scenarios and offline access
- SQL Database Integration: Connect to PostgreSQL, MySQL, SQLite, or MS SQL Server
- REST API Support: Integrate with cloud-native applications via HTTP API
- Custom Database Server: Deploy standalone server for multi-client access
- Seamless Switching: Change database backends without modifying application code
- Transaction Support: ACID compliance for SQL databases
- Connection Pooling: Optimized performance for multi-user scenarios
- Schema Management: Automatic table creation and migration support
Invelog leverages object-oriented programming (OOP) to provide a clean, maintainable codebase with clear separation of concerns. The system architecture supports:
- Modular Design: Easy to extend and customize
- Database Abstraction: Switch between local and SQL databases seamlessly
- Scalability: Handles small workshops to large enterprise inventories
- Electronics Workshops: Track components across multiple storage locations
- Makerspaces: Manage shared inventory and project-specific allocations
- R&D Labs: Monitor component usage across research projects
- Manufacturing: Track parts from warehouse to production floor
- Educational Institutions: Manage lab equipment and student project materials
- Multi-Location Teams: Share inventory data across network with database server
- Remote Teams: Access centralized inventory via REST API from anywhere
- CMake 3.15 or higher
- C++17 compatible compiler (Visual Studio 2017+, GCC 7+, or Clang 5+)
# Navigate to project directory
cd "path\to\Invelog"
# Create build directory
mkdir build
cd build
# Generate build files
cmake ..
# Build the project
cmake --build . --config Release
# Run the demo
.\bin\Release\invelog.exe
# Or run the database server
.\bin\Release\invelog_server.exe --local ./data --port 8080 --api-key mySecretKeyFor detailed build instructions, see docs/BUILD.md.
For a comprehensive quick start guide, see docs/QUICKSTART.md.
#include "InventoryManager.h"
#include "LocalDatabase.h"
int main() {
    // Initialize with local database
    auto database = std::make_shared<LocalDatabase>("./data");
    InventoryManager manager(database);
    manager.initialize();
    
    // Create entities
    auto category = manager.createCategory("Resistors");
    auto location = manager.createLocation("Main Warehouse");
    auto container = manager.createContainer("Storage Box 1");
    auto item = manager.createItem("Resistor 1kΞ©", category, 100);
    
    // Organize inventory
    location->addContainer(container);
    manager.moveItem(item->getId(), container->getId());
    
    // Shutdown
    manager.shutdown();
    return 0;
}// Option 1: Local File-Based Database
auto localDb = std::make_shared<LocalDatabase>("./data");
// Option 2: PostgreSQL Database
SQLDatabase::ConnectionConfig sqlConfig;
sqlConfig.type = SQLDatabase::SQLType::POSTGRESQL;
sqlConfig.host = "localhost";
sqlConfig.port = 5432;
sqlConfig.database = "invelog";
sqlConfig.username = "user";
sqlConfig.password = "pass";
auto sqlDb = std::make_shared<SQLDatabase>(sqlConfig);
// Option 3: REST API Database
APIDatabase::APIConfig apiConfig;
apiConfig.baseUrl = "https://api.example.com";
apiConfig.authType = APIDatabase::AuthType::BEARER_TOKEN;
apiConfig.authToken = "your-token-here";
auto apiDb = std::make_shared<APIDatabase>(apiConfig);
// All databases use the same interface!
InventoryManager manager(localDb); // or sqlDb, or apiDbFor more database examples, see examples/database_examples.cpp.
The modular database server offers enhanced configuration options:
# Start server with all features
.\bin\Release\invelog_server.exe --local ./data --port 8080 --api-key mySecretKey --cors
# Start server with PostgreSQL and custom limits
.\bin\Release\invelog_server.exe --postgres "host=localhost dbname=invelog" --port 8080 --max-request 20971520 --timeout 600
# Start server for network access with CORS
.\bin\Release\invelog_server.exe --sqlite ./invelog.db --port 8080 --api-key secureKey456 --corsNew Configuration Options (v0.3.0):
- --cors- Enable CORS headers for web applications
- --max-request <bytes>- Set maximum request size (default: 10 MB)
- --timeout <seconds>- Set request timeout (default: 300s)
- --no-auth- Disable authentication for development
Clients can then connect from anywhere:
APIDatabase::APIConfig config;
config.baseUrl = "http://192.168.1.100:8080";  // Server IP
config.authType = APIDatabase::AuthType::API_KEY;
config.authToken = "secureKey456";
InventoryManager manager(std::make_shared<APIDatabase>(config));For deployment guide, see docs/DEPLOYMENT_GUIDE.md. For modular architecture details, see MODULAR_ARCHITECTURE.md.
Version 0.3.0 - Modular Server Architecture β
All essential backend components have been implemented with professional architecture:
- β Complete data model (Item, Container, Location, Project, Category)
- β UUID-based tracking system
- β Activity logging and audit trails
- β Check-in/check-out operations
- β Search and query capabilities
- β Local file-based database
- β SQL database support (PostgreSQL, MySQL, SQLite, MS SQL Server)
- β REST API database integration
- β Database abstraction layer for seamless switching
- β Modular server architecture (HTTP, Routes, Serialization, Auth)
- β External dependencies integrated (nlohmann/json, cpp-httplib, SQLite3)
- β Production-ready REST API server with authentication
- β CORS support and configurable security
- β Comprehensive demo applications
- β CMake build system with FetchContent
- β Full documentation
Latest Updates (v0.3.0):
- π Modular Architecture: Refactored 1,200+ line monolithic server into clean, maintainable modules
- π Separation of Concerns: HTTP, Routes, Serialization, and Auth in separate modules
- π Enhanced Configuration: ServerConfig with CORS, timeouts, request limits
- π Professional Code Quality: Each module 20-220 lines, easy to test and maintain
Next Steps:
- π Frontend development (Web UI)
- π Unit testing framework
- π Rate limiting and advanced security
- π Real-time updates via WebSocket
See docs/ROADMAP.md for planned features and development timeline.
- Modular Architecture - New modular server design (v0.3.0)
- Architecture Guide - System design and patterns
- Build Instructions - Detailed build guide for all platforms
- Quick Start Guide - Get up and running quickly
- Database Guide - External database setup and configuration
- API Documentation - REST API reference for database server
- Deployment Guide - Deploy database server in production
- Dependency Guide - External dependencies and CMake FetchContent
- Development Roadmap - Planned features and timeline
The system is built with the following core components:
- UUID System: Cryptographically secure unique identifiers
- Data Models: Item, Container, Location, Project, Category, ActivityLog
- Database Layer: Abstract interface with three implementations:
- LocalDatabase: File-based storage for single-user scenarios
- SQLDatabase: Enterprise SQL support (PostgreSQL, MySQL, SQLite, MS SQL)
- APIDatabase: REST API integration for cloud-native applications
 
- Modular Server Architecture (v0.3.0):
- HTTP Module: Request/response handling with cpp-httplib
- Route Handlers: Dedicated handlers per entity type (Items, Containers, etc.)
- JSON Serialization: Centralized entity β JSON conversion
- Authentication: API key and Bearer token support
- Configuration: Flexible ServerConfig with CORS, timeouts, limits
 
- Database Server: Standalone HTTP REST API server for multi-client access
- Business Logic: InventoryManager facade for all operations
- Activity Tracking: Comprehensive logging of all operations
- External Dependencies: Automatic download via CMake FetchContent
- nlohmann/json v3.11.3
- cpp-httplib v0.15.3
- SQLite3 amalgamation
 
Contributions are welcome! Here are some areas where you can help:
- Frontend Development - Web-based UI for inventory management
- Unit Tests - Build comprehensive test suite
- Rate Limiting - Add rate limiter middleware to server
- WebSocket Support - Real-time inventory updates
- Migration System - Database schema versioning
- Batch Operations - Bulk import/export
- Advanced Search - Full-text search capabilities
- Metrics & Monitoring - Prometheus metrics endpoint
- GraphQL API - Alternative API alongside REST
- Fork the repository
- Create a feature branch (git checkout -b feature/amazing-feature)
- Commit your changes (git commit -m 'Add amazing feature')
- Push to the branch (git push origin feature/amazing-feature)
- Open a Pull Request
See docs/ROADMAP.md for detailed feature planning.
Invelog/
βββ include/                     # Core library headers
β   βββ UUID.h                   # Unique identifier system
β   βββ Item.h                   # Inventory item model
β   βββ Container.h              # Storage container model
β   βββ Location.h               # Physical location model
β   βββ Project.h                # Project management model
β   βββ Category.h               # Category system
β   βββ ActivityLog.h            # Activity tracking
β   βββ Database.h               # Database interface
β   βββ LocalDatabase.h          # File-based database
β   βββ SQLDatabase.h            # SQL database support
β   βββ APIDatabase.h            # REST API database
β   βββ DatabaseServer.h         # Legacy server (deprecated)
β   βββ InventoryManager.h       # Main API facade
βββ src/                         # Core implementations + executables
β   βββ *.cpp                    # Core implementations
β   βββ main.cpp                 # Demo application
β   βββ server_main.cpp          # Database server entry point
βββ server/                      # Modular server architecture (v0.3.0)
β   βββ include/
β   β   βββ http/                # HTTP abstractions
β   β   β   βββ HTTPRequest.h
β   β   β   βββ HTTPResponse.h
β   β   β   βββ RouteHandler.h
β   β   β   βββ HTTPServer.h
β   β   βββ routes/              # Entity route handlers
β   β   β   βββ ItemRoutes.h
β   β   β   βββ ContainerRoutes.h
β   β   β   βββ LocationRoutes.h
β   β   β   βββ ProjectRoutes.h
β   β   β   βββ CategoryRoutes.h
β   β   β   βββ ActivityLogRoutes.h
β   β   βββ serialization/       # JSON conversion
β   β   β   βββ JSONSerializer.h
β   β   β   βββ JSONDeserializer.h
β   β   βββ auth/                # Authentication
β   β   β   βββ Authenticator.h
β   β   βββ ServerConfig.h       # Server configuration
β   β   βββ DatabaseAPIServer.h  # Server coordinator
β   βββ src/                     # Modular implementations
βββ examples/                    # Example applications
β   βββ database_examples.cpp    # Database backend demos
β   βββ server_client_demo.cpp   # Server/client demo
βββ docs/                        # Documentation
β   βββ ARCHITECTURE.md          # System architecture
β   βββ ARCHITECTURE_DIAGRAMS.md # Architecture diagrams
β   βββ BUILD.md                 # Build instructions
β   βββ QUICKSTART.md            # Quick start guide
β   βββ DATABASE_GUIDE.md        # Database backend guide
β   βββ DEPENDENCY_GUIDE.md      # External dependencies
β   βββ API_DOCUMENTATION.md     # REST API reference
β   βββ DEPLOYMENT_GUIDE.md      # Deployment guide
β   βββ SERVER_QUICKSTART.md     # Server quick start
β   βββ DATABASE_SERVER_SUMMARY.md # Server implementation
β   βββ SUMMARY.md               # Project summary
β   βββ ROADMAP.md               # Development roadmap
βββ MODULAR_ARCHITECTURE.md      # Modular server guide (v0.3.0)
βββ CMakeLists.txt               # Build configuration
βββ README.md
(Coming soon - License information)
Built for makers, engineers, and organizations who need precise inventory control.