= Ticket Booth :doctype: book :source-highlighter: rouge :rouge-style: base16.monokai :toc: :icons: font :license: MIT
[cols="<h,<h", width="70%"] |=== | Test & Lint Status | Build & Packaging Status |https://github.com/fnf-org/TicketBooth/actions/workflows/rspec.yml[image:https://github.com/fnf-org/TicketBooth/actions/workflows/rspec.yml/badge.svg[TicketBooth CI: RSpec]]
| https://github.com/fnf-org/TicketBooth/actions/workflows/deploy.yml[image:https://github.com/fnf-org/TicketBooth/actions/workflows/deploy.yml/badge.svg[Deploy to Google Cloud]]
|===
==== NOTE: Please see the https://github.com/fnf-org/TicketBooth/blob/main/README.pdf[README.pdf] for the PDF version of this README.
== Welcome to the Ticket Booth!
The goal of the app is to make ticket and volunteer management for community events easier and automated.
== Production Deploy, as of 2024
To deploy to production site — https://tickets.fnf.events — the deployer's IP address must be white-listed with EC2. Contact Konstantin Gredeskoul to get white-listed.
The deploy is performed via Capistrano:
== Development Environment Setup
The following walks through a local setup on OS-X M1.
=== Streamlined Setup
If you installed https://brew.sh[Homebrew] on your laptop, you should be able to boot the app.
==== Optional VIM and PostgreSQL Local Configuration
We provided a pretty comprehensive VIM configuration with auto-complete, as well as the psql
configuration with a prompt and additional useful macros.
To install this, run
[source,bash] bin/install-dev-tooling
After that, your vim
sessions will have auto-complete enabled, and your psql -U postgres
sessions will have rich prompt.
==== Running App Dependencies Installer
You can run the following setup script, but only on OS-X, to attempt a complete set up of the development environment, as well as the installation of the Rubies, Gems and Database:
This should install all of the Brew dependencies, start PostgreSQL, memcached, and install Ruby, Node, Yarn, Gems and Node packages.
==== Starting the Rails Server
[source,bash] make dev
This actually starts Foreman via bundle exec foreman -f Procfile.dev
— this is required to start CSS and JS just-in-time compilcation in addition to the Rails server.
The server will run on port 8080, and in development will hot swap any locally modified files, including CSS and JS.
CAUTION: Running rails s
is no longer sufficient to start the application.
==== Running Tests and Linters
To verify that your local environment is working, run the following:
This will run DB Migrations, followed by RSpec, Rubocop, and ShellCheck.
==== Additional Information
We dedicated a separate document to the xref:DEVELOPERS.pdf[developer setup], which helps you get the application running locally.
Alternatively, keep reading for step-by-step manual instructions.
=== Optional Manual Setup
If you prefer to run all the steps manually, then follow the guide below.
==== Manual 1: Services
Please make sure you have PostgreSQL and running locally, or install it via Homebrew:
brew install direnv
brew install postgresql@16 brew services postgresql@16 start
==== Manual 2: Direnv Setup
Before you can start the Ruby Server, you need to configure direnv
so that the environment in the file .envrc
is loaded on OS-X.
To do that follow the instructions for setting direnv on https://direnv.net/docs/hook.html#bash[bash] or https://direnv.net/docs/hook.html#zsh[zsh] depending on what you are running. To find out, run echo $SHELL
.
After you setup the shell initialization file, restart your terminal or reload the shell configuration.
Once you are back in the project's folder, run:
NOTE: the first line above should be copied to your shell RC (aka "dotfiles").
This will load the environment variables from the .envrc
file.
==== Manual 3: NodeJS & Votal Setup
Run the following to get Volta Node Manager working:
Now your Node & Yarn should be installed.
==== Manual 3: Ruby Setup
brew bundle 2>/dev/null
brew install rbenv ruby-build direnv volta
eval "$(rbenv init -)"
rbenv install -s $(cat .ruby-version) rbenv local $(cat .ruby-version)
bundle install -j 12 rails db:prepare rails db:test:prepare
bundle exec rspec
bundle exec rubocop
==== Manual 4: Starting the Server
To start the server post-setup, run the following (NOTE: you must start the server via Foreman, since it also starts yarn
tasks that monitor and dynamically recompile CSS and JS assets)
You can also use the Makefile
:
make dev
Here is an example:
image:docs/make-boot.png["Booting with Make"]
=== Tooling
==== Adding Site Admin
When the database is completely blank, the first step is to create the initial account. Lets say you registered as 'kig@fnf.org':
The second step is to make that person a site admin:
RAILS_ENV=production bin/site-admin add kig@fnf.org
==== Generating Music Submissions List
The repo contains a convenient script for generating HTML to embed into the Wordpress site, using a CSV generated out of Google Spreadsheet collected using Google Forms.
The CSV must contain three columns and a header row:
To generate the HTML (we'll use the CSV file checked into the fixtures):
$ bin/music-submission-links spec/fixtures/chill_sets.csv > chill_set.html
--simple-css
to the arguments, the generated HTML will include <head>
element with the https://simplecss.org/[Simple CSS Stylesheet]. Do not use this flag if you plan to paste the output into the WordPress text box. Use this flag if you simply want to verify the resulting HTML in a browser by running open chill_set.html
.To verify that the script is working and generating correct HTML, you might want to install a handy tool called bat
, eg using Homebrew on Mac OS-X:
===== Adding Submissions to WordPress
Now you can open WordPress, create a two-column layout on the submissions page and paste the contents into one of the two columns, typically:
First, let's copy the resulting HTML into clipboard:
Now we can paste it into WordPress directly.
== API Documentation
Yard-generated documentation is available via running:
$ bundle exec rake doc
== Acknowledgements
This app is formerly known as Helping Culture, which in turn was originally conceived and inspired by Tracy Page.
This project was originally written by https://github.com/sds[Shane de Silva].
It is currently maintained by the https://github.com/fnf-org[FnF] org, and within it specifically
Please use labels to tag any reported issues.