I was thinking all that might be required for this would be to create a meta-data directory based on an appropriate existing adaptive object model pattern / framework, which would be leveraged as an index to the files stored in next cloud (I assume each has some form of referencable primary key?).
In terms of GUI, M-Files tries to look like a folder structure, which I don’t think is necessary. I think having a single data table displaying everything (limits / pagination notwithstanding), where you can add / remove the metadata columns you’re interested in, and then sort / filter them with excel/access style quick filters, would result in a very simple yet powerful querying mechanism that MS Office users should already be pretty familiar with.
Further bells & whistles could be incorporated to give some high-level homing in on relevant object sets in the initial view. E.g. You might have a small number of high-level / common metadata types such as bucket/project and documentType. So you could quickly round down to, say, “all the invoices under project 1”. Then once you’re looking at that dataset, you might do further rounding down by more specific metadata.
They key thing would be in being able to create pretty extensive sets of metadata profiles (type & property sets).