Rock Paper Scissor online web game.
Gachon university networking term project.
Page for testing : https://rps.chromato99.com
Introduction Presentation : https://docs.google.com/presentation/d/13WQcaGt_m3o0Vy_2mk-JOX5i9i28YUh_/edit?usp=sharing&ouid=115551594729015574224&rtpof=true&sd=true
This is a service that provides a rock-paper-scissors(RPS) web game.
It was developed with the goal of implementing experimental features for the realization of online web games. The game was implemented simply and focused on features such as account creation, management, game room creation, game invitation, and chatting.
- Main Features
Account management (login, signup, logout, etc.)
Security (Passwords are encrypted with Node.js crypto library)
Making game room (Managements with roomList array)
Show other player's record
Ingame chatting
Error handling ex) player disconnected
Inviting player
- Example Screenshots
server.js : Main execution of this service
/public : A folder for static files, including image files, CSS, etc.
/css : CSS files
/img : Image files
/js : JavaScript files
/src : Source code of RPS-web modules.
db.template.js : Configuration file of DB connection (Should be rename to db-config.js)
gameHandler.js : A collection of functions used for game socket handling.
lobbyHandler.js : A collection of functions used for lobby socket handling.
/views : Frontend ejs template directory.
RPSgame.ejs : Main RPS game playing page.
lobby.ejs : Main lobby page.
login.ejs : Main login page.
newroom.ejs : Page for making new room
signup.ejs : Main signup page.
- Set MySQL server and table structure as below. (If you want to use different table structure, you need to edit source code)
- Rename db-config.template.js to db-config.js and set with your db configuration.
var dbConfig ={
host:'example.com',
user:'example',
password:'password',
database:'RPS'
});
-
(Optinal) Issuing ssl certificate for https (recommended to use Let's encrypt)
Install nginx and configure ssl. -
Run Server with Node.js
cd <project directory>
npm install
node server.js
[FE] HTML / CSS / Javascript
[BE] Node.js, Express, Passport.js, Socket.io, PM2
[Database] MySQL
Icon images from Flaticon and Adobe Stock : https://www.flaticon.com , https://stock.adobe.com/kr/