From 4967770c6e4b2cc38b5d6aa6a124d3d96a91f945 Mon Sep 17 00:00:00 2001 From: Jazlene30 Date: Tue, 19 Dec 2023 13:13:46 -0500 Subject: [PATCH 1/4] Fixing up front end and readme file --- Pipfile | 1 + Pipfile.lock | 10 ++- README.md | 28 ++++++++- app.py | 4 +- templates/add_breakfast.html | 11 ++-- templates/add_dinner.html | 9 +-- templates/add_lunch.html | 9 +-- templates/add_snack.html | 9 +-- templates/daily_intake.html | 56 +++++++---------- templates/landing.html | 103 +++++++++++++++++++++++++++---- templates/navbar.html | 2 + templates/nutrition_tracker.html | 2 - templates/progress.html | 9 +++ templates/signin.html | 1 + templates/signup.html | 1 + tests/__init__.py | 0 16 files changed, 185 insertions(+), 70 deletions(-) create mode 100644 tests/__init__.py diff --git a/Pipfile b/Pipfile index af3796e..aa8589f 100644 --- a/Pipfile +++ b/Pipfile @@ -19,6 +19,7 @@ jinja2 = "*" markupsafe = "*" urllib3 = "*" werkzeug = "*" +app = "*" [dev-packages] diff --git a/Pipfile.lock b/Pipfile.lock index d7e1421..0b4f714 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "6605053b2f8f1551601c10a234258116ea5411364527eef793d07e83815845c6" + "sha256": "ff139e4d27573ce7aa28468f0b3aec114143c911256da4d83bc7ad90182730ff" }, "pipfile-spec": 6, "requires": { @@ -16,6 +16,14 @@ ] }, "default": { + "app": { + "hashes": [ + "sha256:214549e746d777292d807eec7713c2cea332e08e037c923cd61ee1d5ab7a127f", + "sha256:88e1df5e4ef0a02e2bf43b7a97a278c074c4d27ecd32684aa1d46d7414ed597c" + ], + "index": "pypi", + "version": "==0.0.1" + }, "blinker": { "hashes": [ "sha256:c3f865d4d54db7abc53758a01601cf343fe55b84c1de4e3fa910e420b438d5b9", diff --git a/README.md b/README.md index 5fd6096..45e5bfa 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # Final Project -Nutrifit is an nutrition tracker used to log a users meals and weight each day and check the progress of weight over time as well as tracking their diet. +#Fitwell Tracker +Fitwell Tracker is an nutrition tracker used for logging meals and keeping track of weight. The app helps people keep track of their diet and the meals they eat on an every day basis as well as seeing how these meals may affect their weight/health. This app is for personal use. # Team Members @@ -14,6 +15,27 @@ Nutrifit is an nutrition tracker used to log a users meals and weight each day a [Ahmed Omar](https://github.com/ahmed-o-324) +# Setting Up + +## Running Locally 1. Clone the repository -2. In the main directory, run ``` docker compose up ``` -3. Navigate to http://localhost:5000 to access the web app. \ No newline at end of file +2. run pip install --no-cache-dir -r requirements.txt +3. run python app.py + + +## Running with Docker (run the following commands) +1. cd 5-final-project-pusheen +2. git pull +3. docker-compose pull +4. docker-compose up + +## Running Tests +1. pipenv install pytest +2. run pytest +3. pipenv install coverage.py +4. run python -m coverage run -m pytest tests +5. run python -m coverage report -m + + +# Digital Ocean - Deployed App +- URL : http://143.198.4.193:5000/ diff --git a/app.py b/app.py index 46b3743..eb975ea 100644 --- a/app.py +++ b/app.py @@ -180,9 +180,9 @@ def progress(): weight_entry = {"date": date, "weight": weight} # Update the user's document with the new weight entry - db.users.update_one({"_id": ObjectId(session['user_id'])}, {"$push": {"weight_logs": weight_entry}}) + users.update_one({"_id": ObjectId(session['user_id'])}, {"$push": {"weight_logs": weight_entry}}) - user = db.users.find_one({"_id": ObjectId(session['user_id'])}) + user = users.find_one({"_id": ObjectId(session['user_id'])}) # Check if the user is found if user: diff --git a/templates/add_breakfast.html b/templates/add_breakfast.html index 184b6ab..aa7519f 100644 --- a/templates/add_breakfast.html +++ b/templates/add_breakfast.html @@ -122,10 +122,8 @@ @@ -170,6 +168,11 @@

Add Breakfast

{% endif %} + + + \ No newline at end of file diff --git a/templates/add_dinner.html b/templates/add_dinner.html index 30f1859..4994dcc 100644 --- a/templates/add_dinner.html +++ b/templates/add_dinner.html @@ -122,10 +122,7 @@ @@ -170,6 +167,10 @@

Add Dinner

{% endif %} + + \ No newline at end of file diff --git a/templates/add_lunch.html b/templates/add_lunch.html index 0e5e4e1..8446cdf 100644 --- a/templates/add_lunch.html +++ b/templates/add_lunch.html @@ -122,10 +122,7 @@ @@ -170,6 +167,10 @@

Add Lunch

{% endif %} + + \ No newline at end of file diff --git a/templates/add_snack.html b/templates/add_snack.html index f8539b1..24a4161 100644 --- a/templates/add_snack.html +++ b/templates/add_snack.html @@ -123,10 +123,7 @@ @@ -174,6 +171,10 @@

Add Snack

{% endif %} + + \ No newline at end of file diff --git a/templates/daily_intake.html b/templates/daily_intake.html index 422faaf..3fb614d 100644 --- a/templates/daily_intake.html +++ b/templates/daily_intake.html @@ -6,32 +6,22 @@ body, html { font-family: 'Poppins', sans-serif; - background: #f4f4f4; + background: #c698c2; margin: 0; padding: 0; - display: flex; - justify-content: center; - align-items: center; - height: 100vh; } .add-container { - max-width: 340px; + width: 100%; background-color: white; padding: 30px 40px; border-radius: 8px; box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.1); margin: auto; - } - - form - { - background: white; - padding: 20px; - border-radius: 8px; - box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); + overflow: hidden; + align-items: center; } h1 @@ -43,32 +33,28 @@ - - - - + {% include 'navbar.html' %}

Daily Intake

- - -
- - - Add Breakfast - Add Lunch - Add Dinner - Add Snack - -
+ + + + + + + + + + + +
- - + + diff --git a/templates/landing.html b/templates/landing.html index 2e9edef..1994acf 100644 --- a/templates/landing.html +++ b/templates/landing.html @@ -8,25 +8,106 @@ - + - - - -
-

Welcome!

+ {% if error %} +

{{ error }}

+ {% endif %} +
- + \ No newline at end of file diff --git a/templates/navbar.html b/templates/navbar.html index 468754d..42c83d6 100644 --- a/templates/navbar.html +++ b/templates/navbar.html @@ -46,9 +46,11 @@