rockwood Posted March 10 Posted March 10 Hello everyone! I wanted to share a project I've been working on recently. Like many people here, I grew up playing classic browser mafia games and always loved the core gameplay loops (Crimes, Casino, PvP, etc). Instead of using the traditional MCCodes architecture, I decided to build the project with a modern full-stack setup while keeping the classic gameplay feeling. So far the project is built with the following stack: • Node.js • Prisma ORM • Express.js • PostgreSQL • React (Fetch API) • Tailwind CSS The goal is to create a modern browser-based mafia game with smoother UI interactions and a more scalable backend. Some of the things I’m focusing on: Modern backend architecture using Node.js + Prisma Clean API structure with Express React-based frontend for dynamic UI Tailwind CSS for a responsive modern interface PostgreSQL database for reliability and scalability I'm still actively working on new features and improving the overall gameplay experience. Below is a preview of the current example profile UI. Would love to hear feedback from other developers here! 1 Quote
João Morais Posted November 11 Posted November 11 Howdy @rockwood, the design has come a long way :exciting: - very nice work! Can you share the URL for the game? I'd like to give it a try. Quote
David Williams Posted November 18 Posted November 18 Nice progress. One thing I'd be curious about with this stack: how are you handling concurrency on PvP actions, e.g. two players hitting each other at the same time? With Prisma on Postgres, are you leaning on interactive transactions with row locks, or an optimistic version column? Classic mafia games tend to pick up stat duplication bugs from race conditions, so I'd be interested whether that's something you're designing for before adding more features. Quote
rockwood Posted November 18 Author Posted November 18 2 hours ago, David Williams said: Nice progress. One thing I'd be curious about with this stack: how are you handling concurrency on PvP actions, e.g. two players hitting each other at the same time? With Prisma on Postgres, are you leaning on interactive transactions with row locks, or an optimistic version column? Classic mafia games tend to pick up stat duplication bugs from race conditions, so I'd be interested whether that's something you're designing for before adding more features. That's a really good point, and concurrency is definitely something worth designing for early, especially in a PvP-based mafia game. I've structured the combat system around dedicated CombatSession and CombatAction models, with individual action records tracking damage, health after each action, turn numbers, and other combat details. I'm also using database-level unique constraints to prevent duplicate post-fight actions and reward records for the same combat session. The schema is designed with auditability and data integrity in mind. That said, I'm also looking carefully at race conditions when multiple actions target the same character. I agree that relying only on application-level checks isn't sufficient. The next important layer is ensuring atomic combat updates through PostgreSQL transactions, with appropriate row-level locking or optimistic concurrency control where needed, so simultaneous attacks, stat updates, and reward distribution cannot produce inconsistent results. I'd rather get the integrity of the combat and economy systems right before scaling up with more features. On 11/11/2026 at 8:06 PM, João Morais said: Howdy @rockwood, the design has come a long way :exciting: - very nice work! Can you share the URL for the game? I'd like to give it a try. The game is currently in the testing phase. Once testing is complete, it will be officially released. Stay tuned—it’s coming soon! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.