Giter VIP home page Giter VIP logo

fairyground's Introduction

fairyground

This is an attempt to have a simple demo and playground for Fairy-Stockfish in the browser, using its WebAssembly port, its ffish.js library, and the graphical chessgroundx library. It is based on the demo for Fairy-Stockfish WASM and ffish-test.

You can see it deployed at: https://fairyground.vercel.app/

Usage

◎ Installation

⊙ Prerequisites

Install Node.js first.

⊙ Setup

  1. Open your console and switch the working directory to this directory (the directory that contains this README). All of the following commands should be executed in this console.

  2. Install dependencies

npm install
  1. Bundle JavaScript
-- Linux/macOS
# Build once (for end users)
npm run build

# or, continuously run in background and watch for changes (for developers)
npm run watch-build
-- Windows
::Build once (for end users)
npm run buildwithcmd

:: or, continuously run in background and watch for changes (for developers)
npm run watch-build

◎ Run Application

  1. Open your console and switch the working directory to this directory (the directory that contains this README). All of the following commands should be executed in this console.

  2. Start server (Choose one of the following commands)

#Static website, no back end required. This can be accessed remotely.
npm run serve

#Enable binary engine loading feature. Can be only accessed on local host.
node server.js
  1. Then, browse to http://localhost:5000 (Static website) or http://localhost:5015 (Enable binary engine loading feature)

Enjoy!

Supported Browsers

Most modern browsers should work, such as Google Chrome, Mozilla FireFox, Microsoft Edge, Apple Safari. Older browsers like Internet Explorer of any version are not supported.

Run Engines Remotely

The definition of the terms used in this section:

Server: The computer that runs the fairyground server (a console application) and the binary engines.

Client: The computer that runs the browser and the UI (a graphical user interface, GUI).

You will need to use port forwarding (local forwarding) to forward one of the open port on the client to the port that the server listens. Any software that provides port forwarding is OK. In this guide we use SSH as the tool for instance.

This requires the server to install a SSH server and allows port forwarding. If the server runs Windows, You can install OpenSSH For Windows.

For example, the server is running at http://192.168.1.10:5015 (which means IP: 192.168.1.10, Port: 5015), and then the WebSocket Server will be launched at ws://192.168.1.10:5016 (which means IP: 192.168.1.10, Port: 5016, the port of WebSocket server will be port of HTTP +1), while 2 of the open ports on the client are 9999 and 10000, then the command would be:

ssh -g -f -N -L 9999:192.168.1.10:5015 192.168.1.10
ssh -g -f -N -L 10000:192.168.1.10:5016 192.168.1.10

You need to build two connections, 9999 for HTTP and 9999 + 1 = 10000 for WebSocket in order to make it work.

Then browse to http://localhost:9999 on the client and if you see <Engine Management> button it works. Note that all the paths are paths on the server, NOT the path on the client. The binary executables of the engines need to be placed at respective paths on the server.

Make A Release

See README.md

Attribution

See COPYING.md

fairyground's People

Contributors

ianfab avatar yjf2002ghty avatar thearst3rd avatar dpldgr avatar gbtami avatar rainrat avatar

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.