This project uses Node.js native addons to run scheduling algorithms in C++ for better performance.
- Node.js (v16 or higher)
- Python 3.10 or higher (required for node-gyp)
- For Windows: Visual Studio Build Tools with C++ support
- For macOS: Xcode Command Line Tools
- For Linux: Build tools (gcc, g++, make)
The C++ addon is built when you run native scripts:
npm run dev:native
npm run build:nativeFor quick development without native compilation:
npm run dev
npm run buildTo manually build the native addon:
npm run build-nativeTo clean build artifacts and rebuild:
npm run clean-native
npm run build-nativeIf you encounter issues on Windows:
-
Install Visual Studio Build Tools:
- Download from: https://visualstudio.microsoft.com/visual-cpp-build-tools/
- Install with "Desktop development with C++" workload
-
Ensure Python 3.10+ is installed and in your PATH
-
Reopen your terminal after installation so toolchain environment changes are picked up.
The project uses both C++ and TypeScript implementations:
- C++ Implementation: Located in
cpp/directory - TypeScript Fallback: In
lib/scheduling-native.ts
If the C++ addon fails to load, the application automatically falls back to the TypeScript implementation, so development is not blocked.
cpp/
├── include/
│ ├── Process.h # Process data structure
│ └── Algorithms.h # Algorithm declarations
├── src/
│ ├── binding.cc # Node.js bindings
│ ├── FirstComeFirstServe.cpp
│ ├── RoundRobin.cpp
│ ├── ShortestJobFirst.cpp
│ └── ShortestRemainingTimeFirst.cpp
binding.gyp # Build configuration file
This is normal during development. The application will use the TypeScript implementation as a fallback.
- Check that Visual Studio Build Tools are installed
- Verify Python is in your PATH
- Try rebuilding:
npm run clean-native && npm run build-native
- Ensure Xcode/gcc is installed
- Try:
xcode-select --install(macOS) - Install build essentials:
sudo apt-get install build-essential(Linux)