Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

This is a small Pong game based on JavaScript (server-side and client-side) with WebSockets. I created it quite some time ago to get in touch with docker and try out the websocket technology. It is possible to play this game against AI or against an opponent via network. This game also has a lobby where players can find and challenge each other.

Notifications You must be signed in to change notification settings

EllisTheEllice/websocket-pong

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

websocket-pong

This is a small Pong game based on JavaScript (server-side and client-side) with WebSockets. I created it quite some time ago to get in touch with docker and try out the websocket technology. It is possible to play this game against AI or against an opponent via network. This game also has a lobby where players can find and challenge each other.

Version

0.0.1

alt text

Table of contents

  1. Used Tech
  2. Installation using vanilla docker
  3. Installation using Docker compose
  4. Installation on Kubernetes
  5. Installation on Kubernetes using helm
  6. Building images locally
  7. Backing up your highscore
  8. Customizing application behavior

Used Tech

websocket-pong uses a number of open source projects to work properly:

  • jQuery - The most popular JavaScript library!
  • WebSockets - awesome technology to allow real-time communication between server and client
  • NodeJS - the lightning-fast server-side JavaScript framework
  • express - A framework based on NodeJS which adds numerous features
  • bootstrap - A HTML/CSS framework to support responsive web applications
  • Docker - Cool container stuff

Installation

Installation using vanilla docker

  1. Install docker
  1. Run the application
    $ docker run -it -p 80:8081 -e PORT=8081 -d --name pong-web ellistheellice/websocket-pong
  2. Verify the installation
    $ docker ps
    $ curl http://localhost

Installation using docker-compose

  1. Install docker-compose
  2. Start
    $ cd deployment/docker-compose
    $ docker compose up -d
  3. Verify the installation
    $ docker ps
    $ curl http://localhost

Building the images locally

$ git clone https://github.com/EllisTheEllice/websocket-pong
$ cd websocket-pong/source
$ docker build -t pong-web .
$ docker run -p 80:8081 -d --name pong-web --network pongnet pong-web

Customize the application

Customize the applications port

In source/web/source folder you can find a config.json file. This file is used to set the port the NodeJS webserver listens to.

About

This is a small Pong game based on JavaScript (server-side and client-side) with WebSockets. I created it quite some time ago to get in touch with docker and try out the websocket technology. It is possible to play this game against AI or against an opponent via network. This game also has a lobby where players can find and challenge each other.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published