Web service generating images of Japanese (Riichi) Mahjong hands.

Overview

chombo-gen

Rust CI Build Status Docker Images Build Status AGPL licensed

ChomboGen is a web service that allows to generate images of Japanese (Riichi) Mahjong hands. The hands are provided in a text format and are generated in PNG format.

See it in action on hand.chombo.club.

Riichi Hand Generator screenshot

Development

The project is written purely in Rust, both its backend and frontend.

Backend

To run the development server, run:

cargo run

This will start the server at localhost:8000.

To build a release version, execute:

cargo build --release

The target binary will be put at target/debug/chombo-gen-backend.

Frontend

Frontend uses the yew framework. The code is compiled into a WebAssembly binary and then statically served.

First, install the Trunk bundler and add wasm32 target support to your Rust toolchain.

rustup target add wasm32-unknown-unknown
cargo install trunk

Then, you can use:

trunk serve

to start local server at localhost:8080. It assumes that the backend is running at localhost:8000.

To build a distributable version of the frontend, execute:

trunk build --release

This will build a website in frontend/dist/ directory that can be statically served by a server such as nginx. You can override th backend URL by providing it as the CHOMBO_GEN_API_URL environment variable, like so:

export CHOMBO_GEN_API_URL=http://api.hand.example.com
trunk build --release

pre-commit

We encourage contributors to use predefined pre-commit hooks — to install them in your local repo, make sure you have pre-commit installed and run:

pre-commit install

Deployment

The easiest way to try locally or deploy chombo-gen is to use auto-generated Docker images. There is a separate image for backend, frontend, and a reverse proxy (that exposes both the backend and frontend under the same server), all of which are published on the GitHub Container Registry. There is an example docker-compose.yml file provided in the repository root.

In the project root directory, execute:

docker compose up -d

After that, the website will be available on at localhost:8000.

Attribution

This project uses riichi-hand-rs library, which uses modified riichi-mahjong-tiles by FluffyStuff, licensed under CC BY 4.0.

You might also like...
Runit service management wrappers

void-svtools Basic wrappers for managing services for runit,

A Rust client for the NOAA Weather Wire Service Open Interface.

nwws-oi A Rust client for the NOAA Weather Wire Service Open Interface. NWWS-OI is one of several platforms through which the National Weather Service

Matrix Bot for Bitcoin Push Notification Service

BPNS Matrix Bot Description Matrix Bot for Bitcoin Push Notification Service. Requirements Rust (1.57.0+) BPNS Server Matrix account Build cargo build

A rust library for toornament.com service

A rust library for toornament.com service

Satoru keeper service 🦀.
Satoru keeper service 🦀.

Satoru keeper service 🦀 📝 Description The keeper is an offchain service for Satoru protocol. It is responsible for: Watching the user initiated acti

Web Browser Engineering

This is a port of Web Browser Engineering series from Python to Rust done by Korean Rust User Group.

Benchmarking web frameworks written in rust with rewrk tool.

Web Framework Benchmarks Benchmarking web frameworks written in rust with rewrk tool.

Blueboat is an open-source alternative to Cloudflare Workers. The monolithic engine for serverless web apps.

Blueboat Blueboat is an open-source alternative to Cloudflare Workers. Blueboat aims to be a developer-friendly, multi-tenant platform for serverless

Software adapter for various Chunithm slider controllers with a built-in Brokenithm web controller
Software adapter for various Chunithm slider controllers with a built-in Brokenithm web controller

slidershim Software adapter for various Chunithm slider controllers with a built-in Brokenithm web controller. Has support for keyboard/gamepad output

Owner
Mateusz Maćkowski
Open-source contributor, enthusiast of Rust and GNU/Linux.
Mateusz Maćkowski
Web service for Firefox Suggest

Merino A service to provide address bar suggestions to Firefox. For more details, see the service docs. About the Name This project drives an importan

Mozilla Services 27 Sep 23, 2022
Memory.lol - a tiny web service that provides historical information about social media accounts

memory.lol Overview This project is a tiny web service that provides historical information about social media accounts. It can currently be used to l

Travis Brown 317 Jul 12, 2023
Frame is a markdown language for creating state machines (automata) in 7 programming languages as well as generating UML documentation.

Frame Language Transpiler v0.5.1 Hi! So very glad you are interested in Frame. Frame system design markdown language for software architects and engin

Mark Truluck 35 Dec 31, 2022
Generating the nth Fibonacci number

Generating the nth Fibonacci number Per Wikipedia, "In mathematics, the Fibonacci numbers, commonly denoted Fn, form a sequence, called the Fibonacci

Charles 3 Dec 19, 2021
proc macros for generating mut and non-mut methods without duplicating code

mwt Hey! You! Read this before using! mwt was thrown together pretty quickly for personal use, because I couldn't find an existing crate that does thi

null 1 Dec 24, 2021
A library for parsing and generating ESP-IDF partition tables

esp-idf-part A library for parsing and generating ESP-IDF partition tables. Supports parsing from and generating to both CSV and binary formats. This

esp-rs 5 Nov 16, 2022
Telegram bot to fetch images from Terceira Ponte and Rodosol into your Telegram chat.

rodosol-telegram-bot Add this bot to your contacts list This bot is a quick scraper that gets the pictures from the rodosol "De olho na via" feature a

Armando Magalhães 1 Jan 9, 2022
LaaS: Life as a Service

LaaS: Life as a Service $ curl life-as-a-service.herokuapp.com/-1x0~0x0~1x0 0x-1~0x0~0x1 let previous = '0x-1~0x0~0x1' for (let i = 0; i < 5; i++) {

Brandon Smith 5 Nov 1, 2021
A discord bot that safely executes whatever rust you throw at it. Remote code execution as a service

RustBot Bot is still under development and not ready for production use RustBot is a discord bot that executes whatever rust code you throw at it. In

Conner Bradley 7 Jan 3, 2022
RuES - Expression Evaluation as Service

RuES is a minimal JMES expression evaluation side-car, that uses JMESPath, and it can handle arbitrary JSON. Which effectively makes it general purpose logical expression evaluation engine, just like some Python libraries that used to evaluate logical expression. This in turn can allow you implement complex stuff like Rule engine, RBAC, or Policy engines etc.

Zohaib Sibte Hassan 14 Jan 3, 2022