Skip to content

TeaWhen/stargazer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

f6b9a2b · Jun 27, 2014

History

50 Commits
Jun 26, 2014
May 14, 2014
Jun 26, 2014
May 13, 2014
May 13, 2014
Jun 26, 2014
May 14, 2014
Jun 27, 2014
Mar 7, 2014
Jun 27, 2014
Jun 26, 2014
May 14, 2014
Jun 17, 2014
May 13, 2014
May 7, 2014
Jun 26, 2014
May 30, 2014

Repository files navigation

Stargazer

GitHub star management, on web.

Setup

Front-end

  1. Install node
  2. npm install -g bower gulp
  3. npm install and bower install
  4. gulp

Backend

First, set these env vars.

export STARGAZER_CLIENT_ID={github_client_id}
export STARGAZER_CLIENT_SECRET={github_client_secret}
export STARGAZER_COOKIE_SECRET={cookie_salt}
export COUCHDB_ADMIN_PASSWORD={couchdb_admin_password}
  1. Setup front-end first
  2. Install and startup CouchDB, and setup an admin with name starwarden, use the password in env vars.
  3. Install redis
  4. Install rvm and use rvm’s ruby
  5. bundle
  6. Setup meta db with ruby bootstrap.rb
  7. cd into the redis subdir and redis-server redis.conf
  8. Fire up sidekiq with sidekiq -r ./app.rb
  9. Fire up server with shotgun
  10. http://127.0.0.1:9393/

Enabling CORS

To replicate directly with CouchDB, you need to make sure CORS is enabled.

export HOST=http://starwarden:[email protected]:5984
curl -X PUT $HOST/_config/httpd/enable_cors -d '"true"'
curl -X PUT $HOST/_config/cors/origins -d '"*"'
curl -X PUT $HOST/_config/cors/credentials -d '"true"'
curl -X PUT $HOST/_config/cors/methods -d '"GET, PUT, POST, HEAD, DELETE"'
curl -X PUT $HOST/_config/cors/headers -d \
'"accept, authorization, content-type, origin"'