Author: David Okononfua, a contributor to Google Summer of Code 2024
Project Overview
The Accord Project Template Playground is a crucial tool for developers and legal professionals to draft, test, and experiment with smart legal contracts and Accord Project functionalities in a user-friendly and interactive environment.
The primary objective of this project was to modernise and enhance the Template Playground by delivering a user-friendly interface, integrating educational resources, and improving data management features. The project was driven by the need to create a more engaging, efficient, and powerful tool that could cater to a wide audience, from novices to advanced users.
Pre Development
Before starting development, I dedicated time to understanding the Template Playground’s architecture and its dependencies. This involved exploring key dependency-libraries that are central to the project’s functionality, such as:
- Markdown-Transform: Essential for converting markdown content.
- Concerto Core: For data modelling and validation.
- Markdown-Template: Facilitates template creation and manipulation.
- Template-Engine: Powers the dynamic execution of templates.
This foundational knowledge equipped me to contribute effectively to the project.
Technology Stack
During development, I transitioned the project from Semantic UI to Ant Design for a more modern and actively maintained design system. Key technologies used include:
- Monaco Editor: Integrated as the code editor within the Playground.
- Zustand: Lightweight state management.
- React-Shepherd & Shepherd.js: For creating guided tours.
- LZ-String: Enabled shareable encoded URLs for user templates.
- React-Markdown: Rendered markdown content in the app.
These tools were selected to enhance both the functionality and user experience of the Template Playground.
Work Done
Key Goals:
- Modernize Experience: Introduce a responsive, visually appealing design that aligns with the Accord Project’s branding while enhancing usability.
- Data Persistence & Sharing: Implement features to save and share templates through encoded URLs, allowing users to collaborate and share their work seamlessly.
- Integrated Learning Resources: Develop a structured learning pathway within the Playground, guiding users through template drafting and usage of Accord Project’s tools like TemplateMark and the Concerto Model.
- Enhanced Functionality: Improve the core features, including TemplateMark for templating, the Concerto Model for data management, and robust data preview capabilities.
Fig 2: Playground Development Project Scope
Design and Implementation
Responsive UI/UX Design: The first major task was redesigning the user interface to improve usability and ensure it was in line with modern design standards. The overhaul included:
- Redesign of Core Components: The navigation bar, footer, and overall layout were redesigned to provide a cleaner, more intuitive user experience. The new design ensures that users can navigate through the Playground with ease, focusing on what matters most—creating and managing templates.
- Responsive Design Implementation: To accommodate various devices, the Playground was made fully responsive. Whether accessed on a desktop or tablet the interface adapts seamlessly, providing a consistent experience across all platforms. This was achieved through careful design considerations and thorough testing across major browsers, including Chrome, Firefox, Edge, Safari, and Opera.
Before and after comparisons of the Playground interface:
Fig 3: Diagrams illustrating the implementation strategy.
Enhancing the Editing Experience to the TemplateMark and Concerto Model Editors and Core Functionality with General Robust Testing
In the Template Playground, significant improvements were made to the TemplateMark and Concerto Model editors, focusing on enhancing the editing experience and ensuring stability through robust testing using React Testing Library (RTL). Upgrades included dynamic variable support and conditional logic to improve their functionality and interoperability, making template creation more powerful and flexible. Additionally, tests were written for foundational experience updates, including the implementation of shareable links logic and other core features, to provide a seamless development experience.
Template Sharing and Storage Features
One of the key new features introduced was the ability for users to save their progress and share templates via encoded URLs.
- Serialization and Deserialization: Developed a robust system to serialize template data, allowing users to save their work locally or generate a shareable link. Upon accessing the link, the template is deserialized, ensuring that all user data and settings are retained.
- Collaboration and Sharing: This feature enhances collaboration by allowing users to easily share their templates with colleagues or across different platforms. It also facilitates the storage of templates for future use without requiring a dedicated database or server infrastructure.
Fig 4: Playground templates sharing via encoded URL Logic.
Integrated Learning Resources
To lower the entry barrier for new users and provide ongoing education, a comprehensive learning pathway was integrated directly into the Playground.
- Learning Pathway Structure: Developed a structured pathway guiding users through essential concepts such as TemplateMark, the Concerto Model, and template creation. The pathway is designed to be intuitive, allowing users to progress at their own pace and revisit topics as needed.
- Content Components: Introduced components like `ContentMarkdownHTML` and `StepsMarkdownHTML`, enabling the rendering of rich markdown content and navigation between different learning steps. These components are critical for delivering educational content in an engaging and accessible manner.
- Interactive Tour Guidance: Integrated the React tour library to provide interactive tooltips and guided tours for new users, helping them navigate the Playground more effectively and enhancing their learning experience.
- Dedicated Content Folder: Implemented a system where all learning materials are stored in a dedicated `/content` folder, making it easy to manage and update the educational resources. The structure is designed to support future expansions, allowing the introduction of new learning modules and pathways.
Current State
Completion Status:
- All major goals of the Template Playground upgrade have been achieved, with significant improvements in both functionality and user experience.
- The integrated learning pathway is fully functional, providing a comprehensive guide for users to master the Playground’s features.
Demo URL: playground.accordproject.org
Development Cycle
The development of the Template Playground was carried out in multiple phases, focusing on enhancing functionality, user experience, and introducing new features. Below is an overview of the key phases, issues, and pull requests associated with the project:
Issues
To ensure a smooth development process and to track progress effectively, a project was created on GitHub to manage milestones and tasks: Accord Project GitHub Project.
Pull Requests
Foundational Experience and Enhanced Functionality
- Implemented various improvements and foundational updates to the Template Playground, Including the user interface, optimizing performance, ensuring browser compatibility, and establishing the platform’s stability and scalability. These groundwork updates laid the essential build for future development.
- PRs:
- https://github.com/accordproject/template-playground/pull/65
- https://github.com/accordproject/template-playground/pull/66
- https://github.com/accordproject/template-playground/pull/70
- https://github.com/accordproject/template-playground/pull/71
- https://github.com/accordproject/template-playground/pull/75
- https://github.com/accordproject/template-playground/pull/76
- https://github.com/accordproject/template-playground/pull/77
- https://github.com/accordproject/template-playground/pull/78
- https://github.com/accordproject/template-playground/pull/79
- https://github.com/accordproject/template-playground/pull/80
- PRs:
Template Sharing and Storage Features
- Introduced and Implemented functionality that allows users to save their work progress and share templates through encoded URLs.
Integrated Learning Resources
- To lower the entry barrier for new users, integrated a comprehensive learning pathway into the Playground.
Each of these phases contributed significantly to the overall development and enhancement of the Template Playground, ensuring that it meets the needs of users and provides a robust platform for creating and sharing templates.
Future Goals
Although the project has successfully met its primary objectives, there are areas identified for potential future improvements. The expansion of advanced Learning Pathways. By incorporating more in-depth tutorials and complex use cases, the project can better serve power users and those seeking to deepen their understanding.
Performance optimization remains a key focus, with the need for further fine-tuning to enhance load times and ensure smoother interactions, especially as more features are introduced.
Learnings and Experience
Throughout my journey with the Template Playground project, I had the privilege of collaborating with a team of incredibly talented individuals who significantly enriched my experience. My mentors, Sanket, Matt and Dan provided invaluable guidance and support, ensuring I navigated challenges effectively and maintained a clear focus on the project’s objectives. Their insights were instrumental in refining my approach and overcoming obstacles with confidence.
Engaging with the Template Playground’s evolving architecture, especially in areas like TemplateMark and the Concerto Model, allowed me to gain hands-on experience with complex systems. These interactions have significantly expanded my technical skill set and reinforced my commitment to delivering high-quality, maintainable code.
Moving forward, I am eager to continue contributing to the Template Playground and the broader community, with a particular focus on advancing features and enhancing user experience. This project has not only been a profound learning experience but has also fueled my passion for bringing innovative ideas to life and making meaningful contributions to the development community.
Acknowledgments
I would like to express my deepest gratitude to my mentors Sanket Shevkar, Matt Roberts and Dan Selman whose guidance and support were invaluable throughout this project. I also extend my thanks to the Accord Project community for their feedback and contributions, which were instrumental in shaping the final outcome.