i think try using an intermediat entity that holds both category keys. by linking reffrenced keys for react and svelte you can later query either way. its a bit more dynamic than static parent-child ties
In developing a flexible and scalable relationship system, consider implementing a separate association model rather than nesting relationships directly in the datastore hierarchy. From my experience, creating an intermediary entity that records associations between categories allows you to manage many-to-many relationships more effectively. This design avoids complications of deeply nested parent-child models and facilitates querying related categories in a simpler way. Although some overhead exists in managing this extra model, the overall maintenance and scalability benefits, especially when expanding category relationships, tend to outweigh the drawbacks.