Skip to content

Godlikefreq/bbq

Repository files navigation

Description

Application to plan events (with calendar, map, photo-sharing and e-mail notifications).

Supported features

Setup

  1. Required Ruby (v. 3.1.2) & Rails (v. 7) installed on your PC.
  2. Clone application to local PC:
git clone git@github.com:Godlikefreq/bbq.git
  1. Run
bundle install

Database setup

  1. To specify database name, adapter and other parameters for different scopes change it in config/database.yml. Default DB adapter is PostgreSQL (Install PostgreSQL on Ubuntu 20.04).

  2. Make new database (Create DB in PostgreSQL).

  3. Run

bundle exec rails db:migrate

E-mail notifications setup

  1. Create Mailjet account (Registration) and setup new sender.
  2. Make .env file in root directory.
  3. Configure ENV variables:
MAILJET_API_KEY = ******
MAILJET_SECRET_KEY = ******
MAILJET_SENDER = ******
  1. Configure config/environments/production.rb:
config.action_mailer.asset_host = 'http://myapp.example.com'
config.action_mailer.default_url_options = { :host => "myapp.example.com"}

Redis setup

Install and configure Redis (Instruction for Ubuntu 20.04)

Capistrano setup

  1. Configure config/deploy.rb:
set :application, "appname"
set :repo_url, "git@github.com:User/myapp.git"

# Default branch is :master
# ask :branch, `git rev-parse --abbrev-ref HEAD`.chomp

# Default deploy_to directory is /var/www/my_app_name
set :deploy_to, "/home/username/appname"
set :branch, "main"
  1. Configure config/deploy/production.rb:
server "myapp.example.com", user: "username", roles: %w{app db web resque_worker}

set :resque_environment_task, true
set :workers, { "#{fetch(:application)}*" => 1 }

OAuth setup

  1. Create new applications in developers menu VK and GitHub
  2. Configure ENV variables:
VK_API_ID = ******
VK_API_SECRET = ******
GITHUB_ID = ******
GITHUB_SECRET = ******

Run locally

  1. To run application on your local machine run following command in console:
rails s
  1. Open http://localhost:3000/ in your browser.

Deployment

Deploy new versions of application with:

cap production deploy

Live demo of working app

Application here

Sources

  • Powered with Bootstrap 5
  • Made and tested on Ruby 3.1.2 & Rails 7