-
Notifications
You must be signed in to change notification settings - Fork 41
Closed
Labels
priority:high 🚑High priority issueHigh priority issuetype:enhancement 😃New feature or requestNew feature or request
Milestone
Description
Description
Implement multi-tenancy for the Tanam web application to allow managing multiple site contents within a single Firebase project. Each site is identified by a unique site-id
and can be accessed via a URL structure that includes the locale and site-id
. For example, https://example.com/en/oddbit
to manage the "oddbit" site.
Requirements
- Navigate to a site by manually typing the URL in the address bar.
- Ensure each
site-id
can be managed separately with its own content.
Firestore Structure
Organize the Firestore database to support multi-tenancy with the following structure:
/tanam
/{site-id}
/document-types
/article # Document type for articles
/event # Document type for events
/documents
/{id} # Each document contains a field called `documentType`
# that matches an ID of a document in `document-types`
Steps to Implement
-
Firestore Setup
- Organize Firestore collections to reflect the multi-tenant structure, where each
site-id
has its own sub-collections fordocument-types
anddocuments
.
- Organize Firestore collections to reflect the multi-tenant structure, where each
-
URL Structure
- Modify the routing in the Next.js application to include
locale
andsite-id
in the URL. - Ensure that navigating to URLs like
https://example.com/{locale}/{site-id}
properly loads the corresponding site content.
- Modify the routing in the Next.js application to include
-
Content Management
- Implement logic to load and manage content specific to the
site-id
from Firestore. - Ensure that each site can have its own unique set of document types and documents.
- Implement logic to load and manage content specific to the
-
Testing
- Verify that manually typing the URL with different
site-id
s and locales correctly loads the respective site content. - Test scenarios for adding, editing, and deleting content under different
site-id
s to ensure isolation and proper management of each tenant's data.
- Verify that manually typing the URL with different
References
Metadata
Metadata
Assignees
Labels
priority:high 🚑High priority issueHigh priority issuetype:enhancement 😃New feature or requestNew feature or request