Roleypoly v4 (Go + Low JS version)
auth | ||
discord | ||
interactions | ||
presentation | ||
roleypoly | ||
scripts | ||
static | ||
stores | ||
templates | ||
testing | ||
types | ||
utils | ||
.air.toml | ||
.env.example | ||
.envrc | ||
.gitignore | ||
default.nix | ||
flake.lock | ||
flake.nix | ||
go.mod | ||
go.sum | ||
justfile | ||
main.go | ||
README.md | ||
shell.nix | ||
todo.md |
Roleypoly v4
yeah 4 of em..
Developing
highly recommended to use nix. its actually optional, but there's caveats.
Quickstart
## - Step one, get an environment!
nix develop
# or
nix-shell
# or
direnv allow
## - Step two, setup .env
cp .env.example .env
# fill out .env (the file has instructions)
## - Step three, run the thing!!
just
# or .. maybe this.. but it may be unpredictable
go run .
## - Step three.1, run tests
just test
## - Step four, clean up the code
just precommit
Open the following:
- https://localhost:8169 without live-reload
- https://localhost:8170 with live-reload (useful for templates!)
the caveat: using
go
alone is doable. certain things won't happen, like dependency tagging and env var loading, so.. considernix
..
just commands
- watch - (default) runs air livereloader
- open http://localhost:8170 for live reloading, note: the console will output 8169. that works too, but doesn't reload browser on changes
- run - runs the app with go run
- nix-run - runs the app built via nix (slower)
- run-container - builds the app as a docker image, then runs it. (slowest)
- fmt - go fmt and prettier
- tidy - fix gomods
- test - runs normal tests
- update-vendor-hash - updates
default.nix
vendorHash field, it won't build without it. - precommit - runs fmt, tidy, update-vendor-hash, and test, in that order.
Deploying
roleypoly can be deployed as a docker container (built with nix) or nix package right now. more options to come (like prebuilt binaries)
nix build .#container
docker load -i result
docker run -it --rm -p 8169:8169 localhost/roleypoly/roleypoly
or like if in irl nixos
#== flake.nix
{
inputs = {
roleypoly.url = "git+https://git.sapphic.engineer/roleypoly/v4";
};
}
and want to use docker (its ok)
#== roleypoly.nix
{ inputs, pkgs, ... }: {
virtualisation.oci-containers.containers.roleypoly = {
image = "roleypoly/roleypoly:latest";
imageFile = inputs.roleypoly.packages.${pkgs.system}.container;
ports = [ "8169:8169" ];
# probably include environment and stuff too
};
}
or use inputs.roleypoly.packages.${pkgs.system}.roleypoly
for the actual package for like a systemd thing
<33
thanks
roleypoly has been a journey and a pleasure to make.
thanks to everyone who has used it over the years.
there will be no major updates after v4.
as always, with love
-- noe, aki, and aurelia!