GithubHelp home page GithubHelp logo

kooya3 / habit-tracker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alicja1bobko/habit-tracker

1.0 0.0 0.0 9.56 MB

sprout | Habit Tracking motivational app

Home Page: https://habit-tracker-tawny.vercel.app

JavaScript 7.96% TypeScript 89.41% CSS 2.63%

habit-tracker's Introduction

Sprout

About

Sprout app helps you keep track of your habits 💪 I took inspiration of this beautiful UI design by Anastasia Shorohova.

Links

Live Site URL

My process

Features

  • create an account with email and password
  • Facebook, GitHub, Google authentication
  • guest account prefilled with data to play around with application features
  • add, delete, update habits
  • mark habits as completed
  • week and month progress visualized in calendar
  • week overview pie charts in carousel
  • brief statistics section with current goals, how many habits achieved today and best streak
  • upload custom avatar image

Built with

Screenshots

  • Landing Page

Landing Page

  • Sign in using Facebook, GitHub, Google or as Guest

sign-in page

  • No Habits Page

no-habits page

  • Add Habit

add-habit page

  • Manage your habits - edit, delete

manage habits page

  • Habit Dashboard

Habit Dashboard

  • Settings

settings page

What I have learned

I have learned a lot of new things while building this application. It was my first bigger application, so a lot of problems and new challenges occurred. I have learned Authentication with Firebase, signing up/signing in process. Also realtime Firestore DB was a bit of a challenge to set up and structure data in logical documents/collections shallow object. I've also used Firestore Cloud to upload images.

A big challenge was to control the asynchronism of function execution and maintaining the current state of variables available for the whole application.

I also learned more about git, branching, merging and maintaining codebase.

It was my first time using Material-UI. Now I think pure tailwind components or Flowbite library would have been a better choice, because it was a lot overriding styles with such a custom design. I've also gained confidence in building more sophisticated and complicated UI components and Responsive Layouts.

Database structure

{
    "users": {
        "user-id": {
            "habits": {
                "habit-one":{
                    "name": "Wake up at 6am",
                    "description": "Wake up 1 hour before normal wake up time for mindful activities",
                    "frequency": [0,1,2,3,4]
                }
            },
            "checkmarks": {
                "checkmark-id": {
                    "completed": false,
                    "date": "19-04-2023",
                    "habitId": "habit-one"
                }
            },
            "settings":{
                "settings-id":{
                    "email": "[email protected]",
                    "firstName": "John",
                    "lastName": "Doe",
                    "password": "sdfsgagrmj1!",
                    "image": "https://firebasestorage.googleapis.com/v0/b/habit-tracker-app-pf.appspot.com/o/image%2Fimages.jfif?alt=media&token=6a109c8c-f176-40ee-97b2-328e75440d03"
                }
            }

        }
    },
}

Getting started

Clone repo and install all dependencies

git clone https://github.com/alicja1bobko/Habit-Tracker.git

cd habit-tracker
npm install

Connect Firebase

Next step it to add Firebase to your project. You can follow the steps in this link, or this short instruction:

  1. Login to Firebase.

  2. Add new project.

  3. Create Realtime Database in Firestore Database panel

  4. In Authentication panel go to Sign-in method tab, then add Sign-in providers: Email/Password, Google, Anonymous, Facebook and Github. For the last 2 you’ll have to get Client IDs and secrets from these services.

  5. In Project Overview Panel add a web app.

  6. You should see a firebaseConfig similar to this:

    const firebaseConfig = {
      apiKey: "<YOUR_API_KEY>",
      authDomain: "<YOUR_AUTH_DOMAIN>",
      databaseURL: "<YOUR_DATABASE_URL>",
      projectId: "<YOUR_PROJECT_ID>",
      storageBucket: "<YOUR_STORAGE_BUCKET>",
      messagingSenderId: "<YOUR_MESSAGING_SENDER_ID>",
      appId: "<YOUR_APP_ID>",
      measurementId: "<YOUR_MEASUREMENT_ID>",
    };
  7. Create .env.local file and use config above to fill it out.

  8. Start the application with npm run dev. The app should be running at: http://localhost:3000


This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).

habit-tracker's People

Contributors

alicja1bobko avatar

Stargazers

 avatar

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.