Skip to content
This repository has been archived by the owner on Mar 9, 2020. It is now read-only.

avindra/phq-demo

Repository files navigation

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

About

🏥 PHQ-9 app built with React, Redux, Koa. Includes React SSR

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published