Hello everyone,
What if a simple social network felt more like a game? What if user achievements weren't just static icons but interactive 3D objects you could actually play with?
I had this idea while working on my latest project GOAT, an open-source social debate platform. I wanted to reward users in a way that felt real and engaging, not another boring badge.
So I decided to integrate a real-time 3D rendering engine inside my Laravel application.
Live demo: https://goat.uz/@goat GitHub Repo: https://github.com/umaarov/goat-dev
At first glance, it sounds a bit crazy. Here I explain how I achieved it without turning the user's browser into a hot plate.
The stack for an ambitious idea
The core of the app is classic: a backend with Laravel 12 serving a frontend powered by Vite. The magic appears with some additional ingredients: Three.js WebGL and GLSL for everything 3D in the browser, Web Workers to avoid blocking the interface, and C++ compiled to WebAssembly for calculations that require maximum speed.
How to bring 3D to a PHP world
The main challenge wasn't just displaying a 3D model, but doing it without degrading the application's performance.
1. The performance problem
My first attempt was simple: load a model with Three.js on the profile page. It worked, but it was clunky. Complex models with lighting and effects caused lag on the main thread and the overall experience became slow. That wasn't acceptable.
2. Solution: offload everything to a Web Worker
The solution was to move all the 3D rendering logic to a Web Worker. This way, the heavy calculations, scene setup, lighting, and render loop run on a separate CPU thread. The main page only creates the worker and provides it with a canvas to draw on. The worker does the heavy lifting and returns the rendered result. The main UI remains smooth no matter how complex the 3D scene is.
3. Extra power: C++ and WebAssembly
For intense geometric calculations like custom modifiers or physics simulations, even JavaScript inside the worker fell short. I identified the most critical functions and rewrote them in C++. Then I used the Emscripten toolchain to compile the code to highly optimized WebAssembly, gaining near-native speeds within the browser.
It's not just 3D
In addition to the rendering engine, I integrated Google's Gemini Pro API for content moderation and used Stable Diffusion through Cloudflare to allow users to generate unique profile images from text. The result is an interactive and moderated experience that combines real-time graphics with artificial intelligence capabilities.
The result
After several months of work, the project is in production and is open source. It demonstrates that you can create rich, interactive experiences starting from a traditional backend like Laravel if you adopt creative frontend solutions.
At Q2BSTUDIO, as a custom software and application development company, we offer expertise to bring similar ideas to production. We are specialists in custom software, artificial intelligence, cybersecurity, and cloud services on AWS and Azure. We also provide business intelligence services, Power BI implementations, AI agent development, and AI integrations for companies to drive decision-making and automation.
If you're interested in replicating a real-time 3D solution in your custom applications or need consulting in custom software, artificial intelligence, cybersecurity, AWS and Azure cloud services, business intelligence services, AI agents, or Power BI, contact Q2BSTUDIO and let's talk about how to transform your product.
This project is open source, so I appreciate any feedback, and if you like the repository, a star on GitHub would make the team's day. Thanks for reading.




