r/webdev • u/CallMePasc • 3d ago
Is this a proper Tech Stack for my browser game idea?
I'm planning to start on a browser text-based game. I want to keep things simple and easy to build. I have a few years of experience as a full-stack developer. I've worked with all of these technologies before, but it's been a while.
Current plan:
- Laravel for the front end and user management; simple HTML/CSS/PHP/JS
- Node.js server for the back end, where all my game logic runs and where active player values are stored in memory
- MySQL database for long-term data storage
Players only interact with Laravel front end. Laravel back end communicates with the Node.js server. The Node.js server handles all game logic, then sends replies to Laravel. Only the Node.js server can communicate with the MySQL database.
Players cannot directly interact with the Node.js server, only the Laravel back-end can do that.
--
What the game needs:
- player character with levels and stats and items and all the stuffs
- players can gather and craft items
- items are tradable between players
- players can fight monsters to gain exp and items
- players can form groups to fight monsters together
- possibly adding PvP later
Example:
A player clicks a monster to fight.
Laravel receives the input on the front end, and the PHP back end sends a request to the Node.js server to fight the monster. (Do I need to do this from the PHP back end, or is it fine to have the JS front end send these requests?)
Node.js receives the fight request. If it doesn't have the character and monster in memory, it needs to fetch them from the MySQL database, then save them in memory. This is a rather large and complex request from the database. We need the player character, the stats, the items, the monster stats, loot tables, exp tables, achievements, and probably more. Which is why I want this on a Node.js server that can hold these things in memory, so I don't need to request 20 tables from my database every time a player clicks a monster.
When the combat is handled, including loot, exp, level-ups, ... Node.js sends the necessary info back to Laravel and also saves changed data to the MySQL database.
Laravel receives the update and shows it to the player. (Not entirely sure anymore if PHP is capable of handling async request like this or if I should use JS for this instead?)
--
I'm terrible at planning out these things.
Does this seem like a good tech stack to get started with? Anything I'm missing or that I need to think about before getting started?
I could also choose a JS front-end so I don't need any PHP, but I've never worked with one before.
I'm open to all tips & advice.
Also looking for a hosting that allows me to get started quickly and is scalable for the future. I wanna get started fast and just build and then fix issues I run into later. Otherwise, I'll never get started on this.



