Skip to content

debtcollective/dispute-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Debt Collective - Dispute Tools

Corporate elites control our government and by extension our lives. They cheat workers, don’t pay their taxes, and then force us into debt for the basic necessities of life: shelter, food, education, and healthcare. We have the power to change this.

Dependencies

You will need to install the following libraries/packages in order for the app to work correctly

Disclaimer

This document is intended to describe in some way the happy path to have everything set after having the Discourse installation ready, if you have any issues please check our FAQ for a faster onboarding. Go to GETTING_STARTED in order to setup your Discourse instance properly.

Installation

  1. Clone this repository
  2. Copy config files and edit them as needed by first running the make config command.

In particular, you may need to edit discourse.apiKey.

Configuration file

In order to add the right value to discourse.apiKey, you need to run your Discourse instance and then:

  1. Login with Admin user
  2. Go to http://localhost:3000/admin/api/keys and create a new API key
  3. Add the new API key to the discourse.apiKey within config file

Enable SSO

You need to make sure your Discourse installation have the following settings propely set otherwise you won't be able to login in this app. You can set these values in the Discourse admin (http://localhost:3000/admin/site_settings/category/all_results?filter=sso)

  • sso allows all return paths: ✅
  • enable sso provider: ✅
  • verbose sso logging: ✅
  • sso provider secrets:
  • create a new item and set:
    • url: *
    • SSO secret: sso_secret (sso_secret is the default value in config.sample.js)

Make sure you can access to "My Disputes" once you build and run this project.

NOTICE: "enable sso" and "sso url" should be unmarked and empty respectively

Enable CORS

On top of the need to run the Discourse server with

env DISCOURSE_ENABLE_CORS=true rails s

Make sure to go to Discourse admin (http://localhost:3000/admin/site_settings/category/all_results?filter=cors) and add a "cors origins" item:

http://localhost:8080

If you access the app using 127.0.0.1 instead, just make sure to check the console and copy/paste the CORS rejected URL that is on the error message.

Run server

Ensure Postgres is running (e.g., with ps aux | grep postgres). And run:

make config-files
make setup

If there is any issue with the command try running separately and review the FAQ file.

  1. Install dependencies yarn
  2. Set up the database yarn utils:resetdb
  3. Run migrations yarn db:migrate
  4. Run seeds yarn db:seed
  5. Build assets yarn build

Once you have run the above commands successfully start the server using yarn start

You can spin up the discourse server (the best instructions).

At this point if you have reviewed the GETTING_STARTED guide and added the admin user you should be able to run Discourse alongside this project and see both apps running properly and with a synced header (once you log into Discourse the Dispute tools app will update its header).

Development

Once you've run the server, in order to being able to enable hot-reload you should open a new terminal tab (while yarn start is running in parallel) and run

yarn watch

Once both task are running together you will be able to make changes and see the updaded code in the browser. http://localhost:8080/

Tip: if your lint remove any debugger; word from the codebase due to our project rules you can use //eslint-disable-next-line in order to being able to set a break point with debugger; keyword.

S3 uploads in development

We use Minio as our S3 compatible object storage for dev environments. Follow the installation instructions in their repo.

mkdir -p ~/.minio/dispute-tools-development
minio server ~/.minio

We use the default Minio configuration.

Powered by

BrowserStack