{"id":13470688,"url":"https://github.com/google/codeworld","last_synced_at":"2025-05-14T13:06:08.644Z","repository":{"id":44881505,"uuid":"21016984","full_name":"google/codeworld","owner":"google","description":"Educational computer programming environment using Haskell","archived":false,"fork":false,"pushed_at":"2025-04-07T18:30:03.000Z","size":7550,"stargazers_count":1255,"open_issues_count":454,"forks_count":199,"subscribers_count":53,"default_branch":"master","last_synced_at":"2025-05-08T02:59:19.352Z","etag":null,"topics":["codeworld","education","fiddle","functional-programming","ghcjs","haskell","k12","learn-to-code","playground"],"latest_commit_sha":null,"homepage":"http://code.world","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/google.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2014-06-19T21:56:15.000Z","updated_at":"2025-04-11T18:06:18.000Z","dependencies_parsed_at":"2022-09-13T03:32:05.168Z","dependency_job_id":"30a8759e-e293-4d67-a91f-8db1175c5c1d","html_url":"https://github.com/google/codeworld","commit_stats":{"total_commits":2555,"total_committers":52,"mean_commits":49.13461538461539,"dds":"0.38160469667318986","last_synced_commit":"ba976648edef075de21ae91fc3c648eed572249c"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fcodeworld","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fcodeworld/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fcodeworld/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fcodeworld/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/google","download_url":"https://codeload.github.com/google/codeworld/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254149949,"owners_count":22022851,"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":["codeworld","education","fiddle","functional-programming","ghcjs","haskell","k12","learn-to-code","playground"],"created_at":"2024-07-31T16:00:34.096Z","updated_at":"2025-05-14T13:06:08.604Z","avatar_url":"https://github.com/google.png","language":"Haskell","readme":"CodeWorld\n=========\n\n[![Build Status](https://travis-ci.org/google/codeworld.svg?branch=master)](https://travis-ci.org/google/codeworld)\n[![Build status](https://github.com/google/codeworld/actions/workflows/ci.yml/badge.svg)](https://github.com/google/codeworld/actions/workflows/ci.yml)\n\nCodeWorld is an educational environment using Haskell. It provides a simple\nmathematical model for geometric figures, animations, and interactive and\nmulti-player games.  The web-based programming environment supports this\neducational mission with a zero-setup editor and compiler, easy sharing and\ncloud storage of projects, and the ability to run programs right in the web\nbrowser using GHCJS.\n\nThere are several variants of CodeWorld available:\n\n- [CodeWorld](https://code.world/) uses an educational variant of the Haskell\n  language and libraries, designed to support mathematics instruction.\n- [CodeWorld Haskell](https://code.world/haskell) is built against standard\n  Haskell instead of the educational variant, to build programs which can either\n  be on the web site with GHCJS, or compiled natively with the `codeworld-api`\n  package and `blank-canvas`.\n- [CodeWorld Blocks](https://code.world/blocks) provides a drag-and-drop\n  programming user interface for younger students to build programs with\n  CodeWorld.  This interface still has some bugs, and isn't recommended for\n  use.\n\nStatus\n======\n\nCodeWorld is stable and has been used in schools for years!  See\n[the users page](https://github.com/google/codeworld/blob/master/docs/Users.md) for a partial list.\nWe're constantly improving the environment, though.  Breaking changes, when\nnecessary, are scheduled to occur between typical (U.S.) K-12 school\nsemesters, to minimize disruption of existing classes.\n\nGoogle is distributing the code for CodeWorld, but CodeWorld is not an\nofficial Google project, and Google provides no support for it.  Instead,\nquestions about the project or code should be asked to the\n[codeworld-discuss mailing list](https://groups.google.com/forum/#!members/codeworld-discuss).\nA student-friendly question and answer forum is also available at\nhttp://help.code.world for questions about programs written *using* CodeWorld,\nrather than questions about building or modifying CodeWorld itself.\n\nGetting Started\n===============\n\nJust visit https://code.world to get started.\n\nThere is no need to download or install anything to use CodeWorld.  This\nrepository will be useful if you prefer to fork and modify the CodeWorld\nenvironment, or contribute changes.\n\nDiscuss and Learn More\n======================\n\nTo discuss and hear announcements about CodeWorld, subscribe to the mailing\nlist at https://groups.google.com/forum/#!forum/codeworld-discuss\n\nThe mailing list should be used to:\n- Hear announcements about and discuss upcoming changes and features.\n- Ask questions about using the system, and give feedback about your\n  experiences.\n- Share interesting ways of using the site, related classroom activities, and\n  more.\n\nTo report bugs or file formal feature requests, try\nhttps://github.com/google/codeworld/issues.\n\nContributing\n============\n\nThere is a slight bit of paperwork involved in contributing to CodeWorld.  You'll need to\nagree to a Contributor License Agreement.  See [`CONTRIBUTING.md`](CONTRIBUTING.md) for details.\n\nBuild and Deployment\n====================\n\nBuilding and running CodeWorld can be a lengthy process, but is automated using the\ninstallation scripts in the root directory, which work on most forms of Linux, including\nDebian, Ubuntu, RedHat, and CentOS.  The step by step instructions are as follows:\n\n0. Read the caveats, explained below.\n1. Change to the root directory of the project.\n2. Run `./install.sh` to set up the project.\n3. Run `./run.sh` to start the server.\n\nYou can now access the CodeWorld system at http://localhost:8080.\n\nIf you make changes to CodeWorld, you can rebuild it without rebuilding the dependencies:\n\n1. Change to the root directory of the project.\n2. Run `./build.sh` to recompile just CodeWorld itself, using previously installed tools and libraries.\n3. Run `./run.sh` to start the server.\n\n### Docker\n\nIt's also possible to build and run the server using Docker.  This is not yet the\nrecommended way to develop with CodeWorld, but it could get there soon.\n\nCommands to try for docker:\n\n    sudo docker build -t codeworld https://github.com/google/codeworld.git\n    sudo docker run -p 80:8080 -t codeworld\n\nFor now, the docker container has no way to access a client id, mount a shared NFS\ndrive, or other setup steps.  It will work, but it won't be complete.  In the\nfuture, this should become the standard way to deploy CodeWorld.\n\n### Stack\n\nThe `stack.yaml` in the project's root is present to partially support Intero and\n[Travis CI](https://travis-ci.org/google/codeworld/).  On Travis, `codeworld-compiler`\ntests do not run.\n\nBuilding and running CodeWorld locally with Stack is unsupported, and in fact doesn't\nwork.  Stack cannot yet substitute for the shell scripts or docker usage above.\n\nCaveats\n-------\n\n### Authentication\n\nCodeWorld offers two modes of authentication or the ability to run with\nauthentication disabled with reduced functionality. The two methods provided\nare as follows:\n\n* [Google authentication](#google-auth): this method uses the Google API and\n  Google accounts and is the mode of authentication enabled in the live\nCodeWorld site; this allows CodeWorld to offload account and credential\nmanagement to a third party\n* [Local authentication](#local-auth): this method uses a simple local database\n  of account information and JWT-based stateless authentication in the browser;\nthis is useful for applications where minimal external dependencies is required\n\nRunning CodeWorld in one of these two modes allows users to save and manage\ntheir projects and folders. With no authentication enabled, users are able to\nwrite, build and run code but lose the ability to save and manage projects and\nfolders.\n\n#### \u003ca name=\"google-auth\"\u003e\u003c/a\u003e Google authentication\n\nFor Google authentication to work, you will need to obtain a Google API key and\nstore it in `web/clientId.txt`.\n\nTo get a Google API key for your CodeWorld installation, please consult the\nfollowing resources:\n\n* [Creating a project](https://cloud.google.com/resource-manager/docs/creating-managing-projects)\n* [Creating an OAuth client ID](https://support.google.com/cloud/answer/6158849?hl=en)\n\nOnce you have a Google API key, copy and paste it into `web/clientId.txt`. A running\nCodeWorld instance will immediately pick up changes to this file.\n\nIn general, the Google authentication system will be the easiest system to\nmaintain since no local password stores are required. This is the mechanism\nused by the official, live version of CodeWorld.\n\n#### \u003ca name=\"local-auth\"\u003e\u003c/a\u003e Local authentication\n\nFor applications in which external dependencies, such as Google accounts, are\nnot acceptable, we provide a simple local authentication system:\n\n* Uses a SQLite3 database\n* Uses good security practices by storing only BCrypt hashes of passwords\n* Uses JWT-based stateless authentication\n\nThis provides a local authentication system with very similar workflows to\nGoogle authentication (i.e. stateless client-side sessions). Currently, no\nweb-based administrative interface is provided. Instead, you can use the\n`codeworld-auth` CLI tool to manage accounts.\n\nThe local authentication system may be useful for situations where an\ninstructor cannot reasonably expect all students to have a valid Google account\nand in which the instructor is willing to deploy a local CodeWorld stack.\n\n##### Create account database\n\nLocal authentication will be enabled if a `codeworld-auth.db` file is present\nin the application's root directory. To create this database, run the following\nfrom the root of the Git repository:\n\n```\nbuild/bin/codeworld-auth init-accounts -d codeworld-auth.db\n```\n\nThis will create an empty account database with no accounts.\n\n##### Create one or more user accounts\n\nAssuming you have already created an account database as described above, you\ncan create a new account as follows:\n\n```\nbuild/bin/codeworld-auth create-account -d codeworld-auth.db johndoe Expired\n```\n\nThis will create a new account with user ID `johndoe` with a randomly generated\npassword. The account will be set to \"Expired\" which means the user will be\nprompted to enter a new password at next sign-in time.\n\nOther subcommands are provided for updating and deleting accounts etc. For\nhelp:\n\n```\nbuild/bin/codeworld-auth --help\n```\n\n##### Create a JWT secret\n\nTo use local authentication, you will also need to generate a JWT secret stored\nin a file named `codeworld-auth.txt`. This is used to sign JWT tokens passed\nback and forth between the server and the browser. From the Git repository's\nroot directory, run the following command:\n\n```\nbuild/bin/codeworld-auth generate-secret -s codeworld-auth.txt\n```\n\nThis will generate a new random JWT signing key. The server should not expose\nthis secret to external users.\n\n### Swap Space ###\n\nIf you are installing CodeWorld on a virtual server, be aware that the default\nRAM on these servers is often not sufficient for GHC.  CodeWorld needs to compile very\nlarge Haskell projects during its installation.  The following should be sufficient to\nresolve any out-of-memory problems you encounter:\n\n    $ sudo dd if=/dev/zero of=/swap bs=1024 count=2097152\n    $ sudo mkswap /swap\n    $ sudo swapon /swap\n\nThis creates a 2 GB swap file to increase available virtual memory.  Installation with\na swap file may be slow, but it will succeed.  (Unless you intend to write very large\nprograms in CodeWorld, it's usually safe to remove the swap file after running the\nserver for the first time.)\n","funding_links":[],"categories":["Haskell","Tools"],"sub_categories":["Mesh networks"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Fcodeworld","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoogle%2Fcodeworld","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Fcodeworld/lists"}