Date: 2024-01-18
Author: US3R-NETWORK
Status: Draft
Abstract: This RFC proposes to integrate a comprehensive composite management service into the S3 Console, enhancing dApp developers’ ability to create, manage, share, and deploy composite data structures. The solution enables users to initially design and store composite schemas in an S3 centralized database and migrate them to the Ceramic network for sharing and reuse when projects mature.
1. Functional Requirements - Composite Creation & Management
1.1 Centralized Phase
-
Composite Editor: Offer a visual UI/UX for creating, editing, and saving composite schemas to the S3 centralized database.
-
Include a GraphQL Query Builder: Provide an integrated tool that allows developers to easily test GraphQL queries against their defined composite structures. This feature should enable developers to validate query correctness and preview the expected response format before deploying the schema in a production environment.
-
Generate and Download ComposeDB Development Scaffold: Introduce functionality to automatically generate and package runtime definitions compatible with various frameworks or libraries for the created composites. Developers should be able to download these artifacts directly from the S3 Console, including:
- Runtime Definition Files: The generated files will encapsulate the necessary data models and mappings required by application runtimes.
- TypeScript Type Definitions: Accompanying TypeScript type definitions (.d.ts files) to provide strong typing support during development within TypeScript-based projects. (v2)
- ComposeDB Client Generation: Automate the creation and authorization of client-side code to interact with ComposeDB, the underlying data storage layer for composite structures. Developers will be able to quickly generate pre-configured client-side libraries that handle authentication and CRUD operations against the ComposeDB.(v2)
- Standard CRUD Operations Boilerplate: Include ready-to-use code snippets or modules for performing standard Create, Read, Update, and Delete (CRUD) operations on composite data. This feature ensures developers have out-of-the-box functionality to manage their data without having to write custom logic from scratch. (v2)
These additions will empower developers with practical tools for immediate validation and seamless integration of their composite schemas into their applications’ codebase, streamlining the development process and improving developer productivity.
-
Implement version control features to facilitate schema iteration and historical rollback. (v2)
1.2 Decentralized Migration & Publishing
-
Introduce a one-click publishing mechanism to securely upload composite schemas from S3 to the Ceramic network, obtaining a unique identifier (Stream ID).
Composite Model Schema
type Composite @createModel(accountRelation: LIST, description: "Composite information of ComposeDB") @createIndex(fields: [{ path: "name" }]) @createIndex(fields: [{ path: "description" }]) @createIndex(fields: [{ path: "models" }]) @createIndex(fields: [{ path: "revoke" }]) @createIndex(fields: [{ path: "createdAt" }]) @createIndex(fields: [{ path: "modifiedAt" }]) { creator: DID! @documentAccount // Creator's DID identifier version: CommitID! @documentVersion // Current version's Commit ID name: String! @string(minLength: 3, maxLength: 100) // Composite name description: String @string(maxLength: 10000) // Description of the composite models: [StreamID!]! // List of base model Stream IDs composing this composite schema: String! @string(maxLength: 100000) // Graphql Schema for the composite composite: String! @string(maxLength: 100000) // EncodedComposite for the composite runtimeDefinition: String! @string(maxLength: 100000) // Runtime definition possibly including specific logic for parsing, validating, and processing composite data revoke: Boolean // Whether to revoke the public availability of this composite model createdAt: DateTime // Creation timestamp modifiedAt: DateTime // Last modification timestamp }
-
Support setting permissions for schemas published on the Ceramic network and provide options for review processes. (v2)
2. Functional Requirements - Composite Discovery & Deployment
2.1 Composite Explore Page
- Develop a Composite Explore page featuring search tools and detailed listings that help developers find and filter out high-quality, published composite schemas.
- Incorporate rating systems and popular recommendations to promote discovery and usage of top-tier composites.
2.2 Private Ceramic Node Deployment
- Add a one-click deployment feature allowing selected composite schemas to be directly synced to a developer’s private Ceramic node.
- Configure and authenticate private node information to ensure secure deployment.
3. Security and Privacy Protection
- Ensure security measures and privacy protection are implemented throughout all composite operations. (v2)
4. Compatibility and Usability
- Ensure new features are compatible with existing S3 Console services without impacting their stability or user experience.
- Provide thorough usage guides and tutorials to assist developers in making the most of the composite management and service functionalities.
5. References
This RFC focuses on improving the management and sharing of composite data structures within the S3 Console, providing a more convenient and efficient development environment for dApp developers. We welcome community members to engage in discussions and refine this proposal.