/hobbit

Habit tracking app with the aim of turning habit routines into hobbies. Hobbit was built using Express.js and PostgreSQL. It also makes use of JWTs for authentication and authorisation as well as local storage to store session information. Docker is used to containerise the app.

Primary LanguageJavaScriptMIT LicenseMIT

Hobbit

Netlify Status Heroku License: MIT

Studies show that it takes 21 days to form a habit. Hobbit helps you create these healthy routines and turn them into hobbies by allowing you to set habit goals, track your progress, and then motivating you with streaks. Users are able to register for a Hobbit account; upon login they are able to access their dashboard where they can add a customised habit, mark as complete for the day/week (depending on chosen frequency) and see their most recent completion streaks.

Installation

  • Clone or download this repo

Usage

  • Navigate to the root directory of this repository
  • Ensure docker desktop app is running
  • In your terminal run bash _scripts/startDev.sh to start the client, apit and database containers
    • Access: client on localhost:8080/ and server on localhost:3000/
  • Run bash _scripts/startTest.sh to start up the api and database tests
  • Run bash _scripts/stop.sh to close the containers
  • Run bash _scripts/teardown.sh to teardown the containers completely and remove all artifacts

Do not run both dev and test environments at the same time.

Technologies

  • Client side: HTML, CSS and JavaScript
    • Dependencies: html-entities, jest, concurrently, watchify, http-server, jwt-decode
  • Server side: Node.js
    • Dependencies: cors, express, pg, jest, nodemon, supertest, jwtwebtoken, bcrypt, sql-template-strings

Process

  • Discussed the plan for our app using the MoSCoW method
  • Used the GitHub project board to split up the required tasks and assign to team members
  • Designed the basic layout of the webpage on Figma
  • Set up the file structure, initialised database and configured the docker containers/script files
  • Implemented basic CRUD functionality which involved querying the database (although delete function not used in the end due to time limitations)
  • Tested the functionalities of the app (client and server side) and debugged any issues we came across
  • Added styling to improve user interface of the app

Wins & Challenges

Wins

  • Well designed webpage that is largely responsive on desktop, mobile and tablet devices
  • Use of JWT web tokens allowing users to register for an account and login
  • Password matching function which allows user to see if their password field matches with confirmed password field when registering for an account
  • Core functionalities achieved: users able to specify any habit they want to track and choose the frequency, habits can be marked as completed, users can see their streak count
  • Client deployed on Netlify and server on Heroku. In addition there is successful communication between client and server

Challenges

  • Integration testing on routes that are protected
  • Issues with deploying to Heroku when API is connected to database
  • Figuring out the best way to implement the streak functionality

Bugs

  • Sign out button not fixed to the top of habits page (on mobile view)

Future Features

  • Enforce minimum requirements for passwords (e.g. must be at least 8 characters and contain at least one number or special character)
  • Send back an error message to the user if their credientials are incorrect when trying to login
  • Users have the ability to change their credentials
  • Send email alerts to remind user to complete habit or if there streak is about to expire
  • Allow users to edit or delete a habit
  • Implement a page for statistics or graphs so that users can visualise progress

Licence

  • MIT

Collaborators

@HeyAero, @roselynle, @emmanuel-sobamowo, ravil-96, FaisalY12