• Stars
    star
    259
  • Rank 154,358 (Top 4 %)
  • Language
    Rust
  • License
    Apache License 2.0
  • Created about 4 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An online board game in Rust and WebAssembly

About

Project homepage

pont is an online game based on Qwirkle (by Mindware Games)

Screenshot

Notably, both the client and server are written in Rust; the only Javascript is a shim to load the WebAssembly module.

Hosting

It's easiest to run the whole application on a single VM, using NGINX to both serve static content and to act as a secure proxy for websocket communication. The latter means we don't need SSL support in the game server itself.

The system looks something like this:

Screenshot

I'm hosting a copy of the game at https://pont.mattkeeter.com, using a $5/month droplet from Digital Ocean and Dreamhost for domain registration.

Initial setup

sudo apt update
sudo apt install build-essentials libssl-dev pkg-config
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh

Installing NGINX and setting up Let's Encrypt

sudo apt install nginx
sudo apt-get install software-properties-common
sudo add-apt-repository universe
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install certbot python3-certbot-nginx

sudo certbot --nginx

(read and follow certbot's instructions)

Turn on a firewall to improve security

sudo ufw allow ssh
sudo ufw allow http
sudo ufw allow https
sudo ufw allow 8081
sudo ufw enable

Building the client WebAssembly file

git clone https://github.com/mkeeter/pont.git
cd pont/pont-client
wasm-pack build --target web

Deploy the nginx config

sudo cp pont.conf /etc/nginx/sites-enabled/pont.conf
sudo rm /etc/nginx/sites-enabled/default
sudo nginx -s reload

This won't work out of the box, because the configuration assumes the url is pont.mattkeeter.com, which won't be true for you; edit it accordingly.

Running the server

cd pont/pont-server
cargo run --release

(leave this in a screen session for easy persistence!)

License

ยฉ 2020 Matthew Keeter

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

More Repositories

1

antimony

CAD from a parallel universe
C++
2,087
star
2

kokopelli

Script-based CAD/CAM in Python (deprecated)
Python
296
star
3

futureproof

A live editor for fragment shaders, powered by Neovim, WebGPU, and Zig!
Zig
206
star
4

mpr

Reference implementation for "Massively Parallel Rendering of Complex Closed-Form Implicit Surfaces" (SIGGRAPH 2020)
C++
179
star
5

rayray

A tiny GPU raytracer, using Zig and WebGPU
Zig
138
star
6

erizo

Fast native STL viewer
C
115
star
7

fidget

blazing fast implicit surface evaluation
Rust
95
star
8

ssra

The Solid-State Register Allocator
Rust
80
star
9

Swingline

Weighted Voronoi Stippling on the GPU
C
59
star
10

pixelsim

Squishy pixel-art spaceships on the GPU
C++
53
star
11

bumpy-firmware

Firmware for a DIY mp3 player
C
27
star
12

tiny-planets

Rust
26
star
13

bumpy-pcb

PCB design files for a DIY mp3 player
20
star
14

Graphene

Hierarchical computation graphs; details at
Racket
18
star
15

carvr

Image resizing app that uses seam carving
C++
17
star
16

ao-guile-repl

Standalone minimal REPL + viewer for ao-guile [DEPRECATED]
C++
14
star
17

advent-of-code

Advent of Code solutions
Rust
13
star
18

spacewar

2D ship-to-ship combat
Haskell
12
star
19

dotfiles

Vim Script
8
star
20

teapot-mrep

Experiments with direct ray-tracing of Bรฉziers using matrix representations
C
8
star
21

states-machine

Memorize the names and location of US states with spaced repetition
C
7
star
22

straylight

Nothing to see here...
C++
5
star
23

super-auto-sim

Standalone implementation of Super Auto Pets, for science!
Rust
3
star
24

guile-mingw

PKGBUILD for Guile 2.2
Shell
3
star
25

sudoku-z3

Sudoku โ†’ Z3
Scheme
3
star
26

arm64-test

Rust
2
star
27

Multitroids

Single-player asteroids clone, with a twist!
Python
2
star
28

nmbr9-z3

Rust
1
star
29

titan

A half-finished terminal browser for the Gemini protocol
Rust
1
star
30

muxn

1
star