This is the backend for the Simple app to help track hypertensive patients across a population.
First, you need to install ruby: https://www.ruby-lang.org/en/documentation/installation/ It is recommended to use rbenv to manage ruby versions: https://github.com/rbenv/rbenv
gem install bundler
bundle install
rake db:create db:setup db:migrateTo run simple-android app with the server running locally, you can use ngrok https://ngrok.com/
brew cask install ngrok
rails server
ngrok http 3000The output of the ngrok command will have an url that can be used to access local-server.
This url should be set as qaApiEndpoint in gradle.properties.
We use Mailcatcher for testing email in development. Please use the following to set it up on your machine.
Note: Please don't add Mailcatcher to the Gemfile, as it causes conflicts.
gem install mailcatcher
mailcatcherNow you should be able to see test emails at http://localhost:1080
The app can be configured using a .env file. Look at .env.development for sample configuration
The application will start at http://localhost:3000.
RAILS_ENV=development bundle exec rails serverRAILS_ENV=test bundle exec rspec- API Documentation can be accessed at /api-docs on local server
- They are also available https://api.simple.org/api-docs
- Architecture decisions are captured in ADR format and are available in /doc/arch
simple-server is deployed to the enviroment using capistrano.
bundle exec cap <enviroment> deploy
# eg: bundle exec cap staging deployRake tasks can be run on the deployed server using capistrano as well. For example,
bundle exec cap staging deploy:rake task=db:seed