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.
You will need to install the following libraries/packages in order for the app to work correctly
- Node 8.11.4 (version 10.x.x is incompatible with
hummus
) - PostgreSQL 10.x
- Discourse is our community hub and SSO provider (the latter of which is critical for the dispute tools)
- PDFtk (use this Installer)
- Redis 4.x
- Yarn
- GhostScript (
brew install ghostscript
)
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.
- Clone this repository
- Copy config files and edit them as needed by first running the
make config
command.
In particular, you may need to edit discourse.apiKey
.
In order to add the right value to discourse.apiKey
, you need to run your Discourse instance and then:
- Login with Admin user
- Go to http://localhost:3000/admin/api/keys and create a new API key
- Add the new API key to the
discourse.apiKey
within config file
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
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.
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.
- Install dependencies
yarn
- Set up the database
yarn utils:resetdb
- Run migrations
yarn db:migrate
- Run seeds
yarn db:seed
- 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).
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 withdebugger;
keyword.
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.