Unable to Integrate Database with Storefront

I am building a Shopify app using Remix.js and Prisma. I have a database table that stores product information, including whether a product should be restricted or accessible based on certain conditions.

I am struggling with the following:

  1. How can I fetch data from the database and integrate it into the storefront dynamically?
  2. How can I apply specific conditions (like showing or hiding certain product details) in the storefront based on the database values?

What is the best way to approach this integration? Any help or guidance would be greatly appreciated!