{"id":13726304,"url":"https://github.com/atongen/setml","last_synced_at":"2026-02-14T20:43:51.338Z","repository":{"id":141428650,"uuid":"163316351","full_name":"atongen/setml","owner":"atongen","description":"Online, realtime, multiplayer game of Set, from Set Enterprises, Inc., built entirely with ocaml (and reasonml).","archived":false,"fork":false,"pushed_at":"2018-12-31T17:06:26.000Z","size":972,"stargazers_count":46,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-08-04T01:28:47.942Z","etag":null,"topics":["canvas","game","ocaml","postgresql","reasonml"],"latest_commit_sha":null,"homepage":"https://setml.andrewtongen.net/","language":"OCaml","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/atongen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-12-27T16:41:10.000Z","updated_at":"2024-01-10T23:44:52.000Z","dependencies_parsed_at":"2024-01-06T02:03:43.029Z","dependency_job_id":"54b2beaf-535f-49e4-a2e4-846f234ef3ba","html_url":"https://github.com/atongen/setml","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atongen%2Fsetml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atongen%2Fsetml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atongen%2Fsetml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atongen%2Fsetml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atongen","download_url":"https://codeload.github.com/atongen/setml/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224654219,"owners_count":17347697,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["canvas","game","ocaml","postgresql","reasonml"],"created_at":"2024-08-03T01:02:58.644Z","updated_at":"2026-02-14T20:43:51.299Z","avatar_url":"https://github.com/atongen.png","language":"OCaml","readme":"# setml\n\nOnline, realtime, multiplayer game of Set, from [Set Enterprises, Inc.](https://www.setgame.com/), built entirely with ocaml (and reasonml).\n\nPlay the game here: https://setml.andrewtongen.net/\n\nOutside of the websocket connection, the app server processes are completely stateless.\nAll messages are synchronized with postgresql using listen/notify.\n\nServer-side ocaml code is found in `src/server`.\nClient-side reasonml code is found in `src/client`.\nShared modules are found in `src/shared`.\n\nOn 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.\n\n## prerequisites\n\n* ocaml 4.06.1\n* dune\n* opam\n* npm\n* make\n* postgresql 11\n* linux (untested on macos)\n\n## building and running\n\n### check out the code\n\n```\ngit clone git@github.com/atongen/setml\ncd setml\n```\n\n### envfile\n\nProvision a postgres db for setml and create an `envfile` with the connection information.\n\nThe default values look similar to this:\n\n```\nDB_NAME=setml_development\nDB_HOST=localhost\nDB_PORT=5432\nDB_USER=`whoami`\nDB_PASS=abcd1234\n```\n\nAdd entries only for what you need to override.\n\n### server-side\n\n```\nopam pin add -yn setml .\nopam install setml\nmake\n```\n\n### client-side\n\n```\nnpm install\nnpm start\n```\n\nand in separate terminal:\n\n```\nnpm run-script webpack\n```\n\nYou may want to refer to https://reasonml.github.io/reason-react/docs/en/installation for more information about installing bucklescript/reasonml.\n\n## running\n\nWith db created, `envfile` in place, you can run\n\n```\nscript/reload_db.sh\n```\n\nto load the database schema.\n\nThen run:\n\n```\nscript/run.sh\n```\n\nto start the server.\n\nBrowse to `http://localhost:7777/` to access the application.\n\n## testing\n\nProvision a test database in postgres (this is `setml_test` by convention), then run:\n\n```\nSETML_ENV=test script/reload_db.sh\n```\n\nTo populate the test db schema.\n\nThen run\n\n```\nmake test\n```\n\nTo run the test suite against both the server-side code and client-side code.\n\n## docker\n\nDocker images are provided on [dockerhub](https://cloud.docker.com/repository/docker/atongen/setml).\n\n```\ndocker pull atongen/setml\ndocker-compose up\n```\n\n## server-side resources\n\n* https://www.reddit.com/r/ocaml/comments/510o92/what_would_an_ocaml_entry_to_hashrockets/\n* https://gist.github.com/copy/8f71a129e9b7ff64c262cbabf191e2a5\n* https://github.com/vbmithr/ocaml-websocket\n* https://github.com/mirage/ocaml-cohttp\n\n## client-side resources\n\n* https://reasonml.github.io/reason-react/\n* https://react.rocks/tag/Game\n* https://github.com/chriz001/Reacteroids\n* https://www.heropatterns.com/\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details\n","funding_links":[],"categories":["OCaml"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatongen%2Fsetml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatongen%2Fsetml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatongen%2Fsetml/lists"}