Skip to content

ollej/brewnit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Brewnit

A site to upload, view, and edit beerxml recipes.

Related resources

Recipe sites

Recipe applications

Requirements

This application needs the following:

  • Ruby v3.0.2
  • Postgres v9.6
  • Docker for development environment

Docker

Use docker to setup a local development environment.

Step 1 - Build

docker-compose build

Step 2 - Start

docker-compose up

Step 3 - Create database

docker-compose run web rake db:create

Step 4 - Run database migrations

docker-compose run web rake db:migrate

Step 5 - Create config

Add the following to a file called .env.development.

DEVISE_PEPPER: changeme
GOOGLE_CLIENT_ID: changeme
GOOGLE_CLIENT_SECRET: changeme
SECRET_KEY_BASE: changeme
WEB_CONCURRENCY: 3
PUSHOVER_USER: changeme
PUSHOVER_TOKEN: changeme
PUSHOVER_GROUP_RECIPE: changeme
PROJECT_HONEYPOT_KEY: changeme
SMTP_PASSWORD: changeme
INKSCAPE_PATH: /usr/bin/inkscape
INKSCAPE_VERSION=1
DEVELOPMENT_HOST: yourcomputer.local
SLACK_SIGNING_SECRET: changeme

Development mode

Run bundle exec rake secret twice and add them to the .env.development where it says 'changeme' (SECRET_KEY_BASE and DEVISE_PEPPER).

Google authentication

For the Google signin support, you need to create credentials on the Google Developers console and add client_id and client_secret to the .env.development

https://console.developers.google.com

reCAPTCHA

The reCAPTCHA supports needs a site_key and secret_key: https://www.google.com/recaptcha/admin

Pushover

The Pushover integration needs keys from https://pushover.net/

Project Honeypot

Project Honeypot is used for spam protection. A key can be obtained from: https://www.projecthoneypot.org/

SMTP password

For mailers to work, an SMTP password needs to be configured in smtp_password.

The SMTP server and user_name is hardcoded in config/application.rb

Inkscape

If you have inkscape installed, you can set INKSCAPE_PATH to use inkscape to generate beer labels when creating the beer label pdf.

For production mode

Create a file called .envrc in the project root directory with the environments below.

.envrc contents

DEVISE_PEPPER=changeme
GOOGLE_CLIENT_ID=changeme
GOOGLE_CLIENT_SECRET=changeme
RACK_ENV=production
RAILS_ENV=production
SECRET_KEY_BASE=changeme
WEB_CONCURRENCY=3
PUSHOVER_USER=changeme
PUSHOVER_TOKEN=changeme
PUSHOVER_GROUP_RECIPE=changeme
PROJECT_HONEYPOT_KEY=changeme
SMTP_PASSWORD=changeme
RECAPTCHA_SITE_KEY=changeme
RECAPTCHA_SECRET_KEY=changeme
SPAM_IP=space separated list of IP addresses to block
INKSCAPE_PATH=/usr/bin/inkscape
SLACK_SIGNING_SECRET=changeme
SPAM_COUNTRIES=space separated list of countries to block registrations from

Manual installation

Ruby installation

If you don't have Ruby, here is a short primer:

Application

Basically just clone the Github repository and run bundle install.

$ git clone https://github.com/ollej/brewnit.git brewnit
$ cd brewnit
$ bundle install
$ createdb brewnit_dev
$ bundle exec rake db:migrate

Run bundle exec rake secret twice and add them to the config/secrets.yml where it says 'changeme' (secret_key_base and devise_pepper).

For the Google signin support, you need to create credentials on the Google Developers console and add client_id and client_secret to the config/secrets.yml

https://console.developers.google.com

Start server

Start the web server with the following command.

$ bundle exec rails s

Useful commands

Regenerate favicon files

rails generate favicon

Attributions

How to Contribute?

It's easy, just follow the contribution guidelines.

About

A website to build and share homebrew recipes

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published