Rails application that allows you to create and manage conferences. You can use it to create a conference, add speakers and sessions. Attendees can register for the conference, view the schedule, receive notifications and more.
- Requirements
- Ruby 3.3.x (https://www.ruby-lang.org/en/documentation/installation/)
- Bundler (
gem install bundler)
- Clone the repository (
git clone xxx) - Run
bin/setup(needs to be run only once) - Run
bin/dev - Visit
http://localhost:3000in your browser
- Ruby on Rails 8.0
- Ruby 3.3.x
- SQLite3
- SolidQueue
- Hotwire
- Import maps
- Tailwind CSS
- Visit
http://localhost:3000/avo - Log in as an admin (see
config/seeds.rbfor the default admin credentials) - In avo, you can create a new conference, add speakers, locations and sessions
- Visit
http://localhost:3000to see the conference schedule
You can enable features by using ENV variables. The ENV var key should follow the convention "#{feature_name}_ENABLED". For example, to enable the litestream_backups feature, add LITESTREAM_BACKUP_ENABLED=true to your .env file. You can view all the available features in app/models/feature.rb.
This application is set up for deployment using Kamal 2.
Each environment has its own deploy.yml file. Before you deploy, check that these files have the correct values for your environment. If you have already run bin/setup, there should be a .env file for each environment. Just fill in the required variables!
The staging environment can be used for QA before deploying a new version to production.
Your First Staging Deployment
Currently, the staging environment is set up to use AppSignal, MailPace, Avo, and Amazon for storage.Make sure all your environment variables are present in the .env.staging file. Kamal only loads variables from your shell environment (ENV), not from dotenv .env files as discussed here.
You can use the dotenv command before Kamal commands to load variables from your .env.staging file. Check if all variables are present with:
dotenv -f ".env.staging" kamal secrets print -d stagingWhen all variables are present, you can deploy. Important!: You must commit your changes before Kamal picks them up.
dotenv -f ".env.staging" kamal deploy -d staging- AppSignal for monitoring
- AWS S3 for file storage & backups
- MailPace for sending emails
We use Standard Ruby for linting and formatting.
- Run
bundle exec rubocopto check all ruby files - Run
bundle exec rubocop -ato auto-correct offenses - How do I run RuboCop in my editor?
We use ERB Lint to lint our ERB files.
- Run
bundle exec erblint --lint-allto check all ERB files - Run
bundle exec erblint --lint-all -ato auto-correct offenses. WARNING: This command isn't safe and can break your code.
We use StandardJS to lint our JavaScript files.
- Install by running
npm install standard --global - Run
standardto check all JavaScript files - Run
standard --fixto auto-correct offenses - How do I run StandardJS in my editor?
- How do I make the output more readable?
We use Typos as a spell checker.
- Install by running
brew install typos-cli - Run
typosto check all files - Run
typos -wto auto-correct offenses - For false positives and other configuration, see the
_typos.ymlfile
Leftook will execute the linters' auto-fix on staged files and abort the commit if there are offenses that can't be auto-fixed. Run the following commands to enable this flow:
gem install lefthook
lefthook install
Besides code reviews, we use rubycritic to generate a report of the code quality. Both as a reviewer and as a contributor, you should check the report and address the issues found if the files you are working on have a low score ("D" or "F").
- You can run it with
bundle exec rubycritic
We use DatabaseConsistency to check for inconsistencies between the database schema and the application models.
- You can run it with
bundle exec database_consistency.
Run tests by using bundle exec rspec.
- Headless is the default config. If you want to see the browser you can run the following command:
HEADLESS=false bundle exec rspec - If you want to pause the execution you can use
pauseinside anitstatement. - If you want to see the logs you can use
:log, e.g.it "xxx", :log do - Use
data-test-idto find elements instead of classes/ids, e.g.data-test-id="decline_modal" - Use the methods in the
DataTestIdmodule to select HTML elements, e.g.,find_dti("decline_modal")