Skip to content

robwhitaker/mmp-website

Folders and files

NameName
Last commit message
Last commit date
Sep 10, 2019
Oct 19, 2018
Apr 2, 2019
Jun 28, 2017
Jan 5, 2018
Jan 26, 2020
May 30, 2017
Feb 16, 2020
Jan 26, 2020
Jan 26, 2020
Jan 26, 2020
Jan 21, 2020
Jan 21, 2020
Jan 18, 2016
Jan 26, 2020
Jul 26, 2016
Aug 9, 2018
Jun 11, 2017
Jan 26, 2020
Jun 9, 2016
Sep 15, 2019
Sep 7, 2018
Jun 29, 2019
Jan 21, 2020
Jan 26, 2020
Jan 26, 2020
Jan 26, 2020
Apr 1, 2019
Jan 26, 2020
Feb 16, 2020
Dec 17, 2019
Jan 26, 2020
Jan 26, 2020

Repository files navigation

Midnight Murder Party v2

Elm, JavaScript, Haskell, Ruby, Sinatra, Nix, SQLite3 (dev), PostgreSQL (prod)

Requires

Dev Setup

  • Clone and cd into the repository
  • Run ./setup

The setup script will create the necessary files/folders, install dependencies via Nix, setup the database, and build the reader and countdown page. This will probably take between ten and twenty minutes the first time.

Optional: If you plan on using Nix's garbage collector (nix-collect-garbage), you may want to set keep-outputs = true in your Nix config. This will prevent the garbage collector from eating this project's dependencies.

Dev Environment

Once you run the setup script, you can create a dev environment with all the dependencies installed by running ./dev-shell. To exit this shell, just type exit. Unless otherwise noted, all of the following commands will assume you're running in this shell.

Dev Data

If you'd like to add some basic data to your local app for testing/development purposes, you can run this simple command:

DISABLE_DATABASE_ENVIRONMENT_CHECK=1 bundle exec rake db:reset

Note, this command will drop your previous db, create new tables, run migrations, and insert data. The DISABLE_DATABASE_ENVIRONMENT_CHECK=1 flag is a workaround for ActiveRecord::EnvironmentMismatchError.

Running the Server

  • Run ruby app.rb
  • Visit localhost:4567 in your browser

Note: If you are just trying to build and run the app without changing anything, you're done. If you've made changes and need to rebuild the app or install new dependencies, read on.

Building the Front End

  • Reader: gulp build:reader
  • Countdown: gulp build:countdown

Note: You may use the --prod flag while building the Reader and Countdown pages to enable stripping logs/alerts/debuggers, tell the Elm compiler to use the --optimize flag, and use prod config.

Updating Dependencies

If you update the dependencies in the Gemfile, you must generate the corresponding Nix file (gemset.nix) again. To do so, leave the Nix shell and run ./update-deps. Once you enter the Nix shell again, those changes will take effect.

If you update the dependencies in mmp-website.cabal, those dependencies will be automatically installed the next time you enter the Nix shell.

To update the Reader dependencies, you can just run npm install from within the Nix shell.