See .env.example and fill in the appropriate fields.
SecureRandom.hex(64) is a good way to generate the random strings.
Go to https://dev.twitter.com, get an account and create an application.
This application will act as the Twitter Bot.
Make sure you
-
Set the callback url to http://127.0.0.1:3000 (or wherever you're running the local server)
-
Go to 'Settings', and check "Allow this application to be used to Sign in with Twitter".
-
Check "Details" to make sure these settings have been reflected, sometimes this takes 15 minutes.
-
Click "Create my access token"
-
Fill in the twitter related fields in
.env.example
Change the filename from .env.example to .env.development, the .foreman file will load this development environment by default.
Set up the postgres db, you can change user/pass/dbname in database.yml
$ createuser -s -r twittercoin
$ bundle exec rake db:create
$ bundle exec rake db:migrate$ bundle installTo manage the ENV variables, we use foreman, defined the in Procfile
To run the web server,
$ foreman run webThis actually runs
$ bundle exec puma -p $PORT -e $RACK_ENV -t 0:16To run the worker that listens for incoming tweets,
$ foreman run workerThis actually runs,
$ bundle exec rake twitter:listenPrepend your processes with foreman run if you wish the load ENV variables, e.g. $ foreman run rails c
A big thanks to
Add some Seed data