A powerful supply chain simulation tool with a modern web interface, combining Qt backend services with a Next.js frontend for comprehensive supply chain analysis and visualization.
Configure your simulation with an intuitive interface. Set inventory policies, demand distributions, and key parameters like lead time, starting inventory, and simulation duration.
Track key metrics through interactive plots. Monitor inventory levels, demand patterns, procurement decisions, and lost sales in real-time. The combined view provides a comprehensive overview of your supply chain's performance.
Get detailed performance metrics including service level, average inventory, total lost sales, and order analysis. Mathematical formulas provide transparency into calculations.
- Backend Setup
# Build the Qt backend
mkdir build && cd build
cmake ..
make -j$(nproc)
# Run the backend server
./ChainSimQServe --server --log_level 2
- Frontend Setup
# Navigate to frontend directory
cd chainsim-ui
# Install dependencies
npm install
# Start development server
npm run dev
- Access the Application
- Frontend: http://localhost:3000
- Backend API: http://localhost:47761
# Build the container
docker build -t chainsim .
# Run locally
docker run -p 3000:3000 -p 47761:47761 chainsim
# Deploy to Google Cloud Run
gcloud run deploy chainsim \
--image gcr.io/[PROJECT_ID]/chainsim \
--platform managed \
--allow-unauthenticated \
--port 3000
- Qt 6.8.0 HTTP server
- RESTful API endpoints
- High-performance simulation engine
- Real-time data processing
- Next.js 14 with TypeScript
- Material-UI components
- Real-time data visualization
- Responsive design
- Simulation duration
- Lead time configuration
- Inventory management
- Lot size optimization
- Stochastic/Deterministic modes
- Fixed (Constant)
- Normal
- Gamma
- Poisson
- Uniform
-
ROP (Reorder Point)
- Dynamic reorder triggers
- Safety stock calculation
-
EOQ (Economic Order Quantity)
- Cost optimization
- Order quantity calculation
-
TPOP (Time-Phased Order Point)
- Time-based ordering
- Period optimization
- Inventory levels
- Demand patterns
- Order quantities
- Stockout analysis
- Multi-metric views
- Service level analysis
- Inventory turnover
- Cost analysis
- Order statistics
- Demand patterns
The ROP system triggers an order when inventory position falls below a specified point. It considers lead time demand and safety stock.
Mathematical Model:
ROP = μ_L + zσ_L
where:
μ_L = D × L (Average demand during lead time)
σ_L = σ_d × √L (Standard deviation during lead time)
D = Average daily demand
L = Lead time
z = Safety factor (based on service level)
σ_d = Daily demand standard deviation
Safety Stock Calculation:
Safety Stock = z × σ_L
EOQ balances ordering and holding costs to determine optimal order quantity.
Mathematical Model:
EOQ = √((2DS)/H)
where:
D = Annual demand
S = Fixed ordering cost
H = Annual holding cost per unit
Total Annual Cost:
TC = (D/Q)S + (Q/2)H + CD
where:
Q = Order quantity
C = Unit cost
TPOP uses periodic review with dynamic order quantities based on projected inventory position.
Mathematical Model:
Order Quantity = Max(0, IP_target - IP_current)
where:
IP_target = μ_L+R + z × σ_L+R
IP_current = OH + OO - BO
R = Review period
OH = On-hand inventory
OO = On-order quantity
BO = Backorders
Used for stable demand patterns with symmetric variation.
f(x) = (1/(σ√(2π))) × e^(-(x-μ)²/(2σ²))
where:
μ = Mean demand
σ = Standard deviation
Properties:
- Symmetric around mean
- 68-95-99.7 rule applies
- Range: (-∞, +∞)
Suitable for right-skewed demand patterns and lead times.
f(x) = (x^(k-1) × e^(-x/θ))/(θ^k × Γ(k))
where:
k = Shape parameter
θ = Scale parameter
Γ = Gamma function
Properties:
- Always positive
- Right-skewed
- Range: [0, +∞)
Models discrete events in fixed time intervals.
P(X = k) = (λ^k × e^(-λ))/k!
where:
λ = Average rate of events
k = Number of events
Properties:
- Discrete distribution
- Mean equals variance
- Range: {0, 1, 2, ...}
Used for demand with equal probability within bounds.
f(x) = 1/(b-a) for a ≤ x ≤ b
where:
a = Lower bound
b = Upper bound
Properties:
- Constant probability density
- Range: [a, b]
The simulator uses the Mersenne Twister algorithm for high-quality random number generation:
std::mt19937 generator(seed);
- Normal Distribution:
std::normal_distribution<double>(mean, stddev)
- Gamma Distribution:
std::gamma_distribution<double>(shape, scale)
- Poisson Distribution:
std::poisson_distribution<double>(lambda)
- Uniform Distribution:
std::uniform_real_distribution<double>(min, max)
Service Level = (Total Demand - Lost Sales)/Total Demand × 100%
Turnover Ratio = Annual Sales/Average Inventory
Average Inventory = Σ(Daily Inventory)/Number of Days
Total Cost = Ordering Costs + Holding Costs + Stockout Costs
where:
Ordering Costs = Number of Orders × Cost per Order
Holding Costs = Average Inventory × Holding Cost Rate
Stockout Costs = Lost Sales × Stockout Cost per Unit
- Qt 6.8.0
- C++17
- CMake build system
- Qt HTTP Server
- WebSocket support
- Next.js 14
- TypeScript
- Material-UI v5
- Recharts
- Framer Motion
- Docker containerization
- Google Cloud Run
- GitHub Actions CI/CD
- Multi-stage builds
- Docker 20.10+
- Node.js 18+
- Qt 6.8.0
- CMake 3.16+
- Python 3.10+
CORS_DOMAIN=your-domain.com
API_URL=http://localhost:47761
ALLOWED_ORIGINS=http://localhost:3000,http://localhost:47761
# Server options
--server # Run in server mode
--log_level 2 # Detailed logging
--port 47761 # Custom port
// next.config.js options
{
output: 'standalone',
async rewrites() {
return [
{
source: '/api/:path*',
destination: '${process.env.NEXT_PUBLIC_API_URL}/:path*'
}
]
}
}
- Fork the repository
- Create a feature branch
- Implement changes
- Add tests
- Submit pull request
- GitHub Issues: Report a bug
- Community: Discussions
- Qt Framework team
- Next.js community
- Material-UI contributors
- All open-source contributors