NerdDice.com is a Ruby on Rails (currently version 7.0.x) web application for managing table top role-playing games. There are quite a bit of potential features that we could incorporate to add value to players and game masters. Features will be prioritized and added incrementally using an agile methodology of trying to maximize early value delivery. We're still in the early stages of application development, but you can check out our project backlog and issues list for the latest information.
We encourage you to code along. The end-to-end process of developing this application is being captured as instructional videos. The videos are in a one-take style so that the mistakes along the way have troubleshooting and the concepts used to develop the application are explained as they are covered. We try to keep the videos targeted to a single topic, user story, or sub-task to the extent possible. This is primarily an educational project with the goal of providing a true end-to-end of the entire life cycle of development of a Ruby on Rails application. We have other video series as well. Check them out at our YouTube channel or by visiting our website.
When appropriate, we also add groups of videos for a related topic to their own playlists in addition to the main NerdDice.com playlist. Current sub-playlists are below:
To get the application up and running in your local development environment, take note of the following particulars of the application.
- Install needed Ruby version including bundler
- Install PostgreSQL
- Clone or fork (then clone) this GitHub repository
- Run
bundle installfrom the root directory of the application - Configure the application secrets
- Set up the database
- Run the test suite
- Run the development server
The application runs on Ruby version specified in the .ruby-version file of the root directory of the application. Which Ruby version management option you choose shouldn't make an impact on the setup of the application. Note that Ruby 3.2.0 and later no longer bundles Stdlib 3rd party sources like libyaml and libffi. We do have a video on how to Install RVM and Ruby on Ubuntu 20.04 with Ruby versions 2.7 and 3.0. Other than the noted differences with libyaml and libffi the process should essentially be the same on Debian variants of Linux. The dependencies needed to install Ruby may vary from system to system.
After you install Ruby and Bundler, you should get version outputs when you execute ruby -v and bundle --version in your command line.
In order to run this in a development environment, you need to have these other system dependencies installed. This application uses the Rails 7 default of Importmap for Rails, so you don't need npm, yarn (or technically even node) to install and run the application.
In order for the app to run, you need to have PostgreSQL installed on your system. We have a setup video where we Install PostgreSQL 13 and its additional packages. You should be able to run the application without modifying the config/database.yml file. See the instruction comments in that file for platform-specific tips.
By default, the system tests run on headless_chrome. If you wish to run the system tests without any environment variable overrides, you need to install headless Chrome on your system. Otherwise you can use any other supported browser test driver and specify the BROWSER_TEST_DRIVER environment variable when running system tests.
The application uses environment-specific secrets. In order to run the development and test versions of the app, you will need to setup secrets for development and test. You would remove the development.yml.enc and test.yml.enc files from the config/credentials directory on your own application. (DO NOT INCLUDE CHANGES TO THESE FILES WHEN SUBMITTING PULL REQUESTS.) The environment secrets files need to have the following attributes present:
# app secret key base run `bin/rails secret` to generate
secret_key_base: PASTE_FIRST_RAILS_SECRET_HERE
# devise secrets
devise:
# Devise uses a separate secret_key and pepper. Run `bin/rails secret` to generate each one
secret_key: PASTE_SECOND_RAILS_SECRET_HERE
pepper: PASTE__THIRD_RAILS_SECRET_HEREAfter deleting the repository version of development.yml.enc and test.yml.enc, use rails credentials:edit --environment=ENVIRONMENT_TO_EDIT (replacing with the intended environment). If you plan on interacting with GitHub frequently, you will want to copy and paste your version of the secrets files and their keys to a separate directory on your computer or a local git branch. Then you can paste them into your local repo as needed without having to go through the secrets adaptation process each time you pull down the repo.
In order to get the database set up (after you have installed PostgreSQL and successfully ran bundle install, you would run these commands from the root directory of the application.
bin/rails db:create
bin/rails db:migrateYou can isolate to a single environment by using the RAILS_ENV environment variable (ex: RAILS_ENV=development bin/rails db:create). If you need to reset your test database, you can execute bin/rails db:test:setup.
The test suite is separated into normal rails tests (run by executing bin/rails test) and browser-driven application system tests (run by executing bin/rails test:system). You can run the whole suite together in a single command by executing bin/rails test:system test. By default the system tests run with a browser test driver of headless_chrome. If you want to run with a different test driver (often useful to troubleshoot or debug) you can override this by specifying a different test driver with the BROWSER_TEST_DRIVER environment variable.
# would run with Chrome instead of headless Chrome for this test run
BROWSER_TEST_DRIVER=chrome bin/rails test:systemIf you want to permanently override your local system test runner, you can set the BROWSER_TEST_DRIVER environment variable at the system level.
From the application root directory run bin/dev to start the development server and press your operating system's halt command (usually CTRL+C) to stop the server. By default, this starts the Rails server on localhost:3000. Because the application uses Tailwind CSS for styling, you should use bin/dev instead of bin/rails server to run the development server.
TBD. The only service currently needed is the development server.
TBD
You can contribute to this project in a variety of ways. See the CONTRIBUTING page for more details. You don't need to be a programmer to contribute. We welcome feature requests, bug reports, code contributions, and documentation contributions as well as art, design and/or creative input.
Just be polite and courteous in your interactions. It is possible to disagree passionately about ideas without making it personal. You can make a point without using language that leads to escalation. Nobody working on this project is perfect. In the event that something goes wrong, seek forgiveness and reconciliation with one another. Mercy triumphs over judgment.
We welcome and encourage your participation in this open-source project. We welcome those of all backgrounds and abilities, but we refuse to adopt the Contributor Covenant or any similar code of conduct for reasons outlined in BURN_THE_CONTRIBUTOR_COVENANT_WITH_FIRE. We welcome those who disagree about codes of conduct to contribute to this project, but we want to make it abundantly clear that Code of Conduct Trolls have no power here.
So-called "intellectual property" is a racket. The goal of this legal section is to disavow any claim to intellectual property in the strongest possible terms. The code is made available under the UNLICENSE and all copyright is vacated under the Creative Commons CC0 Public Domain Dedication. Copying is not stealing. In the event that the UNLICENSE or CC0 are not enforceable in your jurisdiction substitute it with the most permissive copyright and licensing options available to you in your jurisdiction.