这是indexloc提供的服务,不要输入任何密码
Skip to content

Implement Multi-Tenancy for Tanam CMS #342

@DennisAlund

Description

@DennisAlund

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

  1. Firestore Setup

    • Organize Firestore collections to reflect the multi-tenant structure, where each site-id has its own sub-collections for document-types and documents.
  2. URL Structure

    • Modify the routing in the Next.js application to include locale and site-id in the URL.
    • Ensure that navigating to URLs like https://example.com/{locale}/{site-id} properly loads the corresponding site content.
  3. 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.
  4. Testing

    • Verify that manually typing the URL with different site-ids and locales correctly loads the respective site content.
    • Test scenarios for adding, editing, and deleting content under different site-ids to ensure isolation and proper management of each tenant's data.

References

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions