Code Monkey home page Code Monkey logo

phq-demo's Introduction

phq-9 demo

This is a sample React / Redux application which serves to provide the PHQ-9 depression screener, allowing users to self-assess their depression and get recommended treatment options.

Approach

The approach used here should enable the team working on this app to use JavaScript (including the latest spec), on the entire stack. The application state should be accessible from both client and server code.

This demo uses two packages which are currently in alpha (koa and react-router). This is not a recommended practice for writing code to be used in production. Alpha versions are used here as an exercise of using some of the latest in front end technology.

I have opted out of using the actions/ pattern in redux, in the interest of time.

Features

  • Navigation (go back to edit a question)
  • Good user experience for both the developer and the end-user

Developing

npm run dev

Then start to edit files as necessary. Edits to client side code will auto trigger a browser reload via webpack. Edits to server side code will currently require a manual restart of the web server.

Production run

Production optimizations include:

  • Minification
  • React propType removal
npm start

Filesystem explanation

There are some files used in this project which are non-standard development practices. To prevent confusion, I've documented the purpose of some of these files:

  • build A file containing only the hash of the latest production assets to use (if any)
  • build.js Core wrapper script for webpack.config.js which is used to manage webpack during production builds as well as the normal development process.
  • src/ All core source code
  • src/components React components
  • src/data hardcoded data assets (i.e., the question bank)

Todo

These are some things that can be done to improve the quality of this project:

  • Add animations
  • Improve CSS build process (extract styles into a bundled stylesheet, minify, autoprefix, use preprocessor, etc)
  • Add unit tests + CI

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.