ChillGonzales / MacroMesh

Small web app that uses the hill climbing algorithm to optimize food servings to meet a daily macronutrient budget.

Home Page:https://macromesh.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Macro Mesh

Daily Macro Optimizer

Macro Mesh is a small app that uses the hill climbing algorithm to optimize food servings to meet a daily macronutrient budget.

The app is deployed using AWS Amplify and is hosted at macromesh.app.

Project overview

Macro Mesh is a simple web application that is built using the following tech stack:

No package management, bundling/transpiling, or front end frameworks needed!

Running locally

NOTE: This repo uses a simple python web server to serve files locally. You will need to download and install python 3 to use the local server from this repo. Otherwise, you can use whatever web server you'd like to locally serve files.

In order to run the site locally, simply clone the repository and run the following command from the root directory (using whatever shell you'd like):

python server.py

After that, simply navigate to localhost:8000 to view the app!

Project structure

Front End Logic

All of the front end behavior is accomplished using jQuery and is found in index.html.

Macro Optimization

The hill climbing optimization algorithm can be found in the main.js file. This file takes in an object containing the macro goals of the user and the list of Food objects to optimize servings for. It then returns the same list of foods with the servings optimized for the macro goals.

Dynamic Elements

The elements.js file contains HTML elements that get modified/generated at runtime.

Food Info

The foods.js file contains information about the pre-defined food choices contained in the app. Adding additional objects to this file will automatically expand the food choices available in the app.

Contributing

Simply fork the repo and submit a PR if you're interested in contributing!

About

Small web app that uses the hill climbing algorithm to optimize food servings to meet a daily macronutrient budget.

https://macromesh.app


Languages

Language:JavaScript 54.3%Language:HTML 44.4%Language:Python 1.1%Language:CSS 0.2%