cribbage
Site | GitHub | Coverage Report
Cribbage is a popular card game, predominately played by two players.
Background
An example of a fullstack cribbage playing program, allowing games to be played with remote users.
It has been created as “a bit of fun” and, as of Dec 2025, the project is essentially complete, and now presents as an example project for general perusal. I’m always learning and welcome feedback any aspects of the project, especially if there are ways to make things simpler and / or clearer. If you’re interested in helping me along that learning path please make any comments through the github issues page.
- Rust: core programming language.
- Dioxus 0.7: cross-platform UI framework; including some Dioxus Components.
- Multiple workspaces: web, ui, api, server.
- Event sourcing: CQRS-ES
- PostgreSQL: persisted events and aggregates.
- Docker Compose: containerization for local development.
Packages
graph TD
dioxus["dioxus 0.7"]
web["web"]
ui["ui"]
api["api"]
server["server"]
web --> dioxus
web --> ui
web --> api
ui --> dioxus
ui --> api
api --> dioxus
api --> server
Project Documentation
Setup
Note: git pre-commit checks require active database because the following commands are executed:
cargo sqlx migrate runcargo sqlx prepare
DATABASE_URL=postgres://postgres:password@localhost:5432/cribbage
docker-compose -f docker/compose.yml up -d
cd packages/server
cargo sqlx migrate run
Testing
cargo test --all-features
Build
dx build --package=web
Run
dx serve --package=web
Navigate to:
Notes
- This is not an example of authorisation and / or security. A “user-id” is simply persisted in browser storage and passed around as-is.
History
This project has been used as a learning platform and had many flavours over time. The Rust / Dioxus combination proved the most productive and sucessful.
The key interest revolved around:
Previous technologies included Scala, Akka (now Pekko), and later trying out the Cats Effects stack.
The project then moved to Rust initially using Leptos before finally committing to Dioxus.
I have to raise my hat to the Dioxus team and community as a whole for being incredibly supportive, proactive, reactive and helpful with any questions / queries I had during the development.