Skip to content

venajustin/jsmge

Repository files navigation

JavaScript Multiplayer Game Engine

Project Code: https://github.com/venajustin/jsmge

Project Structure

Components / Top-level directories

Each of the following folders is set up with a Dockerfile that defines the container image that will be built. compose.yaml defines settings so that the docker compose script can be used to build and deploy containers. The server-output image is not included in this script and must be built seperately, using a python script.

  • editor
    • React application using the Vue framework
    • Allows users to create and edit games in an interactive code editor, file management environment with a preview
  • nginx-config
    • nginx routing server for directing requests to docker containers
    • Folder contains nginx configuration file
  • postgres-config
    • PostgreSQL relational database
    • Folder contains configuration and startup sql scripts to populate the database on a new host computer.
  • server-output
    • The engine server backend that hosts user games.
    • This is built as a node container and is instantiated at runtime for each user game.
    • This server acts both as the backend for the development environment, and as a host when playing games.
  • mgmtApi
    • Flask web server that handles requests related to game management.
    • This container has the ability to instantiate containers from the server-output image.

Local Deployment

Prerequisites

Install the following before proceeding

Clone this repo

git clone https://github.com/venajustin/jsmge.git

or, if using ssh auth:

git clone git@github.com:venajustin/jsmge

Setup virtual environment

Windows

  • py -m venv .venv
  • .venv\Scripts\activate <-- Required each time you use a new terminal session

Mac / Linux

  • python3 -m venv .venv
  • source .venv/bin/activate <-- Required each time you use a new terminal session

Install libraries

For running the python api in development, on all platforms, after activating environment:

pip install -r ./requirements.txt

Compilation

Ensure that the docker daemon is running before running the following

Creating server-output docker image

cd mgmtApi
python start_node_img.py

Building Docker images for other server components

docker compose build

Run Server

docker compose up -d

The editor can be accessed from port 80 on the host pc. For example http://localhost/ if you are connecting from a local browser.

Stopping Server

  • Stop all games in user games manager
  • or stop containers manually with docker
  • Run the following to bring down other components
docker compose down

About

multiplayer web game engine

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors