Skip to content
 
 

Repository files navigation

Simple Server

Build Status

This is the backend for the Simple app to help track hypertensive patients across a population.

Development Setup

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:migrate

To run simple-android app with the server running locally, you can use ngrok https://ngrok.com/

brew cask install ngrok
rails server
ngrok http 3000

The 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.

Testing Email

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
mailcatcher

Now you should be able to see test emails at http://localhost:1080

Configuring

The app can be configured using a .env file. Look at .env.development for sample configuration

Running the application locally

The application will start at http://localhost:3000.

RAILS_ENV=development bundle exec rails server

Running the tests

RAILS_ENV=test bundle exec rspec

Documentation

  • API Documentation can be accessed at /api-docs on local server
  • Architecture decisions are captured in ADR format and are available in /doc/arch

Deployment

simple-server is deployed to the enviroment using capistrano.

bundle exec cap <enviroment> deploy
# eg: bundle exec cap staging deploy

Rake tasks can be run on the deployed server using capistrano as well. For example,

bundle exec cap staging deploy:rake task=db:seed

About

A Rails backend to support the Simple.org mobile app

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages