Fork di lean4game del PHC per la settimana matematica del 2025
  • TypeScript 51%
  • Lean 37.9%
  • CSS 5.8%
  • JavaScript 4.2%
  • Shell 0.4%
  • Other 0.7%
Find a file
Antonio De Lucreziis 61ed224788
Some checks are pending
Build / build (push) Waiting to run
added fork info to readme
2025-02-08 19:39:28 +00:00
.github/workflows add manual trigger to github action 2024-02-29 01:02:28 +01:00
.vscode Fix minor typos 2024-01-20 16:15:15 -05:00
client add new game 2025-01-26 14:29:54 +01:00
doc Update publish_game.md 2025-01-30 11:02:20 +01:00
relay Adjust memory to be approx. the same as by htop 2025-01-10 12:11:06 +01:00
server Update LetIntros.lean 2024-07-24 11:06:26 +02:00
.dockerignore feat: added dockerfile and dockercompose 2025-02-08 19:33:17 +01:00
.gitignore Fixed display error of server capacity by performing rounding as last step. 2025-01-10 10:13:36 +01:00
bun.lock feat: added dockerfile and dockercompose 2025-02-08 19:33:17 +01:00
docker-compose.yml some docs 2025-02-08 19:34:06 +01:00
Dockerfile feat: added dockerfile and dockercompose 2025-02-08 19:33:17 +01:00
ecosystem.config.cjs separate lean server from socket server 2023-12-09 22:42:40 +01:00
env.d.ts fix redirect from landing page in dev container #145 2023-11-09 15:26:53 +01:00
index.html add note for servers with different base url 2024-08-27 14:52:20 +02:00
LICENSE Create LICENSE 2023-07-19 02:10:01 +02:00
NOTES.md remove docker isntructions 2023-10-31 15:35:20 +01:00
NOTES_SUBDOMAIN.md notes subdomain 2022-11-15 11:22:19 +01:00
package-lock.json update npm deps 2024-10-17 19:32:36 +09:00
package.json implement i18next and i18next-scanner 2024-03-24 17:37:31 +01:00
README.md added fork info to readme 2025-02-08 19:39:28 +00:00
tsconfig.json fix ts warnings 2024-03-11 12:18:30 +01:00
vite.config.ts add note for servers with different base url 2024-08-27 14:52:20 +02:00

lean4game fork

Questo è un fork di lean4game con supporto per essere self-hostato con Docker.

Deployment con Docker Compose

Dopo aver clonato questa repo, per prima cosa serve creare un token di API per GitHub per permettere a lean4game di importare da solo i vari "game". Possiamo mettere questo token ed il nostro nome utente in un file .env come segue

export LEAN4GAME_GITHUB_USER='...'
export LEAN4GAME_GITHUB_TOKEN='...'

poi per lanciare tutto con docker compose basta eseguire

$ source .env
$ docker compose up -d

Questo comando lancierà lean4game su http://locahost:8080.

Aggiungere Giochi

Per scaricare nuovi giochi basta fare una chiamata al seguente url

  • https://{host}/import/trigger/{org}/{repo}

Ad esempio per scaricare https://github.com/leanprover-community/nng4 basta andare all'indirizzo https://{host}/import/trigger/leanprover-community/nng4 per aggiungere Natural Number Game.


Lean 4 Game

This is the source code for a Lean game platform hosted at adam.math.hhu.de.

Creating a Game

Please follow the tutorial Creating a Game. In particular, the following steps might be of interest:

Documentation

The documentation is very much work in progress but the linked documentation here should be up-to-date:

Game creation API

Frontend API

Backend

not fully written yet.

  • Server: describes the server part (i.e. the content of server/ und relay/).

Contributing

Contributions to lean4game are always welcome!

Translation

The interface can be translated to various languages. For adding a translation, one needs to do the following:

  1. In client/src/config.json, add your new language. The "iso" key is the ISO language code, i.e. it should be accepted by "i18next" and "GNU gettext"; the "flag" key is once accepted by react-country-flag.
  2. Run npm run translate. This should create a new file client/public/locales/{language}/translation.json. (alternatively you can copy-paste client/public/locales/en/translation.json)
  3. Add all translations.
  4. Commit the changes you made to config.json together with the new translation.json.

For translating games, see Translating a game.

Security

Providing the use access to a Lean instance running on the server is a severe security risk. That is why we start the Lean server with bubblewrap.

Credits

The project has primarily been developed by Alexander Bentkamp and Jon Eugster.

It is based on ideas from the Lean Game Maker and the Natural Number Game (NNG) by Kevin Buzzard and Mohammad Pedramfar, and on Patrick Massot's prototype: NNG4.