Skip to content

Commit

Permalink
MVP! (#111)
Browse files Browse the repository at this point in the history
* Fix/heroku host (#24)

* Create issue_template.md

* Update issue templates

* Update issue templates

* Update issue templates

* make it better

* make it better

* server moved to root; renamed habit-tracker to client; tweaked .gitignore

* indicated static files are where React is

* added heroku-postbuild for React

* Added proxy for express port

* rename require statement to include Habit.js

* renaming Models2 to models

* added path var

* removed build from repo; added to .gitignore

* got rid of favicon.ico refs

* Update README.md

* 🐛 added dotenv files to .gitignore (#27)

* Feature/auth firebase - Google sign-in - 🦄  (#30)

* 🐛 added dotenv files to .gitignore

* 🦎 removed logo

* following firebase tutorial https://blog.bitsrc.io/react-oauth-authentication-with-firebase-dfe0e8c5d0d4

* added back favicon refs to resolve compile errors; button added

* portion of google auth working; scope not working

* google auth working... now have to pass state

* google-auth is working

* fixed up special thanks link

* Travis CI Version 1.0.0 (#33)

* add concurrently to start both server and client locally at the same time

* Fix/css setup merge (#37)

* add google font

* merge conflict

* added files

* header components created

* sample text styles added

* excess files removed

* merged PR #36 locally

* added content to Layout.cs

* merge PR #36

* Newhabit (#42)

* newhabit form version 1.0.0

* attached new habit form to POST request API, and created form validation

* corrected merge conflict

* form component created

* form layout complete

* specified node version in travis.yml (#45)

* Dotenv configuration for backend (#43)

* Packge.json: Run npm install in client folder everytime you run npm install on main app

* Load DB Key from .env

-Added dotenv npm package
-Remove keys.js
-Load DB key from .env file

* Fix/backend routing (#47)

* Create issue_template.md

* Update issue templates

* Update issue templates

* Update issue templates

* added static.json

* Packge.json: Run npm install in client folder everytime you run npm install on main app

* Load DB Key from .env

-Added dotenv npm package
-Remove keys.js
-Load DB key from .env file

* minor change to redo build on heroku

* added express routing code

* removed rubbish from path

* specified client/build/index.html

* routing resolved

* removed testing string

* header componet added

* clean up started, circle styling started

* clean up CSS, circle styled

* google button styling added, css clean up

* Update .gitignore

* imput tags closed

* check-in form added to Router

* pull revisions

* added closing tags for <br> in check-in.js (#53)

* Update check-in.js

extra closing > removed from <br />

* Update habit-tracker-feature.md

* Update habit-tracker-feature.md

* Update habit-tracker-feature.md

* Update habit-tracker-feature.md

* Create habit-tracker-wip

* Update and rename habit-tracker-wip to habit-tracker-wip.md

* Update habit-tracker-wip.md

* Update habit-tracker-wip.md

* Update habit-tracker-wip.md

* Update habit-tracker-wip.md

* Update habit-tracker-wip.md

* Update habit-tracker-bug.md

* Update habit-tracker-bug.md

* Update habit-tracker-feature.md

* Update habit-tracker-wip.md

* Backend Work for Checkin Submission (#67)

* Update Schema to include Array of checkins

* Add API method to complete a checkin for a given habit

* Add functionality to checkin form

- Basically borrowed all the concepts from the New Habit form, albeit with less validation
- Temporarily added Habit field for manual habit ID entry
- Confirmed that it can update habits on the backend

* CSS clean up (#73)

* deleted based on tutorial

* css consulidated to index.css/ parent level

* new habit css cleaned up

* forms using same styling

* making form styles match

* console errors cleaned up

* bug, login not working see if this fixed

* added dashboard.css to index.css

* default page adjusted and styled

* NewHabit Version 2.0 (#71)

* NewHabit Version 2.0

* New Habit 2.1

* Feature/user settings menu setup (#74)

* 🐛 - adding 404 page not found component

Ugly but functional 404 page not found #49

* deleted based on tutorial

* css consulidated to index.css/ parent level

* new habit css cleaned up

* forms using same styling

* making form styles match

* console errors cleaned up

* bug, login not working see if this fixed

* added dashboard.css to index.css

* default page adjusted and styled

* header state

* log out and other buttons moved to header-logged-in

* header google info not showing

* fixed merge conflict

* removed provider (google) name

* commented-out unlink button

* removed heading for 'Connected Social Accounts'

* created footer component; playing with header and layout structure

* testing profile picture in header

* added footer component and HeaderLoggedIn container

* fixed up header format; copied SocialProfileList.css into index.css

* added back logout and unlink buttons for testing

* Fixed syntax error handleUnlinkedProvider; resolve compile errors on className

* 💄  - fixed as per code review

 Changed to h2; removed "404 error" from App.js. #72

* ✨ - added 'Enter New Habit' to header for testing

* 💄  - fixed up initial login screen to show header

* 💄  - moved footer to the bottom

* ✨  - Moved profile picture; fixed up headers

This was a combination of a branch @SaraSweetie was working on earlier; and some other bugs... primary purpose was to move the user's profile picture into the top right corner. The hamburger button is currently not working but all the buttons have been place in the header for testing purposes #40

* New Habit 2.2 added close button (#75)

* GET Request (#81)

* New Habit 2.2 added close button

* GET request to retrieve habit info

* New habit edge (#82)

* New Habit 2.2 added close button

* GET request to retrieve habit info

* removed route for newhabit

* hamburger component created

* state not passing to hamburger menu button

* slide out menu positioned and styled

* Feature/widget calendar (#83)

* ✨  - added react-calendar-heatmap

Added a progress component with now holds the first widget, react-calendar-heatmap. #78

* 🐛  - fixed up the display copying bootstrap ref

* ➕  - added react-tooltip

* ➕  - added ReactTooltip to client

* 🐛  - tweaked footer css; remove bootstrap

* 💄  - made the calendar heatmap a sep component

* 🐛  - fixed spacing on NotFound component (#84)

* Added additional supporting backend methods (#85)

* Countdown timer (#86)

* Added additional supporting backend methods

* Call logged in users first habit instead of hardcoded habit

* Add Current Habit info to dashboard

* Countdown for current habit in dashboard

* pushing progress

* not working

* paired programming props passed down -- working

* New User Functionality (#87)

* New Habit 2.2 added close button

* GET request to retrieve habit info

* removed route for newhabit

* New User Functionality

* clean up unused code

* button styling

* duplicate button deleted

merge conflict from hamburger-menu PR. Duplicate buttons.

* Check in (#91)

* New Habit 2.2 added close button

* GET request to retrieve habit info

* removed route for newhabit

* New User Functionality

* Updated Logic on Dashboard

* Fixed New Habit Entry edge case

* Check in - Responsive Update (#93)

* New Habit 2.2 added close button

* GET request to retrieve habit info

* removed route for newhabit

* New User Functionality

* Updated Logic on Dashboard

* Fixed New Habit Entry edge case

* made check in and newhabit forms responsive

* Header sidebar page added, Login Circle fixed (#95)

* layout circle appearing on log in

* text added to login and footer, footer centered

* user settings page shell created

* User settings linked

* user login info centered

* font awesome library updated, close icon added to logout

* hamburger menu hover color added

* unlink button still needs uncommented and moved

* Check in (#96)

* New Habit 2.2 added close button

* GET request to retrieve habit info

* removed route for newhabit

* New User Functionality

* Updated Logic on Dashboard

* Fixed New Habit Entry edge case

* made check in and newhabit forms responsive

* Update to keep checkins to once per day

* Map habit checkins to calendar values (#97)

* Current habit - fix react error (#98)

* switching branches

* unlink button uncommented, styled

* Feature/cal tool tip (#101)

* ✨  - adding tooltip popup; null values now

Using demo reference https://codesandbox.io/s/73mk9wlyx and npm react-calendar-heatmap doc: https://www.npmjs.com/package/react-calendar-heatmap / https://github.com/okize/react-calendar-heatmap #78

* ✨  - tooltip displays effort in pop-up

used reverse lookup function for effort value object: https://stackoverflow.com/questions/9907419/how-to-get-a-key-in-a-javascript-object-by-its-value #78

* 🎨  - time added but unable to substring

 #101

* Fix formatting on tooltips (#103)

* Make checkins appear immediately (#104)

* Css mobile (#105)

* hamburger button moved for mobile

* header layout for mobile

* sidebar adjusted for mobile because header height adjusted

* circle removed from mobile

* width made responsive % not fixed px value

* Added new CheckiDtail component (#106)

* About Text added, Small CSS changes (#107)

* typo fix, minor wording changes

* about text added, slideout width increased

* log-in page and new-habit module screenshots

* sidebar height adjusted, overflow scrolled added

* heat map font size smaller

* images added to about slideout

* link hover styles added

* screenshots

* Added delete habit button to user settings page (#108)

* Fix/calendar doesnt include today (#109)

* Start calendar 1 day earlier

* Remove unnecessary toDate() call

* Fix minor erros and warnings (#110)
  • Loading branch information
paulywill authored May 5, 2019
1 parent 521ec7c commit 6e41777
Show file tree
Hide file tree
Showing 59 changed files with 2,677 additions and 3,596 deletions.
3 changes: 1 addition & 2 deletions .github/ISSUE_TEMPLATE/habit-tracker-bug.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,4 @@ If applicable, add screenshots to help explain your problem.


## Additional context
Add any other context about the problem here.

Add any other context about the problem her
30 changes: 25 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
### Node ###

package-lock.json
yarn.lock

# misc
.DS_Store
.env
.env.test
.env.local
.env.development.local
.env.test.local
.env.production.local

# Logs
logs
*.log
Expand Down Expand Up @@ -32,6 +45,7 @@ bower_components

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
/build

# Dependency directories
node_modules/
Expand All @@ -55,10 +69,6 @@ typings/
# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

Expand All @@ -78,4 +88,14 @@ typings/
.fusebox/

# DynamoDB Local files
.dynamodb/
.dynamodb/

#---- copied from CRA; client directory ----
# dependencies

/.pnp
.pnp.js




4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
language: node_js
node_js:
- "10"
script: npm test
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
# v8-geckos-team-07
Add-project-description-here | Voyage-8 | https://chingu.io/

# Development Build

https://habit-tracker-gecko-develop.herokuapp.com/
2 changes: 2 additions & 0 deletions habit-tracker/.gitignore → client/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

# misc
.DS_Store
.env
.env.local
.env.development.local
.env.test.local
Expand All @@ -21,4 +22,5 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*
yarn.lock
package-lock.json
File renamed without changes.
11 changes: 10 additions & 1 deletion habit-tracker/package.json → client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,25 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"axios": "^0.18.0",
"firebase": "^5.9.1",
"moment": "^2.24.0",
"react": "^16.8.4",
"react-countdown-now": "^2.1.0",
"react-calendar-heatmap": "^1.8.0",
"react-delay": "^0.1.0",
"react-dom": "^16.8.4",
"react-scripts": "2.1.8"
"react-router-dom": "^5.0.0",
"react-scripts": "2.1.8",
"react-tooltip": "^3.10.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"proxy": "http://localhost:5000",
"eslintConfig": {
"extends": "react-app"
},
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions habit-tracker/public/index.html → client/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
Expand All @@ -13,6 +12,7 @@
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />

<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Expand All @@ -22,7 +22,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
<title>Habit-Tracker</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
}
2 changes: 1 addition & 1 deletion habit-tracker/src/App.test.js → client/src/App.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ it('renders without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<App />, div);
ReactDOM.unmountComponentAtNode(div);
});
});
63 changes: 63 additions & 0 deletions client/src/components/CalHM.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import React from 'react';
import CalendarHeatmap from 'react-calendar-heatmap';
import 'react-calendar-heatmap/dist/styles.css';
import ReactTooltip from 'react-tooltip';
import moment from 'moment';

const effortLookup = {
"skip": 0,
"failed": 1,
"tried": 2,
"completed": 3,
"killed-it": 4
}

// FYI - db date format is 'May 2nd 2019'

const CalHM = ({date, checkins, length, selectCheckin}) => {
// Hack to not have terrible scaling - at least 3 months
const calendarLength = length >= 3 ? length : 3;
return (
<div>
<CalendarHeatmap
startDate={moment(date).subtract(1,'days')}
endDate={moment(date).add(30 * calendarLength, 'days')}
values={checkins.map(checkin => ({
date: moment(checkin.checkinDate, 'MMMM DD YYYY').toDate(),
count: effortLookup[checkin.effort],
dateFriendly: checkin.checkinDate,
effort: checkin.effort
}))}
classForValue={(value) => {
if (!value) {
return 'color-empty';
}
return `color-github-${value.count}`;
}}

tooltipDataAttrs={value => {
const dataTip = value.effort ? `On ${value.dateFriendly} you ${value.effort}` :
`You skipped this day`;
return {
'data-tip': dataTip,
};
}}
showWeekdayLabels={true}
onClick = { (value) => {
if(value) {
selectCheckin(value.dateFriendly);
} else {
selectCheckin();
}
}
}



/>
<ReactTooltip />
</div>
)
}

export default CalHM;
15 changes: 15 additions & 0 deletions client/src/components/CheckInSubmission.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from 'react';

function CheckInSubmission(props){

const showSubmit = props.submit ? 'submission subdisplay-block' : 'submission subdisplay-none';

return (
<div className={showSubmit}>
<h1>Submission Complete</h1>
<button className="okbutton" onClick={props.handleOkClick}>OK</button>
</div>
)
}

export default CheckInSubmission;
18 changes: 18 additions & 0 deletions client/src/components/CheckinDetail.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React from 'react';

const CheckinDetail = ({checkinDate, mood, effort, selfEval, notes}) => {
return (
<div>
<h2>Check-in detail:</h2>
{checkinDate && <p>Date: {checkinDate}</p>}
{effort && <p>Effort: {effort}</p>}
{mood && <p>Mood: {mood}</p>}
{selfEval && <h3>Self Evaulation:</h3>}
{selfEval && <p>{selfEval}</p>}
{selfEval && <h3>Notes:</h3>}
{selfEval && <p>{notes}</p>}
</div>
)
}

export default CheckinDetail
26 changes: 26 additions & 0 deletions client/src/components/CurrentHabit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import React from 'react';
import moment from 'moment';
import Countdown from 'react-countdown-now';

const CurrentHabit = ({_id, habit, length, date, smart}) => {
if(!_id) {
return (<h2>No current habits!</h2>)
} else {
// startDate is a string (for display); endDate is a date object (for countdown)
const startDate = moment(new Date(date)).format("MMMM Do YYYY");
const endDate = moment(new Date(date)).add(length, 'months').toDate();

return (
<div>
<h2>Current habit info:</h2>
<p>Habit name: {habit}</p>
<p>Start date: {startDate}</p>
<p>Smart habits:</p>
<ul>{smart.map(item => <li key={item}>{item}</li>)}</ul>
<p>Duration (months): {length} </p>
<p>Countdown to finish: <Countdown date={endDate} /> </p>
</div>
)}
}

export default CurrentHabit;
Loading

0 comments on commit 6e41777

Please sign in to comment.