{"id":13710301,"url":"https://github.com/GLodi/justonecanvas","last_synced_at":"2025-05-06T18:35:05.846Z","repository":{"id":89165949,"uuid":"258450334","full_name":"GLodi/justonecanvas","owner":"GLodi","description":"Reddit's r/place clone","archived":false,"fork":false,"pushed_at":"2021-06-18T19:18:30.000Z","size":3474,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-03T23:18:22.999Z","etag":null,"topics":["canvas","docker","go","mongodb","reddit","redis","typescript","websockets"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/GLodi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-04-24T08:18:27.000Z","updated_at":"2022-05-04T00:44:45.000Z","dependencies_parsed_at":"2023-06-14T06:15:22.629Z","dependency_job_id":null,"html_url":"https://github.com/GLodi/justonecanvas","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/GLodi%2Fjustonecanvas","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GLodi%2Fjustonecanvas/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GLodi%2Fjustonecanvas/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GLodi%2Fjustonecanvas/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GLodi","download_url":"https://codeload.github.com/GLodi/justonecanvas/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224521724,"owners_count":17325288,"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","docker","go","mongodb","reddit","redis","typescript","websockets"],"created_at":"2024-08-02T23:00:54.188Z","updated_at":"2024-11-13T20:31:44.234Z","avatar_url":"https://github.com/GLodi.png","language":"TypeScript","funding_links":[],"categories":["Repositories"],"sub_categories":[],"readme":"# justonecanvas\n\nIf you use Firefox, or any canvas-blocking mechanism, you need to accept canvas permissions \nin your browser BEFORE you make a move, or it may lag a lot.\n\nWebsite no longer online!\n\n[Blog post](https://giuliolodi.dev/how-i-made-justonecanvas)\n\n![image](https://github.com/GLodi/justonecanvas/blob/master/picture.png)\n\nThis is essentially a copy of Reddit's 2017 [r/place](https://redditblog.com/2017/04/13/how-we-built-rplace/). Just tinier\n(65x65) and designed to work on a 5$ Digital Ocean droplet.\n\nAll users connected to justonecanvas actually share the same canvas, and the backend\nupdates all players of each other's moves thanks to WebSockets.\n\nThis project follows a combination of [this](https://github.com/L04DB4L4NC3R/clean-architecture-sample) and [this](https://github.com/AkbaraliShaikh/denti) implementations\nof Clean Architecture\n\nWebsockets in Golang implements this [chat](https://github.com/gorilla/websocket/tree/master/examples/chat) example, while frontend\nfollows [this](https://dev.to/finallynero/using-websockets-in-react-4fkp)\n\nJust FYI: frontend kinda sucks. Being my first experience doing frontend, it's very basic and\nnot at all optimized for mobile.\n\n## development\n\nA complete dev environment is available under docker-compose. Make sure to have docker 19.03 and docker-compose 1.26.2\n\nCheck Makefile or just `make up` under root.\nBoth client and server are setup for hot-reloading.\n\nIf you don't want to use docker, then:\n\n### server\n\nRuns on 8080.\n\n```\ngo mod download\ngo run ./main.go\n```\n\n### client\n\nBecause of a problem regarding Docker and create-react-app, the project was created with:\n\n`npx create-react-app client --use-npm --typescript --scripts-version=react-scripts@3.4.0`\n\nRuns on 3000\n\n```\nnpm install\nnpm start\n```\n\n### load testing\n\nYou can do load testing thanks to Artillery:\n\t- `npm install -g artillery`\n\t- cd in testing directory\n\t- `artillery run loadtest.yml`\n\n## production\n\nCheck makefile or `make upprod` under root folder.\n\nThe production environment makes two assumptions:\n - There must be a .env.prod under root with your variables\n - It must find let's encrypt's certs under `/etc/letsencrypt/live/justonecanvas.live`\n\n\n## profiling\n\nThanks to pprof package, you can:\n\n`wget http://localhost:8080/debug/pprof/trace\\?seconds\\=5` to profile 5 seconds of execution.\n\n`go tool trace 'trace?seconds=5'` to analyze.\n\nRemember to add `pprof.Register(g)` in main.go.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGLodi%2Fjustonecanvas","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FGLodi%2Fjustonecanvas","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGLodi%2Fjustonecanvas/lists"}