PolyRPG is a real-time multiplayer tactical RPG web app built with Angular, NestJS, TypeScript, Socket.IO, and MongoDB.
Originally developed in a 6-person software engineering project at Polytechnique Montréal, this repository contains the maintained deployment version of the project.
PolyRPG lets players create custom maps, host games, join live lobbies, and play turn-based matches in Classic and Capture the Flag modes. It includes a map editor, real-time lobby synchronization, virtual players, chat, and server-side game logic.
My main contributions focused on real-time systems, backend game logic, and engineering quality.
- Designed and implemented the backend map validation architecture.
- Built server-side validation rules for unique names, required descriptions, terrain coverage, reachable tiles, and spawn placement.
- Used BFS to validate tile accessibility and reject invalid maps before save.
- Implemented real-time avatar locking in the join flow with temporary reservations over Socket.IO rooms.
- Added backend safeguards to prevent duplicate avatar selection, release avatars on disconnect or refresh, and handle name deduplication.
- Built server-side NPC behavior using weighted Dijkstra pathfinding, terrain-aware movement costs, door projections, and cycle detection.
- Implemented all AI profiles, with different behavior in Classic and CTF modes.
- Implemented core CTF interactions including flag pickup, transfer requests, accept or refuse flows, timeout-based refusal, and edge-case handling for flag and player respawn conflicts.
- Added GitLab pipeline build checks so merge requests had to build before merge.
- Improved code quality with stricter ESLint rules and pre-commit checks for large files, case conflicts, and kebab-case filenames.
- Contributed to roughly a third of the automated test suite across backend and frontend layers.
- Custom map editor with terrain and object placement.
- Real-time multiplayer lobbies with live avatar availability.
- Turn-based tactical gameplay with movement, combat, and chat.
- Classic and Capture the Flag game modes.
- Virtual players with server-side AI.
- Backend validation for map integrity and game rules.
- Deployed frontend, backend, and database.
- Frontend: Angular, TypeScript, SCSS
- Backend: NestJS, TypeScript, Socket.IO
- Database: MongoDB Atlas with Mongoose
- Deployment: Cloudflare Pages, AWS EC2
- Testing: Jest, Mocha, Sinon
- Tooling: GitLab CI, ESLint, pre-commit hooks
The frontend handles the UI, player interactions, and some display-oriented logic such as reachable tile previews. The backend owns multiplayer state, validation, AI behavior, and most gameplay rules. Persistent map data is stored in MongoDB, while active game sessions are kept in memory.
REST is used for CRUD operations such as map management. WebSockets handle live multiplayer state, lobby synchronization, and in-game events.
- Node.js (v20+)
- npm
- MongoDB database, local or Atlas
- Copy
.env.EXAMPLEfrom theserverdirectory to.env. - Update
DATABASE_CONNECTION_STRING. - Install dependencies in both projects.
cd server
npm install
cd ../client
npm installRun these in separate terminal windows.
Backend
cd server
npm startFrontend
cd client
npm start# Backend tests
cd server
npm test
# Frontend tests
cd client
npm testThis repository is meant to showcase the deployed portfolio version of PolyRPG. The project was originally built in a team setting, and this version reflects the parts I maintained and the systems I was most involved in.



