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.example
and 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.yml
file. 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:migrate
to 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 s
in another terminal window to run the server itself. - Visit
localhost:3000
to 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: "[email protected]", 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 s
again and go tolocalhost:3000
- Log in with the user created above
Note: This should be a rake task really
- Ensure that
FACT_STREAM_BASE_URI
inapplication.yml
is 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
rbenv
to manage your Ruby versions, you can install therbenv-vars
plugin, which will automatically apply the.rbenv-vars
options 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