omphalos / shinkgs

A JavaScript client for the KGS Go Server

Home Page:https://shinkgs.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Shin KGS

An unofficial JavaScript client for KGS Go Server.

Available at https://shinkgs.com/

Screenshot - iOS Safari

Goals

  • First-class web and mobile experience
  • Retain community vibe of KGS
  • Start small, release early
  • Work towards native versions (Electron, React Native, Cordova)
  • Bus factor > 1

Progress

  • Game lists
  • Game spectating and chat
  • Room chat
  • User chat (direct messaging)
  • View and edit user details
  • Submit challenge proposal (no negotiating)
  • Create challenge
  • Negotiate challenge
  • Automatch
  • Basic game playing
  • Full-featured game playing (fine-tuned UI, rengo, simul)
  • Review tools
  • Admin/moderation tools
  • Everything else

Contributing

Contributions welcome. Please check the Project Board and Issues to help coordinate efforts. Feel free to create an issue if there isn't one already for what you have in mind.

There's a difficulty: starter label for issues that are good tasks to cut your teeth on.

Code Overview

This project uses JavaScript, React, and ES6+ with Flow types. VS Code (with eslint and flow extensions added) is a great editor for this setup.

State is managed with a Redux-like pattern: there is a single, primary source of truth for app state, plus a bit of component-local state. Messages describing actions are dispatched, which handlers then process to produce the next app state. Unlike typical Redux, no implicit context is used. Everything is passed down through props.

Development Setup

You'll need Node.js and Yarn.

To install and start a local dev server, run:

yarn
yarn start

Note: the dev server will use HTTPS, which is required to interact with the KGS API.

Requests are proxied to the KGS API by default. To use a custom API endpoint:

REACT_APP_API_URL=https://example.com/api/access yarn start

(Note: if you use a cross-origin endpoint, the app won't work reliably in Safari, even with CORS headers. Safari does not allow cookies from an unvisited third-party domain.)

If you don't have eslint or flow in your editor, you can check for errors with:

yarn lint

Deploying the Web App

The easiest way is to use the ▲now service:

yarn global add now
yarn deploy-now

This builds the app then pushes it out to the cloud with a unique URL.

Running an API Server

This project depends on the new JSON-based KGS API.

The official API is available at https://www.gokgs.com/json/. Obsolete older versions are (at least for now) available for download.

There's a Dockerfile in the kgs-api directory that makes running the older API on your local machine easy. To use it, install Docker, then:

cd kgs-api
docker build -t kgs-api .
docker run -p 8080:8080 kgs-api

This will start a server at http://localhost:8080

To deploy to now.sh using their Dockerfile support:

now kgs-api

References

Similar Projects

About

A JavaScript client for the KGS Go Server

https://shinkgs.com/

License:MIT License


Languages

Language:JavaScript 73.3%Language:CSS 26.1%Language:HTML 0.6%