A server-authoritative, high-fidelity online casino web application featuring slot machines and arcade games, custom Metamask/PIX payment gateways, and automated Android TWA builds.
Why this system had to exist
I refactored the Playpal77 casino suite to transition it from a fragile, client-calculated setup to a fully server-authoritative, high-performance web platform. The business required an engaging, light-themed casino lobby that looked like playpal77.ph, backed by real-time games (Scatter Slots, Dice, Crash, Plinko) and robust, frictionless blockchain and fiat payment integrations.
Designed and engineered the authoritative game server, fixed critical payment database write omissions, and wrote automated APK patch tooling.
Refactored client-calculated game loops into a 100% server-authoritative engine, securing wallet transactions and automating compilation pipelines.
What was breaking down
The legacy system suffered from severe security and performance issues. Spins were calculated client-side, making them vulnerable to tampering. Additionally, the Metamask payment callbacks failed to commit to the database due to a missing execution step in the PHP API, and the .htaccess configuration caused 404 errors on routing calls. The Android TWA app was also outdated and required manual compilation and signature fixes to compile under Android 15.
Game Calculation
Client-calculated (insecure)
Metamask Payments
Silent DB failures & 404 routing errors
APK Compilation
Manual breakdown under Android 15 SDK
The breakthrough and implementation path
I implemented a Node.js game server using Socket.io and SSE for realtime updates, wired it to the React/Vite front-end, fixed the PHP transaction bug in api.php, updated .htaccess, and built a script to automate apktool decompilation and rebuilding of Playpal77.apk. I also added a fully interactive simulator for the slots game.
By moving the RNG authority completely to a Node.js/Express server using secure random matrix generation and connecting the database to a persistent local MariaDB engine, we restored complete trust in game fairness. On the payment side, wrapping transaction operations in atomic database commits and routing callbacks through a unified reverse proxy resolved the 404 errors and transaction losses.
React/Vite Casino Frontend
Node.js Authoritative Game Server
Before vs after, without the clutter
Outcome metrics stay visible while comparison details are compressed into large readable cards instead of long stacked panels.
Game Calculation
Client-calculated (insecure)
Optimized resolution
100% Server-authoritative RNG
Layered architecture with one consistent layout
Explore the operating layers and the shipped feature set in the same wider content frame used across the full case study.
React/Vite Casino Frontend
Authoritative 5x3 slot engine and Plinko, Crash, Dice arcade games running on Node.js server
Real-time event broadcasting and persistent wallet state synchronization using Socket.io and SSE
Secure payment processing gateway for Metamask blockchain and PIX transactions in PHP API
Automated Android TWA decompilation, drawable hot-fixing, and aapt2 compiler build script
