Coder Social home page Coder Social logo

tripledub / cdx-1 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from thuylc/cdx

0.0 1.0 0.0 10.44 MB

Connected Diagnostics Platform

Ruby 70.41% Makefile 0.02% HTML 11.13% JavaScript 12.39% CSS 5.91% CoffeeScript 0.01% Gherkin 0.12% Shell 0.01%

cdx-1's Introduction

Dependency Status Code Climate

CDX

Reference implementation for the Connected Diagnostics API (http://dxapi.org/)

Getting Started

CDX Core Server

To start developing:

  1. Clone the repo.

  2. Install dependencies:

  • bundle install.
  • PhantomJS 1.9.8 for Poltergeist (development and test only)
    • Install it in mac with: brew install phantomjs
  • ImageMagick for Paperclip
    • Install it in mac with: brew install imagemagick
  • Redis is used by sidekiq. CDX uses sidekiq as ActiveJob backend
    • Install it in mac with: brew install redis
    • you can start it with redis-server --daemonize yes
  1. Setup development database: bundle exec rake db:setup

  2. Setup test database: bundle exec rake db:test:prepare

  3. Run tests: bundle exec rake (this will run rspec and cucumber)

  4. Start development server: bundle exec rails s

Additionally:

  1. Import manifests: bundle exec rake manifests:load

To create an initial set of tests:

  1. Navigate to the application

  2. Create a new account and sign in

  3. Create a new institution

  4. Create a new site

  5. Create a new device, choosing Genoscan model

  6. Navigate to /api/playground

  7. Select your newly created device

  8. Copy the contents of /spec/fixtures/csvs/genoscan_sample.csv into the Data field

  9. Run create message and navigate to Tests to verify the tests were successfully imported

NNDD

To run notifiable diseases on development, checkout the project and symlink the custom settings files in /etc/nndd on this project:

$ cd $NOTIFIABLE_DISEASES/conf
$ ln -s $CDP/etc/nndd/overrides.js overrides.js
$ ln -s $CDP/etc/nndd/overrides.css overrides.css

Sync Server

In order to allow synchronization of clients through rsyns - for csv files -, you should use cdx-sync-sshd, which is a dockerized sshd container, with an inbox and outbox directoy for each client. Download and build it before continuing.

You have to mount sshd volumes pointing to the folders where you will store your authorized keys, server keys and sync directory. Although sshd-server runs standalone and independently of the cdx server, the cdx server needs to be aware of such directories:

  • SYNC_HOME: here is where files from clients wil be sync'ed. The file watcher will monitor inbox files here
  • SYNC_SSH: here is where authorized_keys file will be stored. The cdx app will write such file on this directory whenever a new ssh keys is added to a device.

By default, the cdx app assumes such directories will point to the tmp directory of the cdp app. Thus, you should start the cdx-sync-sshd docker container this way:

  cd <where you have cloned cdx-sync-server>
  export CDP_PATH=<where you have cloned this cdp repository>
  make testrun SYNC_HOME=$CDP_PATH/tmp/sync \
               SYNC_SSH=$CDP_PATH/tmp/.ssh

Sync File Watcher

Now you must start the sync filewatcher. It is based on cdx-sync-server, but already bundled into cdx app. Run the following:

 cd $CDX_PATH
 rake csv:watch

Now, whenever a new csv file enters the sshd inbox, it will be imported into the cdx platform.

Sync File Watcher - Client Side

In the client side, you will need to run another filewatcher: cdx-sync-client. It is a Windos App. Install it using its NSI installer, restart your computer, and fill the form that will prompt after first restart. You will be required to provide an activation token - you can generate it form the device manager in the CDP app.

Localization Guideline

Using i18n gem. The Ruby I18n (shorthand for internationalization) gem which is shipped with Ruby on Rails (starting from Rails 2.2) provides an easy-to-use and extensible framework for translating your application to a single custom language other than English or for providing multi-language support in your application.

Usage

  1. DO NOT hardcode any text

  2. For any text

2.1. Create/Update one of the corresponding files (based on localization file structure below), depending on where the text appear

2.2. Then update the markup. For example:

  • Instead of using fixed text. Ex: Filter was successfully created

  • We need to use i18n function to support multi-lingual. Ex: I18n.t('filters_controller.filter_created')

2.3. When update any en.yml file, please update all other languages (vi.yml, fr.yml, ...) file correspondingly

Localization file structure

  1. For each language, there are separated files. Ex: *.en.yml and *.vi.yml. EN files are in cdx_core directory and VI files are in cdx_vietnam directory

  2. Controller and helper: there is one file for all

  3. Model and view: there is one file for each model or view

  4. The locale file is organized based on file/module hierachy

cdx-1's People

Contributors

anthonyoleary avatar asterite avatar bcardiff avatar davebluefrontier avatar dsfind avatar flbulgarelli avatar ggiraldez avatar jackregnart avatar jamesmura avatar jorgegorka avatar juanboca avatar juanedi avatar lmatayoshi avatar macoca avatar matiasgarciaisaia avatar mmuller avatar nghipm avatar pmallol avatar shaundobie avatar spalladino avatar tripledub avatar waffle-iron avatar waj avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.