Skip to content

Latest commit

 

History

History
81 lines (53 loc) · 1.98 KB

README.md

File metadata and controls

81 lines (53 loc) · 1.98 KB

webtarot

built with nix

A online game of french tarot in rust / webassembly

webtarot screenshot The project is playable but the code (and the interface) is not pretty. I am learning rust with this project, don't hesitate to make pull requests.

Manual installation

Compile application:

make

Start server:

./dist/webtarot_server -p 8000 -d dist/public

then open http://127.0.0.1:8000/.

If you want to see logs:

RUST_LOG=info ./dist/webtarot_server -p 8000 -d dist/public

Development

Start server and client in development mode:

make client
make server

and open your browser to http://127.0.0.1:8001/

Nix flake deployment

The container directory contains an example of a nix configuration.

  • build it with make local
  • get the ip address of the container : machinectl, which output something like this :
MACHINE   CLASS     SERVICE        OS    VERSION ADDRESSES
webtarot container systemd-nspawn nixos 23.05   10.233.2.2…

Then browse to the ip firefox http://10.233.2.2

Internationalization

Requirements:

  • gettext
  • xtr (cargo install xtr)
  • cargo-i18n (cargo install cargo-i18n, tested with cargo-i18n v0.2.10)

Edit target languages in i18n.toml and webtarot_client/i18n.toml

Generate translation files: cd webtarot_client && cargo i18n (you can ignore error messages about parent crate)

Translate strings in webtarot_client/i18n/po/your_language/

Compile translations

cd webtarot_client
cargo i18n
cargo build

Thanks