JaniM / variant-go-server

The virtual home of go variants.

Home Page:http://go.kahv.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Variant Go Server

A highly unfinished server for Go variants implemented in full-stack Rust.

Development

Database

The server needs a postgres database to store user info & games in. I recommend running a simple instance with docker:

docker run --name go-postgres -e POSTGRES_PASSWORD=localpw -p 127.0.0.1:5432:5432 -d postgres

You can then either add the following in your environment variables (adjusting for your own names), or add a .env file to the project root.

DATABASE_URL=postgres://postgres:localpw@localhost/postgres

To create the necessary tables run:

cargo install diesel_cli --no-default-features --features postgres
cd server/
diesel migration run

Server

Execute the server with

cargo run -p server

Client

The client uses wasm-pack, see installation instructions at https://rustwasm.github.io/wasm-pack/installer/.

Build & run the client with

cd client
wasm-pack build --dev -- --features local
cd www
npm i
npm run start

Testing

Game rules use snapshot tests powered by insta.

Licensing

The main project is dual licensed under MIT and Apache 2.0 licenses - the user is free to pick either one. Sounds are borrowed from Katrain and fall under the MIT license.

About

The virtual home of go variants.

http://go.kahv.io

License:Apache License 2.0


Languages

Language:Rust 99.0%Language:PLpgSQL 0.5%Language:Python 0.3%Language:Dockerfile 0.2%Language:Shell 0.1%