Open source symptom monitoring software for COVID-19.
Special thanks to all of our contributors 🍻
.tool-versions
for the specific versions/client
for frontend specific requirements/cordova
for iOS and Android specific requirementsFor Ruby and Node, we recommend using a manager like rvm
, rbenv
, nvm
. I prefer to
use asdf since it covers both and will respond to version changes
in .tool-versions
=. If
For Postgres and Redis, we recommend you install them using Homebrew on macOS or a Linux package manager of your choice.
After you've installed the above and, run the following to install all the Ruby dependencies and load the database with seed data.
Run bundle install
to install all of the packages listed in the Gemfile.
To set up the database, you should only need to run the following:
bundle exec rake db:create
bundle exec rake db:migrate
bundle exec rake db:seed
If you ever need to restart everything in the db from scratch, run bundle exec rake db:nuke
.
cd client && npm start
to start the frontendbin/rails s
to start the API serverbundle exec sidekiq
to start the workerbundle exec rspec
to run the API test suiteTo access emails, install mailcatcher and visit http://localhost:1080. If you're on a Mac, you may have installation issues. Use the following line to install it:
gem install mailcatcher -- --with-cflags="-Wno-error=implicit-function-declaration"
TODO: We should consider migrating everything to HTTPS to keep production and development more similar.
This is extremely important. Due to a number of CORS issues, you'll need to access the app through a subdomain rather than through localhost.
The configurations are set up so that you can:
I highly recommend that you use these addresses. You can alternatively modify your /etc/hosts
file
to pick your own URL and set the appropriate environment variable your .env.local
file.
If you don't want to have to type in ports, you can use the NGINX configurations avaiable at
nginx-development.conf
to proxy requests to those addresses.
Speaking of .env
files...
We use .env
files across both the backend and frontend for configuration during development and test.
The production environments use Heroku's built in environment configuration.
.env.local
: This is where you can put your own overrides, these should not be committed. This overrides everything..env.development
: This is where configuration for development goes..env.test
: This is where configuration for test goes.TODO: We should consider migrating to Rails secrets management so that we can share configurations for testing production-like endpoints that use all our third-party services.
If you look through the .env.development
file, you'll find comments on what these variables mean.
These variables are validated in config/initializers/001_environment_variables.rb
. The app should blow
up if things aren't set up properly.
npm run cordova-init
to install cordova platform and pluginsnpm run run-cordova-ios
or npm run run-cordova-android
to run the mobile appThere are a few other useful commands in the root package.json
too.
We don't really care what editor you use for as long as you follow the coding conventions imposed by Rubocop and eslint. If something really annoys you, talk to Faraz. He's probably fine with disabling it.
You should try to have the following plugins in whatever editor you choose to use:
Visual Studio Code is recommended with the following plugins:
If you're coming from Sublime, this extension might come in handy.
If you're using VSCode, you should use the workspace specific configurations provided in this repo.
Prefix your comments with the following when an action item needs to be taken.
Prefix your commits with the following so we know what's happening. We aim to follow Conventional Commits
For commits associated with releases (e.g. the CHANGELOG update) use the following format:
Feel free to change the emoji.
We have a short URL that is used to help access the app using text messages. It's available across all of the environments:
This variable is set using the SHORT_URL environment variable.
Greenlight is published under the GNU General Public License v3.0. Alternative licensing is available for charge. Please contact faraz at greenlightready.com for details.