Курс «Профессиональная разработка на Ruby on Rails»
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app
config
db
doc
lib
log
public
spec
vendor/assets
.gitignore
.overcommit.yml
.rspec
.ruby-version
Capfile
Gemfile
Gemfile.lock
Guardfile
README.md
Rakefile
config.ru
dump.rdb
iptables.conf
license
private_pub.ru

README.md

Overview

Underflow is a Questions and Answers platform, built with Ruby on Rails.

Underflow Logo

Technically, it's a StackOverflow clone.

Features

  • Tags
  • Comments
  • Views
  • Votes
  • User profiles
  • Wisywig editor
  • Notifications
  • Badges

Dependencies:

  • Ruby 2.3.6
  • Rails 4.2
  • PostgreSQL
  • Unicorn
  • Faye (based on Node.JS) for pub/sub
  • Thin (for Faye)
  • RSpec
  • Capistrano
  • Redis
  • Sphinx search
  • MySQL (for Sphinx Search)
  • SASS

Installation

Steps:

$ bundle

Create user underflow in PostgreSQL with DB underflow:

$ sudo su postgres
$ createuser -S -d -R -e -l -P underflow

File db/database.yml uses credentials from secrets.yml. it is supposed to be in repository and it should be unchanged. Edit secrets.yml to set your credentials. Keep all secrets inside secrets.yml as it's added to .gitignore.

Create DB, run migrations and seed (if any seeds) for test & development:

$ rails db:setup
$ RAILS_ENV=test rails db:setup

If migrations fail because of hstore:

$ sudo apt-get install postgresql-contrib
$ sudo su postgres
$ psql -d underflow_dev
# inside psql
$ CREATE EXTENSION hstore;
$ \c underflow_test
$ CREATE EXTENSION hstore;

OR $ sudo su postgres -c "psql underflow_dev -c 'CREATE EXTENSION hstore;'"

Usage

Server:

$ spring rails server

PrivatePub:

$ rackup private_pub.ru -s thin -E production

I18n

Fully internationalized with Russian and English languages available.

License

MIT license: See license doc