...loading
salim.codes...loading
salim.codesA multiplayer Tic-Tac-Toe server built with Express.js, featuring server-side validation, session management with cookies, and dynamic HTML rendering using a virtual DOM.
Demo
Screenshots
Features
Server-Side Input Validation
Validates player nicknames and color selections on the server, preventing duplicate users, invalid values, and malformed requests.
Session Management
Uses secure HTTP-only cookies to persist player identity between requests without exposing session data to client-side JavaScript.
Dynamic HTML Rendering
Manipulates HTML documents on the server using a virtual DOM to display validation errors and preserve submitted form values.
Game Initialization
Prepares player registration, manages game state, and handles login, logout, and reset operations before gameplay begins.
Why it was built
This project is the first iteration of a network-based Tic-Tac-Toe application focused on building a robust backend with Express.js. The application emphasizes secure request handling, server-side validation, session management, and dynamic HTML generation without relying on client-side frameworks. It establishes the foundation for the real-time multiplayer functionality introduced in the second version.
Tech stack
Node.js
Runtime environment powering the backend server.
Express.js
Handles routing, middleware, and HTTP request processing.
JSDOM
Provides a virtual DOM for modifying HTML documents before sending them to clients.
cookie-parser
Parses and manages HTTP cookies for player sessions.