I'm currently working on a local HTML project where I want to display cooking recipes. I'm trying to create a layout using a CSS grid that includes fields like the recipe name, image, and ingredients. The tricky part is that the number of ingredients can vary, and I want to avoid a simple list format like "flour, water, eggs" with their amounts. I was thinking of using two Excel/CSV tables (one for recipes and one for ingredients) and then importing them as JSON to manage relationships with JavaScript. However, I'm uncertain if this is the best approach or if there's a better method than JSON for storing data in CSV/Excel. I've also thought about using a relational database with Node.js, but that feels like overkill. Additionally, I want the structure to be flexible to easily add or remove information, like adding a "recipe history" column without having to manually edit numerous recipes in a JSON file.
1 Answer
It sounds like you have a solid start, but using a database might actually be the way to go, even if it seems like overkill. This allows for easy management and scaling of your recipes if you plan to expand. For quick prototyping, you could also use Google Sheets; you can publish it as a CSV and fetch the data directly in your project. Then, you could render it with JavaScript without much hassle. Just keep in mind that performance can be a concern with this method.
Yeah, I've heard mixed reviews about using Google Sheets. It's probably not the fastest method out there, but for smaller projects, it could work. It would be interesting to dig into where the bottlenecks might happen.