Rabble Rouser core is the membership database component of the Rabble Rouser ecosystem. It provides a member sign up form and an administrative backend which allows editing of members.
To find out more about the Rabble Rouser project, check out our documentation repo.
- Install Docker:
-
Start the Docker application.
To verify that Docker is running:
docker info
-
Clone the project:
git clone https://github.com/rabblerouser/core.git
-
Start a Docker container to develop in (this also starts containers for dependent services):
# For macOS and GNU+Linux: ./go.sh # Windows not supported yet :(
-
Set up the Rabble Rouser app:
# Install/compile the project. yarn # Seed the database. yarn seed # Run the test suite. yarn test # Start the app. yarn start
-
Verify that the app works:
-
Register a new member at
http://localhost:3000
-
Log in at
http://localhost:3000/login
, withsuperadmin@rabblerouser.team
/password1234
To run a single command inside the container, rather than interactive mode:
./go.sh yarn test
To watch container logs (e.g. for debugging):
# This will show all container logs, colour-coded
docker-compose logs -f
#This will show just the event-forwarder container's logs
docker-compose logs -f event-forwarder
To restart all containers with a clean slate:
docker-compose stop
docker-compose rm
To pull new versions of the docker images (e.g. kinesis, event-forwarder, etc):
docker-compose pull
If you get sick of typing docker-compose, you might want to add an alias to your .bashrc
file
alias doco=docker-compose
This repository is split into these sub-directories:
bin
: Utility scripts, mostly for build/deploy tasksfrontend
: The frontend React.js web appbackend
: The backend node.js APIe2e
: End-to-end tests built with casperjs (broken right now, ignore them)
The frontend, backend, and E2E tests are all written in JavaScript, so each one has a package.json
file for
dependencies and tasks. There is also another package.json
at the top-level of the repo, which mainly orchestrates the
tasks contained within the sub-projects.
Each of these directories also has its own README file, with more instructions for how to work on its code.
We use ESLint to maintain a consistent style and detect common sources of bugs, and this is run as part of the build
system. To run ESLint just do yarn lint
in one of the frontend, backend, or e2e directories.
To lint just a specific file or directory:
./node_modules/.bin/eslint --ext js,jsx src/path/to/file
You can even add --fix
to the end of that command to automatically fix things like whitespace errors.
If you're not sure how to fix an ESLint error, you can look up the docs for specific rules using a URL like:
http://eslint.org/docs/rules/arrow-parens. In this case, arrow-parens
is the name of the rule.
We're using the airbnb style (slightly modified), which encourages use of many ES6 features. If you're not up to speed on ES6, this reference may come in handy: http://es6-features.org/.