Twit-arr is a micro-blogging site that is set up for the JoCo Cruise Crazy
Ruby CoffeeScript HTML CSS Other
Permalink
Failed to load latest commit information.
app Fixes 284 - I know nobody will ever notice on mobile but it makes me … Feb 19, 2017
bin Updated to Rails 4.2. Resolves #228 Feb 15, 2015
config Events are now editable Feb 19, 2017
db add a db seed that imports/updates events Feb 16, 2016
lib The imagehelper library I wrote to help with animated photos. Dec 1, 2014
log Added the rest of the rails files... :( Aug 13, 2013
photo_storage Lets keep this directory to make the photo path more noticeable. Dec 1, 2014
public emoji display support Jan 26, 2016
test #125 - First stab at hashtag autocomplete Dec 22, 2014
vendor/assets Events actually work now! Only thing that's really missing is event e… Jan 24, 2016
.dockerignore running twitarr on windows (in docker) Dec 19, 2015
.generators Fiddling Jun 30, 2014
.gitignore add production data seed Jan 18, 2016
.rakeTasks Model refactor to abstract redis Sep 8, 2013
.ruby-version Added .ruby-version file. Just for sake of development Feb 22, 2015
Dockerfile rename start.sh to start-docker.sh Jan 9, 2016
Gemfile add a db seed that imports/updates events Feb 16, 2016
Gemfile.lock add a db seed that imports/updates events Feb 16, 2016
LICENSE.txt Fixed #97 - added GPL Feb 1, 2014
README.md Updated readme to reflect secret key generation Dec 30, 2016
Rakefile "rake test" now runs all tests Sep 27, 2013
color-palette.txt Improved styling Jan 4, 2015
config.ru Updated to Rails 4.2. Resolves #228 Feb 15, 2015
docker-compose.yml rename start.sh to start-docker.sh Jan 9, 2016
multicast_server.rb Give the multicast client a few ms to start listening, seems safer/mo… Feb 27, 2015
multicast_test_client.rb Added first multicasting service discovery daemon and test client. De… Feb 27, 2015
perf_test.rb Search results is starting to look really good. Need to extend interf… Dec 27, 2014
rest_documentation.md change the funky author+mentions thing to be a boolean (include_author) Feb 7, 2016
start-docker.sh rename start.sh to start-docker.sh Jan 9, 2016

README.md

twitarr

Twit-arr is a micro-blogging site that is set up for JoCo Cruise Crazy

Description

Twit-arr was the name for the Status.net instance brought onto the cruise ship for JCCC2 and JCCC3. Status.net being less than optimal for this environment, I took it upon myself to build a new version, completely customized for the cruise. It does help that I wanted to have a chance to use Ember.js and Mongodb in production.

Setup

Mongo

You will need to make the config/application.yml and config/mongoid.yml files. There's already an example with some good defaults in config/*_example.yml, you just values for your instance. You can generate a rails secret token using the command "rake secret".

This was originally compatible in both MRI and JRuby - in theory it still is although it might require a little effort to get the image gems working in both. Anyone who wants to put in the effort is welcome to.

Quick Developer Setup

Prereqs

You require java version 1.6+ in order to use this.

Then you will need jruby installed. The easiest way to do this is to install it via RVM.

To install RVM run:

  $ \curl -sSL https://get.rvm.io | bash -s stable

Then install jruby via RVM:

  $ rvm install jruby

Then in the future terminal sessions, you can use rvm use to set the terminal session enviorment to jruby:

  $ rvm use jruby

You will also need to download and run Mongodb

Since I like to keep my database just for this project, when I execute the mongod process I run:

 $ mkdir -p temp/data/db && mongod --dbpath temp/data/db

This will create the mongo database within this project's temp directory. The temp directory is also explictly ignored in the .gitignore file, so you don't have to worry about checking it in.

Project setup

First you will need to run:

  $ bundle install

Remember to set up your secrets file: (http://guides.rubyonrails.org/v4.2/upgrading_ruby_on_rails.html#config-secrets-yml)

Then you will need to setup mongo:

   $ cp config/mongoid-example.yml config/mongoid.yml

Now you have to tell mongoid to create the required indexes. If you forget to do this you will get strange errors that claims you must have indexes created in order to perform text searches.

  $ rake db:mongoid:create_indexes

Now you can seed the database with some initial data:

  $ rake db:seed

This will create 3 users. Each of the users' password is the same as their username.

  1. kvort (an admin user)
  2. james (a non-admin user)
  3. admin (another admin user)

Now we can finally run the rails server. By default this server can be hit from http://localhost:3000

  $ rails server

Docker setup

If you're not running on linux, or just want an isolated environment, you can run twitarr in docker.

Prereqs

You'll need docker, docker-machine and docker-compose download docker-toolbox. I used version 1.9.1

The setup may automatically setup a docker virtual machine, or you create one with docker-machine. Ultimately you'll want to set up your environment so docker images runs without errors.

steps

  1. Build and run
   $ docker-compose build
   $ docker-compose up

This can take 10 minute to set up, as it generates indexes and seed data in mongo. Once it completes you can reach twitarr via http://{docker_ip}:3000 - for me on windows that's http://192.168.99.100:3000/