Coder Social home page Coder Social logo

sleep's Introduction

University of Washington sleep study software

This software is developed under the direction of Teresa Ward at the University of Washington.

Start

This software requires a host device with Docker configured and active.

On a bash command line, run:

> git clone https://github.com/uwcirg/tb-mobile-app.git
> ./bin/setup

You may be prompted for an administrator password, depending on how Docker is set up on your device.

If all goes well, your application will start up after a few minutes; you will be able to view the software in a web browser, at the URL http://localhost:3060.

If not, please open an issue here on GitHub.

Query Data

This software is mostly built out of the web browser language Javascript. It does require a small bundle of code running on the host device; about one hundred lines of code total, stored in ./models.

The code packaged for the host device defines the structure of the application's information, as stored on the host device in a PostgreSQL database.

The code makes use of ActiveRecord, originally built to empower Ruby on Rails applications. Comprehensive documentation and question/answer threads are readily available online.

Encrypt Passwords

Passwords are encrypted before they are stored, in order to safeguard against a database breach.

This project uses the Ruby library bcrypt-ruby to secure passwords. Code for storing a password looks like:

participant.password_digest = BCrypt::Password.create("password")

Code to compare a stored password against an attempt looks like:

BCrypt::Password.new(password_digest) == "attempt"

Save Information

It is important to take snapshots of the software's backing database before any maintenance or operation that risks information erasure.

To save the database to a date-stamped file, run:

docker-compose exec db pg_dump -U postgres -F t development > $(date +'%C%y_%m_%d').backup

Restoring a database is a two-step process. You must first place a copy of the backup file into the database container. In this example, tb_db_1 is the name of our database container.

docker cp restore.backup tb_db_1:/usr/src/restore.backup
docker-compose exec db psql -U postgres -d development -f /usr/src/restore.backup

Manage

Finally, a useful list of commands to manage the software can be found in the ./bin/deploy script. If your host or development device doesn't require sudo, please leave it off of the commands.

Some of the commands in the file, especially related to the Apache web server, are specific to the University of Washington deployment under Sarah Iribarren. General docker commands are expected to work in any environment.

sleep's People

Watchers

James Cloos avatar Michael Wright 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.