I'm working on a front-end application where I need to display a list of projects for a user. Each project contains a lot of data.
For my list view, I'm aiming to:
- Fetch only essential metadata for each project, enough to identify the project to the user.
- Avoid loading the full data for all projects initially to ensure faster loading and to save on bandwidth.
Then, when a user clicks on a specific project from the list:
- I want to fetch the complete detailed data for that single project.
I'm using Firebase Firestore as my database.
My idea is to add a subcollection with one document with the detailed data:
projects (collection)
|
|-- projectId1 (document)
| |-- title
| |-- description
| |-- createdDate
| |
| |-- details (sub-collection)
| |
| |-- detailId1 (document)
| |-- fullDescription
| |-- images
| |-- ...
|
|-- projectId2 (document)
...
Has anyone implemented a similar pattern? What's the best approach to achieve this? Any suggestions or best practices would be much appreciated!