Caucus is a system to tag/categorize sentences ("claims" in our original use case). It does it by making it fun for users and annoyingly addictive.
- Redis
- PostgreSQL
- Ruby 2.7
- Rails 6
- Yarn for js management
- Duplicate
config/application.yml.exampleand rename toapplication.yml - If you're using Heroku you'll need to set up non-volatile storage (and it's probably a good idea anyways).
The default way is to use AWS S3, during which you'll have to create an IAM user, and put its credentials
in the
config/application.ymlfile. For development and test/CI purposes the local storage is fine. - You'll need a Redis server up and running. For development purposes look up instructions here. This is used for ActiveStorage.
- Set up Postgres, for local and test builds you can run it locally, for production feel free to set it up appropriately for your environment.
- For the moment Mailgun is not necessary, leave the environment variable there though.
- Make sure you're running Ruby 2.7. I like to use rbenv to manage the Ruby versions.
- Install the gems
bundle install - Install javascript requirements
yarn install - Run
rails db:migrateto create the initial database
- Make sure you have a locally running Postgres instance.
- Install Redis and start it up in the background
- In one terminal start up Webpacker's dev server
./bin/webpack-dev-server - Run
rails sin another terminal window to run the server itself. - Visit
localhost:3000to make sure it's working - Create your first user in the Rails console by starting
rails c - Create the user
u = User.create({name: "Test User", email: "test@example.com", password: "password123"}) - Assign the user as an admin
u.add_role :admin - Save again
u.save! - Exit the console and start the server with
rails sagain and go tolocalhost:3000 - Log in with the user created above
Note: This should be a rake task really
- Ensure that
FACT_STREAM_BASE_URIinapplication.ymlis properly set - Enter the Rails console
rails c - Run
FactStreamClient.new.all_fact_checks(true)in the console.
-
Rails 6.0.x is not fully up on Ruby 2.7, so there's a bunch of errors. They don't hurt anything but do muck up the entire logs pretty badly. If you want to also suppress them in dev mode (you do), and use
rbenvto manage your Ruby versions, you can install therbenv-varsplugin, which will automatically apply the.rbenv-varsoptions to any Ruby commands in this folder.Install it by running
git clone https://github.com/rbenv/rbenv-vars.git $(rbenv root)/plugins/rbenv-vars(or if you're using Fishgit clone https://github.com/rbenv/rbenv-vars.git (rbenv root)/plugins/rbenv-vars). It should just work then.
- Uses https://bootswatch.com/journal/ for the theme