[英]How do I manage 2 Firebase apps connecting to the same project
I have 2 versions of a Firebase app, call them regular and pro, such that users of the regular app interact with those of the pro app, and thusly need access to the same Firestore database and same superset of Firebase cloud functions.我有 2 个版本的 Firebase 应用程序,称它们为普通版和专业版,以便普通版应用程序的用户与专业版应用程序的用户交互,因此需要访问相同的 Firestore 数据库和 Firebase 云函数的相同超集。 The relationship is such that there are a set of cloud functions that the regular app would use exclusively, a set that the pro app would use exclusively and a set that both would use.这种关系是这样的,即有一组常规应用程序将专门使用的云功能,一组专业应用程序将专门使用的一组云功能,以及一组两者都将使用的一组。 The regular and pro apps are different enough to warrant separate projects, and thusly have separate git repositories.常规应用程序和专业应用程序的差异足以保证单独的项目,因此具有单独的 git 存储库。 This is perfectly fine in most situations, but it still has the following problems:这在大多数情况下都很好,但它仍然存在以下问题:
One other note: my app is built with Ionic 4.另一个注意事项:我的应用程序是用 Ionic 4 构建的。
Any suggestions with this are much appreciated.对此的任何建议都非常感谢。
The regular and pro apps are different enough to warrant separate projects, and thusly have separate git repositories.常规应用程序和专业应用程序的差异足以保证单独的项目,因此具有单独的 git 存储库。
It honestly sounds like this choice is causing you problems, so I'd recommend reconsidering.老实说,这个选择听起来会给你带来麻烦,所以我建议你重新考虑。
If both apps make calls against the same backend (Cloud Functions + security rules) then the backend for both apps should be stored in a single place at least.如果两个应用程序都针对同一个后端(云功能+安全规则)进行调用,那么两个应用程序的后端至少应该存储在一个地方。
The apps themselves could be in separate repositories, but I'd probably just put them as subdirectories in the same rep as the backend too.应用程序本身可以位于单独的存储库中,但我可能只是将它们作为子目录放在与后端相同的代表中。 For example in a top-level structure like this例如在这样的顶级结构中
app
regular app files go here
pro
pro app files go here
rules
security rules go here
functions
cloud functions code goes here
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.