Code Monkey home page Code Monkey logo

health's Issues

Redesign the dashboard

Redesign the dashboard to show a preview of the selected date, and make the scorecard and checklist list views unnecessary. (See figma sketches)

Create alternative UI for check-in

Show one question at a time, allow sliding right and left (next and previous), and allow keyboard shortcuts to answer questions (0, 1, 2, 3, 4).

Create a README

Rough draft:

Getting started

Install dependencies

  • Install Node v8.x and npm v5.x if you haven't already (nvm or n are create tools for this)
  • Next, install the dependencies from package.json with
    $ npm install
    
  • To keep things easy, install a few global dependencies:
    $ npm install -g webpack knex
    

Set up a local Postgres database

  • Install Postgres if you haven't already (see Installing Postgres via Brew)
  • Optional: Install a Postgres client (see Postico or PSequel)
  • Create a database (this will be your $BLOG_DB_NAME environment variable)
    • Or in SQL, with psql -c CREATE DATABASE [insert_dev_db_name_here];
    • This can either be done with createdb [insert_dev_db_name_here]
  • Optional: Test your database credentials by connecting to the newly created database in your Postgres client
  • Using these credentials, add your database environment variables to your ~/.bash_profile, or wherever you store them. This is required for the knexfile.js
  • Set your $NODE_ENV environment variable to dev, so that the knexfile knows which configuration to use

For reference, my local environment variables look like this in my ~/.bash_profile file:

  # Node environment
  export NODE_ENV='dev'

  # DB credentials
  export BLOG_DB_PORT=5432
  export BLOG_DB_HOST='localhost'
  export BLOG_DB_NAME='blog' # this should match the db you created above
  export BLOG_DB_USER=''
  export BLOG_DB_PW=''

Run the app

Migrate the database, build the client, and run the server:

$ npm start

which is the same as:

$ npm run db:migrate              # Ensures the db is up to date with latest migrations
$ npm run build:react             # Builds the React client
$ node server/javascript/index.js # Runs the Node/Express server

Go to localhost:8000 (or whatever $PORT you set) to check that the app is running.

Development

The current focus of this project is in the server/javascript directory for the API, and the client/reactdirectory for the client.

To simply start the server, run:

$ npm run dev

(TODO: set up nodemon or something similar to prevent the need to restart the server manually to make changes go into effect)

This will serve the contents of the client/react/build directory, which are built with Webpack.

To run Webpack in --watch mode, run:

$ npm run react:watch

And that should be it! Happy hacking ๐Ÿค“

Write more APIs for reporting stats

Some ideas:

  • Average scorecard/depression score on each day of the week
  • Depression score distributions (i.e. how many scores occur in each range)
  • Top tasks on days with lowest depression scores
  • Total points/accomplishments per task category
  • Anything else?

Fix date/timezone inconsistency with db

For some reason there is not always consistency between the date in the db and in the client. Seems like it's probably a timezone issue, or potentially related to the moment library.

Add daily log feature

In additional to the daily check-in and task list, add the ability to write a little bit about each day.

Calculate earnings in reporting dashboard

Based on streaks and number of non-zero days, determine how much a user has earned based on their membership type (default to "Pro" for now).

Pricing might look something like this:

  • Free
    • Free
    • $0.1 per day, $0.3 week bonus, $1 max per week ($52 max per year)
    • $2 month bonus ($24 max per year)
    • $4 3-month bonus
    • $8 6-month bonus
    • $12 year bonus (max $100 for the year)
  • Standard
    • $30 per year cost
    • $0.5 per day, $1.5 week bonus, $5 max per week ($260 max per year)
    • $10 month bonus ($120 max per year)
    • $20 3-month bonus
    • $40 6-month bonus
    • $60 year bonus (max $500 for the year)
  • Pro
    • $50 per year cost
    • $1 per day, $3 week bonus, $10 max per week ($520 max per year)
    • $20 month bonus ($240 max per year)
    • $40 3-month bonus
    • $80 6-month bonus
    • $120 year bonus (max $1000 for the year)

Add eslint/tslint

There are a bunch of minor errors that could be cause more easily with a linter.

Add Daily Dos and Don'ts

This was a great idea from Joe to compile a list of things to do and not to do on a daily basis (reference).

Perhaps in the future could include daily reminders of these lists?

Improve design of scorecard

Customize radio/checkbox inputs, make layout nicer, figure out how to display points in a more elegant way, etc.

Create a simple navbar

Create a navbar to:

  • contain the page title
  • allow navigation back to the dashboard
  • log out

Brainstorm some ways to gamify the app

Ideas:

  • Leveling up
  • "Growing"
    • Starting as a sapling, growing into a tree
    • Starting as an empty field, filling it with plants, animals, home, etc, where each item represents a different accomplishment (e.g. "home" grows with social life, "plants" grow with reading, "sun" shines more brightly with meditation)
  • Small cash prizes for meeting certain goals, or checking in a certain number of days in a row
    • $1 per day that user checks in and has non-zero day
    • Bonus at end of week if user checks in every day of the week
    • Bonus at end of month if user checks in every day of the month
    • Bonus at end of year?
  • What else?

Show more stats in dashboard

(Alternatively, just create an entirely separate view for analytics)

Possible stats to show:

  • Latest productivity streak
  • Latest check-in streak
  • Total tasks completed to date
  • Total points scored to date
  • Anything else?

Stats for reporting:

  • Average scorecard/depression score on each day of the week
  • Depression score distributions (i.e. how many scores occur in each range)
  • Top tasks on days with lowest depression scores
  • Total points/accomplishments per task category
  • What else?

Create an "About" page

Include:

  • The inspiration for the app
  • How the app is meant to be used
  • Credit to "Feeling Good" book for the Depression Checklist
  • (Optional) FAQ

TODO:

  • Write page content in markdown in this issue
  • Create simple React component with the static content

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.