Skip to content

Simple application to map habits. Built with Ionic, Angular, NestJS, Postgres, Docker, and AWS.

Notifications You must be signed in to change notification settings

Daymannovaes/habit-mapper-app

Repository files navigation

habit-mapper-app

Simple application to map habits based in Judson Brewer's research.

You can check it in the url https://knowyourhabit.com

Know Your Habit icon

gpsu

Run

# install all dependencies
yarn install

# setup database
cd infrastructures

yarn database:start:dev
yarn database:migrate:create
yarn database:migrate up

# setup aws amplify (for authentication flow)
yarn amplify:pull # choose aws as src dir

cd ../

# serve api and frotend in localhost
yarn start

Build

# construct a docker file
yarn build:api
#run the dockerized api in port 5000 and env file .env.production
yarn run:api:prod

User Stories

  • As an User, I want to understand my habits, so I can change them for a better one
    • User can map a habit and input the trigger, the behavior and the reward
  • As an User, I want to understand many habits, so I can focus on the worse one to change
    • User is somehow incentivized to map a lot of habits
  • As an User, I want to view my previous mapped habits, so I can recall what I did
    • authentication and persistence
  • #todo As an User, I want to create a strategy to change a bad habit, so I can have a better life

Data Model

  • User

    • can authenticate
    • has many Habits
    • has many Habit Strategies
  • Habit

    • trigger
    • behavior
    • reward
    • createdAt
    • updatedAt

#todo Habit Strategy

  • Habit To Be Changed
  • ... trigger, behavior, reward strategies etc.

Technology Stack

  • Ionic
  • Angular
  • NestJS
  • Postgres
  • Docker
  • AWS
    • ECS for dockerized server (service atacched with an app load balancer)
    • App Load Balancer, targeted to EC2 instances deployed by ECS
    • AWS Amplify pipeline to build and host frontend
    • Route 53 knowyourhabit.com -> Amplify, api.knowyourhabit.com -> Load Balancer
    • RDS for postgres

Layout

  • First screen
    • Onboarding: do you know habits work? Yes or No
    • Onboarding: if no, do you want to learn?
  • Second screen
    • Map a habit
  • Third screen
    • Login so you can track you new mapped habit
  • Fourth screen (tabs)
    • Tab 1: list of habits
    • Tab 2: create a new habit
    • Tab 3: account and preferences

URLs

  • /onboarding
  • /onboarding/learn
  • /onboarding/do
  • /login
  • /habits
  • /habits/create
  • /habits/:id
  • /habits/:id/edit

App Skeleton Steps

assss

  • Navigation
  • Business rules implementation (without persistence, raw HTML, without CSS)
  • Business rules with persistence
  • Design & UX implementation

token: env.token