Online, realtime, multiplayer game of Set, from Set Enterprises, Inc., built entirely with ocaml (and reasonml).
Play the game here: https://setml.andrewtongen.net/
Outside of the websocket connection, the app server processes are completely stateless. All messages are synchronized with postgresql using listen/notify.
Server-side ocaml code is found in
Client-side reasonml code is found in
Shared modules are found in
On the client-side, all cards are rendered to a hidden canvas with svg, and then copied to the visible canvas to update the game board.
- ocaml 4.06.1
- postgresql 11
- linux (untested on macos)
building and running
check out the code
git clone email@example.com/atongen/setml cd setml
Provision a postgres db for setml and create an
envfile with the connection information.
The default values look similar to this:
DB_NAME=setml_development DB_HOST=localhost DB_PORT=5432 DB_USER=`whoami` DB_PASS=abcd1234
Add entries only for what you need to override.
opam pin add -yn setml . opam install setml make
npm install npm start
and in separate terminal:
npm run-script webpack
You may want to refer to https://reasonml.github.io/reason-react/docs/en/installation for more information about installing bucklescript/reasonml.
With db created,
envfile in place, you can run
to load the database schema.
to start the server.
http://localhost:7777/ to access the application.
Provision a test database in postgres (this is
setml_test by convention), then run:
To populate the test db schema.
To run the test suite against both the server-side code and client-side code.
Docker images are provided on dockerhub.
docker pull atongen/setml docker-compose up
This project is licensed under the MIT License - see the LICENSE.md file for details