Calorie Control Update

Hello everyone! 

It's been about a month since I launched the app and the response has been incredible. As of today, we've reached over 1,100 users! Not bad. I've gotten tons of supportive emails and ya'll seem to enjoy what I'm up to. Thanks for the kind words and ideas, they inspire me to keep going!

One thing I heard quite often though was something along the lines of "I'd use this... if it had a calorie control system". Well, now you do! You can now set a calorie range between 1300 and 2600. The ability to go higher than 2600 will come later, as right now I simply don't have enough high calorie recipes in the system to successfully generate them.  With this feature in place, I feel the app is more ready than ever for prime-time and I'm going to spend a bit more time focusing on getting the word out, marketing etc. I think 1,100 users is just scratching the surface really. If you know any youtubers/bloggers/etc that might support my mission to provide free evidenced based meal planning to the public, please do let me know!

In sterotypical developer fashion, I thought the calorie control system would be a pretty easy, one week addition. Of course it wound up taking about 3. Initially I tried a bunch of different approaches to building recipe combinations that work for a given calorie range and still sufficiently meet all the daily dozen categories. I eventually gave up on that as I realized it was essentially a multi-dimensional bin-packing problem, and as I intend to add even more options later on (max prep time control, maybe other nutrient control, etc), it would only have MORE dimensions over time.

Eventually I settled on pre-calculating the stats for EVERY SINGLE possible 3 recipe combination (day) of the meal plan. That way I can simply select days that work for the given calorie range (and other future options) instead of trying to pack a crazy box. The only downside to this combinatorial approach is that it can get out of hand pretty quickly... for the current 153 recipes it's ~585K combinations, for 500 recipe it's ~21M combinations, and 1000 it's ~166M, and so on. So I'm essentially setting a hard cap on the number of recipes in the system as eventually I won't be able to scale to the number of combinations as it overwhelms any hardware I could throw at it. That's ok though, 166M combinations is do-able and 1000 recipes is essentially a lifetime's worth.

I needed to get my hardware to a place where I can routinely calculate hundreds of thousands or millions of recipe combination stats in a reasonable timeframe without crashing my servers, which was a fun exercise in learning about AWS hardware, scaling settings, etc. But now I've finally got a handle on it.

If you haven't already, consider becoming a patron - my mission is to apply the lessons of nutrition science to a meal planning algorithm and provide it to the public for free, so that people can live healthier lives. With your support, this is only the beginning. Thank you.

You can check out my latest dev vlog covering the development of this update here: