CharlesTaylor7 / citadels

Home Page:https://citadels.fly.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Citadels

This is a web app for playing the card game Citadels.

Goals

  • Support all characters and roles
  • Learn htmx, practice web dev

Feature set

  • All 30 unique districts
  • All 27 game characters.
  • Game config for picking roles and districts.

Dev commands

For most commands: use mprocs.

Logging

The logger offers five levels: - error - warn - info - debug - trace

This is excessive, and I will try to stick to 3: - error - debug - info

Installing deps

To install a new dep:

  1. Comment out the 2nd line from .cargo/config.toml. So it looks like: # replace-with = "vendored-sources"
  2. cargo add foo
  3. cargo vendor
  4. Uncomment .cargo/config.toml.

You might think this is a lot of friction for adding deps. This is a good thing. Vendoring deps makes it so that the docker image can build more readily, and makes our codebase more resistant to supply chain attacks. The friction makes me think twice before adding a new dep.

Tech Stack

Tech Stack:

  • Frontend:
    • htmx
    • hyperscript (as needed)
    • interactjs for drag 'n drop
  • Backend
    • Rust, stable compiler. No nightly features
    • axum
    • Askama for templating. (Jinja clone for Rust)

Evaluating: - sqlite for two use cases: - game backups via action logs - saving preferred game configuration

Releases

How to release:

  • Bump the version in fly.toml
  • Update changelog
  • Run: fly deploy
  • git commit changes
  • Git tag the release

Secret management

Script to generate a new signing key:

node -e "console.log(require('crypto').randomBytes(64).toString('hex'))"

In prod use fly secret. In dev, use the .env file.

Non secret env vars can go in fly.toml

About

https://citadels.fly.dev

License:MIT License


Languages

Language:Rust 76.4%Language:HTML 22.0%Language:JavaScript 0.8%Language:CSS 0.4%Language:Dockerfile 0.2%Language:Shell 0.2%