The "If It Fits Your Macros" (IIFYM) mentality has become increasingly popular in meal plans and dieting over the past few years, especially within the fitness community. Macros are three main nutrients contributing to calorie-count in a given food: carbs, fat, and protein. Based on one's goals, whether it be weight loss or bodybuilding, people have been adamantly counting macros more than ever. Rather than caring about the individual foods' nutrition values, what matters to many are the end-of-the-day macro counts.

m4cro strives to be a tool to help nutrition enthusiasts meet their goals on-the-go. Whether they are on a road trip, coming home from the gym, or simply tired of the food in their kitchen, m4cro provides a fast way for people to find restaurant food that works with their diet.

What it does

The basic idea of the program is it allows the user to enter the main 3 macros of nutrition. Once they submit, the app will take their location and recommend restaurants and meals based on these three numbers. The meals are ranked by which one is closest to the inputted macros.

How we built it

We built a simple web based application that takes three parameters, one for each macro. The website's front-end was built with HTML and CSS, designed with templates from Material Design Light. The back-end then connected with flask to connect parameters and the results page of the website. The back-end also handled a register and login system, storing user data in a DataStax database. The back-end was coded entirely in python.

Challenges we ran into

No one had web programming experience so two of us learned HTML and CSS. We built everything from scratch so there was a lot of learning experiences for the database, APIs, and other functionality. The biggest issue being the APIs available to us at the time weren't exactly what we wanted to be able to easily implement a search function. If we had access to the MyFitnessPal API like we wanted it would have likely gone much smoother.

Accomplishments that we're proud of

The website looks amazing for first time web developers coding it in around 14 hours. The database and registration system clicked at the end and works exceptionally.

What we learned

We learned how to use DataStax in a short time period even though no one had much experience with databases. Flask was also a new system that we had to learn to use and was surprisingly easy to implement. We definitely have picked up new tools for the future.

What's next for m4cro

We are already working on a few ideas for the future: A tool that combines items from restaurants to create meals, adding the restaurants; With a maximum of three meals per restaurants, this only takes up to O(n^3) runtime, where n is small (the number of meals at a single restaurant); Machine Learning for User Preferences; We plan on training a reinforcement based model based on how far down the recommendation list the user goes for their meal; Machine Learning for General Preferences; As we gain more users, we can use general data mining techniques to learn trends in preferences; For instance, people who like restaurant X also tend to like restaurant Y;

Built With

Share this project: