DEV Community

n00bgineer
n00bgineer

Posted on • Originally published at n00bgineer.wordpress.com on

Building a privacy-first health app - update #5

Introduction

Previously, I’d implemented the FoodItemsSearchPage & FoodItemsSearch components. But to make this page fully functional, I completed the services to enable food search from the FDC API, through an API service.

Update

  1. Firstly, I started implementing the the GraphQL definitions for the endpoint in foodItemSearch.sdl.js and a service returning returning dummy data from foodItemSearch.js.
  2. After this, I worked on integrating the foodItemSearch service with the FDC API, but I finally realized why developers love TypeScript, because the FDC API endpoint returned different values for servingSizeUnit (e.g. GRM/grm instead of g, MLT/mlt instead of ml).
  3. I also created the “Load more” button to fetch additional food items through pagination.

Next steps

  1. My implementation for the food item search feature turned out to be extremely buggy, so this is the first thing I need to fix before I move to anything else.
  2. Adding serving size selector to the FoodCard component & adding implementation of mutation to store the items the user has consumed.

Screenshots


Implementing the search feature

Hot sauce if you're wrong - web dev trivia for staff engineers

Hot sauce if you're wrong · web dev trivia for staff engineers (Chris vs Jeremy, Leet Heat S1.E4)

  • Shipping Fast: Test your knowledge of deployment strategies and techniques
  • Authentication: Prove you know your OAuth from your JWT
  • CSS: Demonstrate your styling expertise under pressure
  • Acronyms: Decode the alphabet soup of web development
  • Accessibility: Show your commitment to building for everyone

Contestants must answer rapid-fire questions across the full stack of modern web development. Get it right, earn points. Get it wrong? The spice level goes up!

Watch Video 🌶️🔥

Top comments (0)

👋 Kindness is contagious

If you found this article helpful, a little ❤️ or a friendly comment would be much appreciated!

Got it