Giter VIP home page Giter VIP logo

ellistheellice / websocket-pong Goto Github PK

View Code? Open in Web Editor NEW
3.0 0.0 1.0 5.25 MB

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.

JavaScript 88.59% Dockerfile 0.06% CSS 5.31% HTML 6.02% Shell 0.02%
pong websockets game nodejs javascript jquery twitter-bootstrap openshift docker docker-compose aws-eks

websocket-pong's Introduction

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.

websocket-pong's People

Contributors

ellistheellice avatar

Stargazers

 avatar  avatar  avatar

Forkers

unusualsoul

websocket-pong's Issues

Add sound

A game without sounds is boring: We should add sounds to the game to make it more interesting.

Add deployment option: AWS EKS

It would be nice to enable the possibility to run this on AWS EKS. Therefore, we may need some scripts and we need to adapt the documentation

Add deployment option: Docker-compose

It would be nice to enable the possibility to run this with Docker-compose. Therefore, we may need some scripts and we need to adapt the documentation

Add deployment option: OpenShift

It would be nice to enable the possibility to run this on OpenShift. Therefore, we may need some scripts and we need to adapt the documentation.

Create docker container

It should be possible to use this project as a docker container. Therefore, a dockerfile muste be created and the documentation should be updated.

Add a highscore

What´s a game without a highscore? We need a highscore, preferrably stored in a database.

Re-iterate over documentation

There are some flaws in the docs which we need to get rid of. Furthermore, the documentation is not very user-friendly- This needs to be fixed

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.