A modern casino slot game platform built with TypeScript/Bun.sh server and PHP calculators for mathematical precision.
netgame/
├── src/ # TypeScript source code
│ ├── server/ # Main HTTP/WebSocket server
│ ├── game-session/ # Game session management
│ ├── games/ # Game implementations
│ │ ├── netgame/ # NetGame slot games
│ │ └── netent/ # NetEnt slot games
│ └── database/ # Database layer
├── new/ # PHP calculators (active)
├── public/ # Static web assets
├── archive/ # Archived legacy code
│ ├── old/ # Original PHP implementations
│ ├── src-old/ # Old TypeScript structure
│ ├── scripts/ # Conversion utilities
│ └── test-files/ # Test artifacts
├── package.json # Node.js dependencies
└── README.md # This file
TypeScript Client → TypeScript Server → Direct PHP Execution → TypeScript Server
↓ ↓ ↓
Business Logic Spin Math Only Data Persistence
User Management RTP Engine Statistics
Database Operations Reel Generation Balance Updates
-
TypeScript Server (Bun.sh)
- HTTP API endpoints
- WebSocket support
- Session management
- Database operations
-
PHP Calculators
- Pure mathematical calculations
- RTP enforcement
- Reel generation algorithms
- No Laravel dependencies
-
Game Organization
src/games/netgame/- NetGame branded slotssrc/games/netent/- NetEnt branded slotsnew/- Active PHP calculators
- Bun.sh runtime
- PHP 7.4+
- MySQL/PostgreSQL database
# Install dependencies
bun install
# Start development server
bun run dev
# Build for production
bun run buildGET /health- Health checkPOST /game/:gameName/spin- Execute game spinGET /game/:gameName/session- Get session infoPOST /game/:gameName/session- Create sessionGET /game/:gameName/balance- Get balance
- Create PHP calculator in
new/{GameName}/ - Implement
GameCalculator.phpandDirectPHPHandler.php - Add TypeScript integration in
src/games/ - Test mathematical accuracy
- Run linter:
bun run lint - Type checking:
bun run type-check - Tests:
bun run test
This project has been cleaned up from a PHP/Laravel monolith to a TypeScript/PHP hybrid architecture:
- Removed: Extensive commented code, duplicate directories, unused scripts
- Archived: Legacy code preserved in
archive/directory - Consolidated: Game files organized by provider (netgame/netent)
- Maintained: Mathematical precision and RTP calculations
- Mathematical Accuracy: PHP calculators must produce identical results to original implementations
- No Laravel Dependencies: PHP code must be pure calculation engines
- Direct Execution: Uses Bun.sh spawn() for PHP process execution
- TypeScript Strong Typing: Full type safety throughout the application
- Direct PHP execution eliminates HTTP overhead
- TypeScript handles business logic and persistence
- PHP processes are spawned on-demand for calculations
- WebSocket support for real-time updates
UNLICENSED - Internal Game Platform Use Only