Giter VIP home page Giter VIP logo

shadowroller's Introduction

Shadowroller (https://shadowroller.net/) is work-in-progress a website that lets you roll lots of d6's and follow Shadowrun's dice rules.

Desktop screenshot Oct 02 2020

build badge

There is a server (sr-server) which runs games for my friends. This system is not available for the general internet at the moment. You can run a local version of the server yourself if you'd like - it's easy if you're comfortable with the command line and port forwarding. Please read the Local development and Production environment sections first!

Local development

Editor setup

You will at the minimum want an editor which can handle Go and Typescript. IDE support for both of these languages is available via the Language Server protocol. You might need to install NodeJS and Go locally in order to have a nice editor experience, in which case it may not be worth it to run Docker.

Docker

Running Shadowroller locally with Docker can be easier than running it manually, but it can be a liiiitle slower to boot up. If you're unfamiliar with Docker, it may be a good idea to read up on the basics. You can install docker from your package manager or their website.

Shadowroller uses docker compose to run containers in development. Running Shadowroller locally is just a matter of typing

docker-compose up

in a terminal when you're at the root directory of the project. The web and server with both automatically refresh when changes are made in the web/ and server/ directories.

If you install or upgrade dependencies (i.e. package.json, package-lock.json, go.mod, or go.sum change), you'll need to rebuild the container(s) via docker-compose build web or docker-compose build server.

Locally

Take a look at the Makefile, it's got a collection of basic scripts you can run.

The easiest way to run Shadowroller locally is to use Tmuxp (a Python library) with tmux. There's a .tmuxp.yaml file which is essentially a scripted way to run all the components in different terminals in one tmux window. (If you're a tmux or screen pro and could set this up with shell script, I'll happily accept your submission!)

This requires only reflex, which you can replace with your "watch-the-.go-files-and-rerun-go run-when-one-changes" script of your choice.

Redis (https://redis.io/): At the time of writing, Shadowroller tries to add test games to the default Redis database when it boots up in a dev environment. You can use the provided configuration: redis-server redis/redis.conf. This saves a persistent database to redis/sr-server.rdb and isolates Shadowroller from any "default" Redis database. You can also simply use the built-in service manager (i.e. systemctl enable redis or brew services start redis).

Server (Go) (https://golang.org) Shadowroller may be using a version of Go newer than that provided by your package manager. Go is typically installed from its website. As mentioned above, you may want a script to restart the server automatically when its .go files change.

Frontend (Typescript) (https://nodejs.org/) Shadowroller's frontend is compiled from Typescript into a single-page app (SPA). In development, npm run start (from the web directory) will run a hot-reloading server (from Create React App). You can also build the frontend yourself (via make build) and have the server host it.

You can run the frontend and backend independently if you like, but you can't run the server without Redis.

On production

You can totally run your own version of Shadowroller on the internet if you want to! That's the power of free software! Shadowroller runs perfectly fine on a Raspberry Pi and there is plenty of configuration to help you out.

Please look at server/config/config.go to get a sense of some of the options. For example, you can:

  • use SSL termination, an automatic Let's Encrypt setup, or your own certificate
  • Host the frontend via a CDN or with the server

Please make sure you've read through config.go so you know what you're doing!

It should be fairly easy to tweak the docker-compose.yaml file to include these options, or even use Docker Swarm or Kubernetes. I've run shadowroller.net from a Raspberry Pi B (the oldest Model B, the one with a single-core CPU) without Docker.

Credits & Attribution

Shadowroller's source code is licensed under the MIT license available in the LICENSE file. Shadowroller is free software; you may redistribute or modify it to your liking.

Shadowroller's logo is (c) Alyssa Colon, licensed under CC BY-NC-SA 4.0. She's @colon_capers on Instagram.

Shadwroller's other non-software assets in assets/ (such as our dice icons) are licensed under CC BY-NC-SA 4.0 - they may be shared and adapted non-commercially and with attribution.

Shadowroller is built with React, with developer experience greatly improved by Typescript. Site UI and CSS is done via Styled Components. React window provides a nicer scrolling experience.

Shadowroller's server is written in Go, using the Gorilla routers that build on top of the standard library's robust HTTP server. We use Redis for storage, accessed via the go-redis library. We use OpenTelementry for tracing and error reporting via Uptrace.

Shadowroller uses icons from Font Awesome.

Shadowroller uses the beautiful open source font Source Code Pro, an elegant monospace masterpiece from Adobe Originals designers Paul D. Hunt and Teo Tuominen, and redistributes it under the terms of the OFL 1.1 to keep page load times down.

shadowroller's People

Contributors

snirkimmington avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

shadowroller's Issues

Update `RollHistoryPanel` pagination

Pagination on the RollHistoryPanel is done via react-bootstrap. We should emit the proper pagination links in a dedicated component. If possible, improve pagination code as it is broken in the branch.

Themes, better styling

I'm tired of using bootstrap as a crutch instead of learning CSS, and dealing with the way it interacts with React. I started using react-bootstrap but there's also reactstrap. Last I checked, neither had completely updated to bootstrap 4.

I'd like to switch to styled-components, which is more "native" to React and to CSS itself. It's 2020, you all have phones that can handle more JS bloat, right?

Update `RollResult` to Bootstrap 4

Update RollResult code and improve its design.

  • Show a list of dice rolled, color-coded for hit/exploding/glitchy
  • Show the command used to roll the dice: count hits/test for/against
  • Show the sum (+min/max?) with extra info
  • Restrict dice to rows of 6 on mobile (include suggestion to <br> in html)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.