{"id":13678937,"url":"https://github.com/code-golf/code-golf","last_synced_at":"2025-05-14T14:07:40.890Z","repository":{"id":37472625,"uuid":"69795240","full_name":"code-golf/code-golf","owner":"code-golf","description":"A game designed to let you show off your code-fu by solving problems in the least number of characters.","archived":false,"fork":false,"pushed_at":"2025-05-12T22:27:01.000Z","size":17258,"stargazers_count":1202,"open_issues_count":287,"forks_count":115,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-05-12T23:29:41.159Z","etag":null,"topics":["hacktoberfest"],"latest_commit_sha":null,"homepage":"https://code.golf","language":"Go","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/code-golf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","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,"zenodo":null},"funding":{"github":"JRaspass"}},"created_at":"2016-10-02T12:09:24.000Z","updated_at":"2025-05-12T22:47:24.000Z","dependencies_parsed_at":"2023-09-22T10:27:40.737Z","dependency_job_id":"dfe7d419-7adb-4a1e-a730-409d26c59f1c","html_url":"https://github.com/code-golf/code-golf","commit_stats":{"total_commits":3651,"total_committers":91,"mean_commits":"40.120879120879124","dds":"0.17337715694330325","last_synced_commit":"b13c523a8ce02f7887356e8561237aefcf07c7f9"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code-golf%2Fcode-golf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code-golf%2Fcode-golf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code-golf%2Fcode-golf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code-golf%2Fcode-golf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/code-golf","download_url":"https://codeload.github.com/code-golf/code-golf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254159194,"owners_count":22024558,"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":["hacktoberfest"],"created_at":"2024-08-02T13:01:00.030Z","updated_at":"2025-05-14T14:07:40.868Z","avatar_url":"https://github.com/code-golf.png","language":"Go","funding_links":["https://github.com/sponsors/JRaspass"],"categories":["Go"],"sub_categories":[],"readme":"# Code Golf\n\nThis is the repository behind the website and community https://code.golf\n\n## Quickstart\n\nAlternatively, see the Vagrant section below to create a virtual machine with everything pre-installed.\n\n1. Install dependencies:\n* [Docker](https://docs.docker.com/engine/install/)\n* [Docker Compose](https://docs.docker.com/compose/install/)\n* [Go](https://golang.org/doc/install)\n* [make](https://www.gnu.org/software/make/) - most likely already on your system\n* [mkcert](https://github.com/FiloSottile/mkcert#installation)\n* [npm](https://www.npmjs.com/get-npm)\n\n2. Install the local CA:\n```\n$ make cert\nUsing the local CA at \"~/.local/share/mkcert\" ✨\nThe local CA is now installed in the system trust store! ⚡️\nThe local CA is now installed in the Firefox and/or Chrome/Chromium trust store (requires browser restart)! 🦊\n\n\nCreated a new certificate valid for the following names 📜\n - \"localhost\"\n\nThe certificate is at \"./localhost.pem\" and the key at \"./localhost-key.pem\" ✅\n```\n\n3. Install the NPM packages:\n\n\u003e *NOTE*: if your host OS is not the same architecture / executable format as\n\u003e your Docker environment, this can result in incorrect format binaries installed\n\u003e into `node_modules`, so you may want to skip this step.\n\n```\n$ npm install\n```\n\n4. Bring up the website:\n```\n$ make dev\n```\n\n5. Optionally, load information from the code.golf database.\n```\n$ go run utils/update_sql_from_api.go\n```\n\n6. Navigate to https://localhost\n\n## Hacking\n\nSome of ancillary scripts are written in Raku, to run these ensure you have a\nrecent install of Raku installed and use Zef to install the dependencies:\n```\n$ zef install --deps-only .\n```\n\n## TypeScript\n\nThe `js/` directory contains the TypeScript files which will be transpiled by\n`esbuild` into JavaScript files for serving. `.tsx` files can additionally\nmake use of [JSX](https://www.typescriptlang.org/docs/handbook/jsx.html).\n\n## Linting\n\nRun `make lint` to lint the code before a pull request. This lints the TypeScript code, then the Go code.\n\nIn Visual Studio Code, the following settings are helpful for editor support for ESLint:\n\n```\n\"eslint.validate\": [\"typescript\", \"typescriptreact\"],\n\"eslint.format.enable\": true,\n\"editor.defaultFormatter\": \"dbaeumer.vscode-eslint\"\n```\n\n## Testing\n\n1. Run the unit tests:\n```\n$ make test\n```\n\n2. Run the e2e tests:\n\n\u003e *NOTE*: Any changes to the languages need to be re-built with `build-langs` before e2e will pick up the changes.\n\n```\n$ make e2e\n```\n\n## Vagrant\n\nUsing Vagrant and VirtualBox, with one command you can create a virtual machine, install all of the other dependencies onto it (Docker, Docker Compose, Go, Raku + zef dependencies, npm, etc.), and forward port 443 (https) to it.\n\n1. Install the dependencies:\n* [Vagrant](https://www.vagrantup.com/downloads)\n* [VirtualBox](https://www.virtualbox.org/)\n\nIf you have homebrew, you can install with:\n```\n$ brew install vagrant virtualbox\n```\n\n2. Create the virtual machine:\n```\n$ git config core.autocrlf false \u0026\u0026 git checkout utils/vagrant-bootstrap \u0026\u0026 vagrant up\n```\n\n3. Install certificates. Ideally, you should run the following command outside of the virtual machine, the same as in the quickstart, because it will install the certificate in your browser. Alternatively, you can run the command in a virtual machine shell and then install the certificates manually.\n```\n$ make cert\n```\nor\n```\n$ vagrant ssh --command 'cd /vagrant/ \u0026\u0026 make cert'\n```\n\n4. Bring up the website:\n```\n$ vagrant ssh --command 'cd /vagrant/ \u0026\u0026 make dev'\n```\n\n5. Optionally, load information from the code.golf database.\n```\n$ vagrant ssh --command 'cd /vagrant/ \u0026\u0026 go run utils/update_sql_from_api.go'\n```\n\n6. Navigate to https://localhost\n\n## Database Access\n\nIf you have [PostgreSQL](https://www.postgresql.org/download/) installed You can access the SQL database directly with the following command. If you are using Vagrant, PostgreSQL is pre-installed.\n```\n$ make db-dev\n```\n\n## API\n\nValidate API definition with [vacuum](https://api.quobix.com/report?url=https://code.golf/api).\n\n## Style\n\nURL slugs are consistently abbreviated (e.g. cheevos, langs, stats) but page\ntitles aren't (e.g. Achievements, Languages, Statistics).\n\nPaginated URLs use a trailing number but only on pages after the first (e.g.\n/rankings/medals/all, /rankings/medals/all/2, etc.).\n\n## arm64/aarch64 Architecture (Ex: Apple Silicon)\n\nIf your machine has arm64 architecture, then there are a few options for running a local instance of the site.\nYou can attempt to use QEMU emulation which is supported by Docker Desktop, but may be slower.\nThe default when you `make dev` is that the docker images will be built with arm64 architecture.\n\nYou may be able to use some languages without building them locally.\nHere is a list of some of the languages that are able to run the sample code, without rebuilding individual docker containers:\n* AWK\n* Bash\n* Berry\n* Lua\n* Perl\n* PHP\n* Python\n* Raku\n* Ruby\n* sed\n* SQL\n* Wren\n\nFor other languages, you will need to build them locally. For example:\n```\n$ ./build-langs --no-push C Go JavaScript\n```\n\nOtherwise, you may see the following error:\n```\nassertion failed [!result.is_error]: Unable to open /proc/sys/vm/mmap_min_addr\n(VMAllocationTracker.cpp:281 init)\n signal: trace/breakpoint trap\n ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcode-golf%2Fcode-golf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcode-golf%2Fcode-golf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcode-golf%2Fcode-golf/lists"}