I want to build a JSON schema builder using the Refine development framework. The…
- User
I want to build a JSON schema builder using the Refine development framework. The builder should be user-friendly with a modern and intuitive design. The project should be implemented in TypeScript with components defined in .tsx files. Here are the key requirements and features for the JSON schema builder:
User Interface (UI) Requirements:
A clean, modern, and responsive UI that is easy to navigate. Drag-and-drop functionality to allow users to easily add, remove, or rearrange schema elements. A sidebar or modal for selecting different types of schema elements (e.g., string, number, boolean, object, array). A properties panel where users can define the details of each schema element, such as title, description, type, default value, and validation constraints (e.g., minLength, maxLength, pattern). Schema Definition Features:
Support for defining all standard JSON schema types and formats (e.g., string, number, object, array, boolean, null). Ability to define nested objects and arrays with their own set of properties and validation rules. Support for advanced JSON schema features such as oneOf, anyOf, allOf, not, if-then-else, const, enum, and $ref for schema references. Live preview of the generated JSON schema as users make changes. Code Structure and Implementation:
Use Refine's components and best practices to build the UI and manage state. Organize the project with a clear folder structure (e.g., components, hooks, utils, pages). Define TypeScript interfaces or types for the schema elements to ensure type safety and ease of maintenance. Implement custom hooks or utilities for common operations like schema validation, state management, and schema serialization/deserialization. Accessibility and Usability:
Ensure the application is accessible and follows WCAG guidelines. Provide tooltips, helper text, or inline documentation to guide users through the schema creation process. Include undo/redo functionality to allow users to revert changes easily. Implement a save/export feature to download the generated JSON schema as a file. Additional Considerations:
Optimize for performance, especially when dealing with large and complex schemas. Ensure the project is well-documented, including setup instructions, component documentation, and contribution guidelines. Consider internationalization (i18n) support to make the builder usable in multiple languages. Outcome: A fully functional JSON schema builder built with the Refine framework that is easy to use, modern in design, and capable of defining detailed and complex JSON schemas. The project should be maintainable, extensible, and accessible to a wide range of users.
- Assistant