A high-performance personal scheduling application built with SOLID principles featuring a C++ backend API server and React frontend. Optimized for enterprise-grade performance with comprehensive testing and benchmarking suite.
Production-Ready Performance Metrics:
- API Layer: 13,042 RPS (4,500x improvement from baseline)
- Model Layer: 20,000 events/second (50ms for 1000 events)
- Database: 185,000 inserts/second with SQLite
- Memory Usage: 11-37MB peak (highly efficient)
- Response Caching: Sub-millisecond cache hits
- Thread Pool: Hardware-optimized concurrency
Benchmarked on Apple Silicon with optimized builds
π View Performance Benchmark Results β
This project demonstrates enterprise-grade software design following SOLID principles:
EventService: Pure event operationsEventsHandler: HTTP request handling onlyRouter: Route matching and dispatchPerformanceMonitor: Metrics collection
- Extensible handler system via
IRequestHandler - Plugin-based notification and action system
- Configurable performance monitors
- Interface-based dependency injection
- Polymorphic event types (OneTime/Recurring)
- Substitutable calendar integrations
IEventServicefor clean business logicIPerformanceMonitorfor metricsIRequestHandlerfor HTTP handling
- Constructor injection throughout
- Abstract interfaces over concrete implementations
DependencyContainerfor IoC management
- SOLID-Compliant Architecture with dependency injection
- Ultra-High Performance API (13K+ RPS with optimizations)
- Advanced Caching System with TTL and cache metrics
- Thread Pool Architecture for concurrent processing
- Comprehensive Security (Auth, Rate Limiting, CORS)
- Zero-Copy Optimizations and fast serialization
- Production Monitoring with detailed performance metrics
- Extensive Unit Tests for all SOLID components
- Modern React UI with TypeScript and Tailwind CSS
- Multiple Calendar Views (Day, Week, Month)
- Interactive Event Management with recurring event support
- Real-time Dashboard with today's events and statistics
- 12-hour Time Display with proper formatting
- Responsive Design optimized for desktop and mobile
Comprehensive Test Suite:
- Unit Tests: EventService, Handlers, Router, Security
- Integration Tests: Full API and database testing
- Performance Tests: Benchmarking and load testing
- Security Tests: Auth, Rate Limiting, Input validation
# Run all unit tests
make unit-tests
# Run individual test suites
make event_service_tests # EventService component tests
make handlers_tests # API handlers tests
make router_tests # Router component tests
make security_tests # Auth and RateLimiter tests
# Run performance benchmarks
make benchmark
./benchmark
# Run comprehensive test script
./run_benchmark.sh- C++17 compiler (g++ or clang++)
- Node.js 16+ and npm
- SQLite3 development libraries
- libcurl for HTTP client functionality
-
Clone and setup:
git clone https://github.com/ostepan8/personal-scheduler.git cd personal-scheduler cp .env.example .env -
Build and run server:
make clean && make server ./scheduler_server -
Setup frontend:
cd frontend npm install cp .env.example .env.local PORT=3004 npm start -
Access application:
- Frontend:
http://localhost:3004 - API:
http://localhost:8080
- Frontend:
.env (Backend):
API_KEY=your-secret-api-key
ADMIN_API_KEY=your-admin-key
HOST=127.0.0.1
PORT=8080
CORS_ORIGIN=http://localhost:3004
RATE_LIMIT=100
RATE_WINDOW=60frontend/.env.local:
REACT_APP_API_URL=http://localhost:8080
REACT_APP_API_KEY=your-secret-api-keyβββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β React Frontend ββββββ C++ API Server ββββββ SQLite Database β
β (Port 3004) β β (Port 8080) β β (events.db) β
β β β β β β
β - TypeScript β β SOLID Architectureβ β - WAL Mode β
β - Tailwind CSS β β - Dependency β β - Auto Schema β
β - Calendar Viewsβ β Injection β β - Prepared Stmtsβ
βββββββββββββββββββ β - Thread Pools β βββββββββββββββββββ
β - Response Cache β
β - Security Layer β
ββββββββββββββββββββ
β
ββββββββββββββββββββ
β Optional Services β
β - Google Calendar β
β - Notifications β
β - Custom Actions β
ββββββββββββββββββββ
make help # Show all available targets
make server # Build SOLID-compliant server
make benchmark # Build performance benchmark
make unit-tests # Build and run all unit tests
make clean # Clean build artifacts
make install # Install to /usr/local/bin# Build and run comprehensive benchmarks
make benchmark
./benchmark
# Run specific benchmark categories
./benchmark --model # Model layer performance
./benchmark --api # API performance
./benchmark --full # Full system benchmark
# Use benchmark script for load testing
./run_benchmark.sh
# Results automatically saved to benchmark_results/scheduler/
βββ main.cpp # SOLID-compliant server entry point
βββ Makefile # Build system with test targets
βββ benchmark.cpp # Comprehensive performance testing
βββ run_benchmark.sh # Load testing script
β
βββ api/ # API layer (SOLID-compliant)
β βββ ApiServer.h/cpp # Main HTTP server with DI
β βββ handlers/ # Request handlers (SRP)
β β βββ EventsHandler.* # Event operations handler
β β βββ StatsHandler.* # Statistics handler
β βββ routing/ # Route management (OCP)
β β βββ Router.* # Route matching and dispatch
β βββ interfaces/ # Abstract interfaces (DIP)
β β βββ IEventService.h # Event service interface
β β βββ IRequestHandler.h # Handler interface
β β βββ IPerformanceMonitor.h # Monitoring interface
β βββ performance/ # Performance monitoring
β βββ PerformanceMonitor.* # Metrics collection
β
βββ services/ # Business logic layer
β βββ EventService.* # Event operations (SRP + DIP)
β
βββ model/ # Domain models
β βββ Model.* # Event aggregation
β βββ OneTimeEvent.* # Single events
β βββ RecurringEvent.* # Recurring events
β βββ recurrence/ # Recurrence patterns
β
βββ database/ # Data persistence
β βββ SQLiteScheduleDatabase.* # SQLite implementation
β βββ SettingsStore.* # Configuration storage
β
βββ security/ # Security components
β βββ Auth.* # Authentication
β βββ RateLimiter.* # Rate limiting
β
βββ utils/ # Utilities
β βββ ResponseCache.* # HTTP response caching
β βββ FastSerializer.* # Optimized JSON serialization
β βββ ThreadPool.* # Concurrent processing
β βββ DependencyContainer.* # IoC container
β
βββ tests/ # Comprehensive test suite
β βββ services/ # Service layer tests
β βββ api/ # API layer tests
β βββ security/ # Security tests
β βββ test_utils.h # Test utilities
β
βββ frontend/ # React application
β βββ src/
β β βββ components/ # React components
β β βββ services/ # API client
β β βββ types/ # TypeScript interfaces
β βββ public/ # Static assets
β
βββ benchmark_results/ # Performance test outputs
All requests require the Authorization header:
curl -H 'Authorization: your-api-key' http://localhost:8080/eventsGET /events- List all eventsPOST /events- Create new eventGET /events/next/{count}- Get next N eventsGET /stats- Performance and cache statisticsOPTIONS /*- CORS preflight support
{
"status": "ok",
"data": [...],
"meta": {
"cache_hit": true,
"response_time_ms": 1.2
}
}- Multi-layer Authentication (API keys + Admin keys)
- Configurable Rate Limiting (per-IP protection)
- CORS Security with configurable origins
- Input Sanitization for all user data
- Secure Headers (HTTPS-ready)
- Dependency Injection for secure component isolation
- Production-Safe Logging (no sensitive data)
- Response Cache: TTL-based caching with hit/miss metrics
- Fast JSON: Custom serialization avoiding nlohmann overhead
- Connection Keep-Alive: HTTP connection reuse
- Thread Pool: Hardware-optimized worker threads
- Async Handlers: Non-blocking request processing
- Database Pooling: Connection reuse and optimization
- Zero-Copy Streaming: Direct buffer operations
- Lock-Free Structures: Concurrent data access
- Memory Pools: Pre-allocated object management
Result: 13,042 RPS (4,500x improvement from baseline 2.9 RPS)
- Unit Tests: 100% coverage of SOLID components
- Integration Tests: Full API workflow testing
- Performance Tests: Continuous benchmarking
- Security Tests: Auth, rate limiting, input validation
- Load Tests: High-concurrency validation
- Automated test execution with
make unit-tests - Performance regression detection
- Code quality validation
- Build artifact management
# Backend
make clean && make server
sudo make install # Installs to /usr/local/bin
# Frontend
cd frontend
npm run buildThe SOLID architecture makes containerization straightforward:
- Clean dependency injection
- Environment-based configuration
- Stateless request handling
- Health check endpoints
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature) - Follow SOLID principles in your code
- Add unit tests for new components
- Run test suite (
make unit-tests) - Benchmark performance impact (
make benchmark) - Commit changes (
git commit -m 'Add SOLID feature') - Push to branch (
git push origin feature/amazing-feature) - Open Pull Request
- SOLID Principles: All new code must follow SOLID design
- Unit Tests: New components require comprehensive tests
- Performance: No regressions in benchmark results
- Documentation: Update README for new features
This project is licensed under the MIT License - see the LICENSE file for details.
- httplib for lightweight C++ HTTP server
- nlohmann/json for JSON processing
- SQLite for embedded database excellence
- React ecosystem for modern frontend
- SOLID Principles by Robert C. Martin
- Clean Architecture design patterns
Built with β€οΈ following SOLID principles and modern C++ best practices