Thanks to visit codestin.com
Credit goes to github.com

Skip to content
/ Repo-Init Public template

⚡ Modern C++ Application Template with Enterprise-Grade Features ⚡

License

egecetin/Repo-Init

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Repo-Init

Repo-Init Logo

Modern C++ Application Template with Enterprise-Grade Features

Top Language License

Build Status Coverage Quality Gate OpenSSF Score


What is Repo-Init?

Repo-Init is a powerful, production-ready CMake template designed to kickstart your C++ applications with enterprise-grade features built-in. Say goodbye to boilerplate code and hello to modern, robust software development!

🔧 Requires: C++17 supported compiler

💡 Perfect for: Microservices, CLI tools, system applications, and performance-critical software

Key Features at a Glance

🛡️ Crash Protection

Automatic minidump generation with Crashpad

Never lose critical debugging information

📊 Advanced Logging

Multi-output logging with Spdlog

File rotation • Syslog • Colorized console

🔗 Service Integration

SentryGrafana LokiPrometheus

Real-time monitoring & alerting

Performance Metrics

  • Success/failure counters
  • Min/max timing analysis
  • Quantile-based bottleneck detection

🌐 Network Ready

  • Built-in Telnet server
  • ZeroMQ messaging
  • HTTP connectivity

🚀 Developer Experience

  • One-command setup
  • Comprehensive testing
  • Auto-generated docs

💬 Questions? Issues? Contributions? Feel free to ask, use, and report any bugs you encounter! We ❤️ community feedback.

SonarCloud


Table of Contents

CMake Modules

Our carefully crafted CMake modules provide powerful build automation:

Module 🎯 Purpose ✨ Benefits
CodeCoverage Detects and enables gcovr 📊 Automatic test coverage reports
CompilerSecurityOptions Enables/Disables secure compiler flags 🛡️ Hardened binary security
Doxy Finds Doxygen package and prepares docs 📖 Auto-generated documentation
GenerateSymbols Adds target for symbol file generation 🔍 Enhanced debugging with minidumps
GitVersion Gets SHA1 hash of current commit 🏷️ Version tracking and build reproducibility
GraphViz Finds GraphViz and dot executable 🎨 Visual dependency graphs

Utility Scripts

💡 Tip: All scripts should be executed from the top-level directory

Script 🚀 Function 📝 Description
firstName.sh Name Changer Replaces placeholder names throughout the project
crashpad_manual_upload.py Manual Minidump Uploader Uploads bulk of minidump files in given directory
dump_syms.py Symbol Dumper Generates symbol files for crash analysis

Dependencies

Core Runtime Libraries

🔥 Integrated Dependencies

Built and bundled automatically

🛠️ Development Dependencies

For building and testing only

  • 🔧 Breakpad - Symbol dumping
  • GoogleTest - Unit testing framework
  • 🔍 MemPlumber - Memory leak detection
  • 📦 ZLIB - Compression (required by Breakpad)

🌐 System Dependencies

Install via package manager (apt/dnf/brew)

  • 🌍 cURL - HTTP client library
  • 📝 Spdlog - Fast logging library
  • ZeroMQ - High-performance messaging

📊 Want to see the full picture? Check out our complete dependency graph!


Testing Setup

Python Test Dependencies

Our test suite requires some Python dependencies for comprehensive testing. Here's how to set them up:

🚀 Quick Setup


    # Create virtual environment
    python3 -m venv .venv
    
# Activate virtual environment source .venv/bin/activate # Linux/macOS # OR .venv\Scripts\activate # Windows
# Install test dependencies pip install -r tests/data/requirements.txt

📋 Required Dependencies

  • pyzmq - Python ZeroMQ bindings for testing messaging functionality

⚠️ Important Notes

  • Virtual environment must be activated before running tests
  • Dependencies are automatically detected by the test suite
  • Deactivate with deactivate when done

Build Targets

One Command, Multiple Possibilities

Target 🚀 Command 📋 Description
all cmake --build . Builds the complete project with all components
coverage cmake --build . --target coverage Generates comprehensive test coverage reports
docs cmake --build . --target docs Creates beautiful documentation with Doxygen
dependency-graph cmake --build . --target dependency-graph Visualizes project dependencies with GraphViz
package cmake --build . --target package Creates distribution packages (DEB/RPM + systemd service)
test ctest . --parallel Runs the complete test suite with GoogleTest

💡 Pro Tips:

  • For packages, specify your preferred format with -DCPACK_GENERATOR="DEB" or "RPM"
  • Ensure Python virtual environment is activated before running tests!

Build Options

Customize your build with powerful CMake configuration options

💡 Important: Re-run CMake configuration (cmake -B build) after changing any options

🧪 Testing & Quality Assurance

Option Description Default 🎯 Use Case
XXX_BUILD_TESTS 🔧 Build all test suites ON Complete testing pipeline
XXX_BUILD_UNITTESTS ✅ Build unit tests only ON Fast development feedback
XXX_BUILD_FUZZTESTS 🎲 Build fuzz testing suite OFF Security & robustness testing
XXX_ENABLE_COVERAGE 📊 Generate test coverage reports OFF Code quality metrics
XXX_ENABLE_MEMLEAK_CHECK 🔍 Memory leak detection with MemPlumber OFF Debug memory issues

🚀 Release & Distribution

Option Description Default 🎯 Use Case
XXX_ENABLE_SYMBOL_GENERATION 🔧 Generate debug symbols for crash dumps OFF Production debugging
XXX_ENABLE_PACKAGING 📦 Enable DEB/RPM packaging with systemd OFF Distribution & deployment

💡 Quick Examples

# Development build with all tests
cmake -B build -DXXX_BUILD_TESTS=ON \
                -DXXX_ENABLE_COVERAGE=ON

# Production build with packaging cmake -B build -DXXX_BUILD_TESTS=OFF \ -DXXX_ENABLE_PACKAGING=ON \ -DXXX_ENABLE_SYMBOL_GENERATION=ON
# Security testing build cmake -B build -DXXX_BUILD_FUZZTESTS=ON \ -DXXX_ENABLE_MEMLEAK_CHECK=ON
# Minimal build (fastest) cmake -B build -DXXX_BUILD_TESTS=OFF

Pro Tips

  • 🏃 Fast Iteration: Disable tests for quick builds during development
  • 🔒 Security Focus: Enable fuzz tests and memory checks for critical code
  • 📈 CI/CD: Use coverage reports in your automated pipelines
  • 🚀 Production: Always enable symbol generation for crash analysis

Grafana Integration

Real-Time Monitoring Made Beautiful

Thanks to our integrated Prometheus server, monitoring your application has never been easier! Get instant insights into your application's performance, health, and behavior.

🚀 Quick Setup

  1. Import Dashboard: Use our pre-built Grafana template
  2. Connect Prometheus: Point to your app's metrics endpoint
  3. Monitor: Watch real-time metrics flow in!

What You Get

  • Performance Metrics: Response times, throughput, resource usage
  • Error Tracking: Real-time error rates and alerting
  • Resource Monitoring: CPU, memory, and system metrics
  • Custom Metrics: Track your application-specific KPIs

📸 Live Dashboard Preview

Grafana Dashboard

Beautiful, responsive, and information-rich monitoring


Contributing & Support

🐛 Report Issues💬 Discussions🔧 Pull Requests

Made with ❤️ for the C++ community

Star ⭐ this repo if you find it useful!


About

⚡ Modern C++ Application Template with Enterprise-Grade Features ⚡

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Sponsor this project

 

Contributors 6