Skip to content

A simple client and server implementation of a chess for 2-4 players

License

Notifications You must be signed in to change notification settings

schiller-sql/chess4player

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

chess4player

An open source multiplayer chess game
for up to 4 players on windows, macOS and GNU/linux


Written in the frontend with Flutter for desktop using bloc as the state managment,
as well go in the backend using gorilla for websocket connections


Setup

Flutter client

Install flutter for your respective operating system and configure/install necessary components as per the flutter website, which are necessary for the development of desktop apps.

Make sure flutter is in your PATH.

Navigate to client/flutter and run flutter pub get.

In the client/flutter directory create a new textfile .env. This must contain the default URI/URL the client will connect to in the format:

URI='[URI]'

[URI] should be replaced by the websocket URL/URI of the chess4player server, for example:

URI='ws:://localhost:8080'

Server

Install go and have it added to your path.

Navigate to the server directory and run go mod download.

Running

Flutter client

In the client/flutter directory run flutter run -d [device] where [device] is substituted by either windows, macos, or linux, depending on your platform.

Go server

In the server directory run PORT=[port] go run main.go, where [port] is substituted by the port you want to run the server on, for example 8080.

Running/compiling for production

Flutter client

In the client/flutter directory run flutter build [device] --release where [device] is substituted by either windows, macos, or linux, depending on your platform.

macOS

The resulting chess44.app can be found in client/flutter/build/macos/Build/Products/Release.

windows

Using inno setup to execute client/flutter/installers/default_windows_installation.iss for an installer, which is found in client/flutter/installers/chess44.exe.

Server

In the server directory run go build main.go.

Now execute the resulting executable, with the PORT environment variable, for example (for macos/linux):

PORT=8080 ./main