Skip to content

Commit

Permalink
Merge branch 'main' into andrewhuanggg-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
fishlesswater authored Dec 19, 2023
2 parents ead9c7f + ce1ba95 commit cf94c7b
Show file tree
Hide file tree
Showing 16 changed files with 192 additions and 76 deletions.
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jinja2 = "*"
markupsafe = "*"
urllib3 = "*"
werkzeug = "*"
app = "*"

[dev-packages]

Expand Down
10 changes: 9 additions & 1 deletion Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 32 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
[![CI/CD](https://github.com/software-students-fall2023/5-final-project-pusheen/blob/main/.github/workflows/python-app-cicd.yml/badge.svg)](https://github.com/software-students-fall2023/5-final-project-pusheen/blob/main/.github/workflows/python-app-cicd.yml)


[![Python application CI/CD](https://github.com/software-students-fall2023/5-final-project-pusheen/actions/workflows/python-app-ci.yml/badge.svg)](https://github.com/software-students-fall2023/5-final-project-pusheen/actions/workflows/python-app-ci.yml)
# Final Project

NutriFit is a handy tool that helps you keep track of what you eat and how much you weigh. It's like a food diary that also keeps an eye on your weight changes. With NutriFit, you can write down every meal and snack, and it'll tell you all about the calories and nutrition in your food. We also incorporated an api, where user can actively check the food's calorie and other information.

#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
Expand All @@ -16,20 +19,40 @@ NutriFit is a handy tool that helps you keep track of what you eat and how much

[Ahmed Omar](https://github.com/ahmed-o-324)

# Set Up in local environment
We have composed everything needed in docker compose. To do that:


# 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.
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/

# Digital Ocean
We have deployed this to digital ocean
Go to [Here](http://143.198.4.193:5000/) to see our web app

# Links to container image


Web app image: https://hub.docker.com/repository/docker/alh8007/
finalproject/general



Mongo image: https://hub.docker.com/_/mongo
4 changes: 2 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
11 changes: 7 additions & 4 deletions templates/add_breakfast.html
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,8 @@
<body>
<!-- Navigation Bar -->
<nav>
<a href="#" class="logo"> Nutrifit </a>
<ul>
<li><a href="{{ url_for('daily_intake')}}">Cancel</a></li>
</ul>
<a href="{{ url_for('daily_intake')}}">Cancel</a>

</nav>

<!-- Add Breakfast Container -->
Expand Down Expand Up @@ -170,6 +168,11 @@ <h1>Add Breakfast</h1>
{% endif %}
</div>
</section>


<footer>
<p>FitWell Tracker &copy; 2023</p>
</footer>
</body>

</html>
9 changes: 5 additions & 4 deletions templates/add_dinner.html
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,7 @@
<body>
<!-- Navigation Bar -->
<nav>
<a href="#" class="logo"> Nutrifit </a>
<ul>
<li><a href="{{ url_for('daily_intake')}}">Cancel</a></li>
</ul>
<a href="{{ url_for('daily_intake')}}">Cancel</a>
</nav>

<!-- Add Dinner Container -->
Expand Down Expand Up @@ -170,6 +167,10 @@ <h1>Add Dinner</h1>
{% endif %}
</div>
</section>

<footer>
<p>FitWell Tracker &copy; 2023</p>
</footer>
</body>

</html>
9 changes: 5 additions & 4 deletions templates/add_lunch.html
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,7 @@
<body>
<!-- Navigation Bar -->
<nav>
<a href="#" class="logo"> Nutrifit </a>
<ul>
<li><a href="{{ url_for('daily_intake')}}">Cancel</a></li>
</ul>
<a href="{{ url_for('daily_intake')}}">Cancel</a>
</nav>

<!-- Add Lunch Container -->
Expand Down Expand Up @@ -170,6 +167,10 @@ <h1>Add Lunch</h1>
{% endif %}
</div>
</section>

<footer>
<p>FitWell Tracker &copy; 2023</p>
</footer>
</body>

</html>
9 changes: 5 additions & 4 deletions templates/add_snack.html
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,7 @@

<body>
<nav>
<a href="#" class="logo"> Nutrifit </a>
<ul>
<li><a href="{{ url_for('daily_intake')}}">Cancel</a></li>
</ul>
<a href="{{ url_for('daily_intake')}}">Cancel</a>
</nav>


Expand Down Expand Up @@ -174,6 +171,10 @@ <h1>Add Snack</h1>
{% endif %}
</div>
</section>

<footer>
<p>FitWell Tracker &copy; 2023</p>
</footer>
</body>

</html>
56 changes: 21 additions & 35 deletions templates/daily_intake.html
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -43,32 +33,28 @@
</style>
</head>
<body>


<nav>
<ul>
<li><a href="{{ url_for('landing')}}">Home</a></li>
</ul>
</nav>

{% include 'navbar.html' %}

<div class="add-container">
<h1>Daily Intake</h1>


<section style="text-align: center; margin: 30px 0;">


<a href="/add_breakfast">Add Breakfast</a>
<a href="/add_lunch">Add Lunch</a>
<a href="/add_dinner">Add Dinner</a>
<a href="/add_snack">Add Snack</a>

</section>
<a href="/add_breakfast">
<button style="background-color: #c698c2; color: white;">Add Breakfast</button>
</a>
<a href="/add_lunch">
<button style="background-color: #c698c2; color: white;">Add Lunch</button>
</a>
<a href="/add_dinner">
<button style="background-color: #c698c2; color: white;">Add Dinner</button>
</a>
<a href="/add_snack">
<button style="background-color: #c698c2; color: white;">Add Snack</button>
</a>

</div>



<footer>
<p>FitWell Tracker &copy; 2023</p>
</footer>

</body>
</html>
Loading

0 comments on commit cf94c7b

Please sign in to comment.