|
4 days ago | |
---|---|---|
.github/workflows | 12 months ago | |
.vscode | 1 year ago | |
client | 3 weeks ago | |
doc | 2 weeks ago | |
relay | 1 month ago | |
server | 7 months ago | |
.dockerignore | 4 days ago | |
.gitignore | 1 month ago | |
Dockerfile | 4 days ago | |
LICENSE | 2 years ago | |
NOTES.md | 1 year ago | |
NOTES_SUBDOMAIN.md | 2 years ago | |
README.md | 4 days ago | |
bun.lock | 4 days ago | |
docker-compose.yml | 4 days ago | |
ecosystem.config.cjs | 1 year ago | |
env.d.ts | 1 year ago | |
index.html | 6 months ago | |
package-lock.json | 4 months ago | |
package.json | 11 months ago | |
tsconfig.json | 11 months ago | |
vite.config.ts | 6 months ago |
README.md
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:
- Step 5: How to Run Games Locally
- Step 7: How to Update an existing Game
- Step 9: How to Publishing a Game
- Troubleshooting
Documentation
The documentation is very much work in progress but the linked documentation here should be up-to-date:
Game creation API
- Creating a Game: the main document to consult.
- More about Hints: describes the
Hint
andBranch
tactic.
Frontend API
- How to Run Games Locally: play a game on your computer
- How to Update an existing Game: update to a new lean version
- How to Publishing a Game: load your game to adam.math.hhu.de for others to play
Backend
not fully written yet.
- Server: describes the server part (i.e. the content of
server/
undrelay/
).
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:
- 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. - Run
npm run translate
. This should create a new fileclient/public/locales/{language}/translation.json
. (alternatively you can copy-pasteclient/public/locales/en/translation.json
) - Add all translations.
- Commit the changes you made to
config.json
together with the newtranslation.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.