Skip to content

Gachon university networking class term project.

Notifications You must be signed in to change notification settings

chromato99/RPS-web

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RPS-web

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

Description

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

Project Structure

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.

Run on localhost

  1. Set MySQL server and table structure as below. (If you want to use different table structure, you need to edit source code)

  1. 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'
});
  1. (Optinal) Issuing ssl certificate for https (recommended to use Let's encrypt)
    Install nginx and configure ssl.

  2. Run Server with Node.js

cd <project directory>
npm install
node server.js

Tech Stack

[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/

About

Gachon university networking class term project.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •