Group 20 - Compose Builder - Combined
Group 20 - Compose Builder - Combined
Compose Builder
Team Members
- Abel Mekonnen
- Bruk Tedla
- Hailemariam Arega
- Nazrawi Demeke
- Tamirat Dereje
UI - User Interface
Android Studio - Official Integrated Development Environment (IDE) for Android app development
View-based UI - An XML-based framework that was the standard for developing Android UI until Jetpack
Compose was introduced
1
Compose Builder 2024
Abstract
The "Compose Builder" project addresses the challenge posed by the transition from the traditional
XML-based UI framework to Jetpack Compose in Android development. Google's recommendation for
adopting Jetpack Compose promises a more efficient and streamlined development process. However, the
absence of a drag-and-drop framework for Compose creates a learning curve, particularly for developers
accustomed to the ease of XML-based design and novices that are getting started with android development.
To bridge this gap, our proposed solution is to develop a tool that facilitates UI design through a user-friendly
drag-and-drop interface, generating error-free Jetpack Compose UI code in Kotlin. The tool aims to replicate
the familiar drag-and-drop system of the view-based UI, enhancing the adaptability of developers and
accelerating overall development.
2
Compose Builder 2024
1. Introduction
1.1 Background
1.1.1 Motivation
The motivation for this project is to streamline the UI development process in Jetpack Compose by offering a
more intuitive method through a drag-and-drop interface. It seeks to fill a gap in the product portfolio by
addressing the challenges associated with transitioning from traditional UI frameworks.
1.1.2 Customer
The primary customers for this project are Android developers and UI designers who are looking for a more
intuitive way to create UIs in Jetpack Compose.
1.1.3 Deliverables
The project will deliver a new tool that allows users to interact with and customize various UI components
through a drag-and-drop interface. This tool will translate designs into error-free Jetpack Compose UI code
in Kotlin, enhancing the efficiency of the development process. It represents a new product designed to
complement Jetpack Compose.
1.1.4 Cost
Regarding cost, the project leverages existing hardware and software resources, with a detailed cost analysis
to be conducted during ongoing assessments.
1.1.5 Duration
The estimated duration for the project is anticipated to be around 7 months; however, this is a rough estimate.
The timeline encompasses the various phases of development, testing, and refinement required to meet the
specified goal. The timeline may be subject to adjustments based on different unforeseen factors.
3
Compose Builder 2024
1.1.7 Dependencies
For example, the integration of the tool with Android Studio IDE could depend on the progress and
compatibility of related projects. Ongoing collaboration and communication with relevant projects will
ensure a cohesive and harmonized development environment.
As of current information on the internet, there is no alternative way to develop Jetpack Compose UI using
drag-and-drop, so our application could be a first. Android Studio’s efforts culminate at a live-preview
interface which refreshes as you write the code but the interface is read only. We aim to build a similar
interface but one that can take user input to modify the code as well.
1.2.3 Relay
Google’s Figma plugin for converting Figma designs to Jetpack Compose code. This is a new tool being
developed and is meant to streamline the development process, however our product is different from this
platform. For starters, we will allow users to include UI level state - this means that developers can specify
what state variables in the Viewmodel will be observed by the respective UI components. We will then use
this information to generate the Viewmodel and allow the developer to start working from there.
4
Compose Builder 2024
One other point is that for Relay to be an effective tool, the developer either needs good Figma skills or a
dedicated UI designer. Our platform includes native components that Android developers are already familiar
with that they can easily go in and use.
The significance lies in the potential slowdown of Android development processes. Developers accustomed to
the simplicity of drag-and-drop UI design may face resistance in adopting Compose, impacting project
timelines and efficiency.
The current gap exists in the lack of a user-friendly design interface for Jetpack Compose. Developers are
accustomed to visual UI design methods, and the absence of this in Compose creates a mismatch in
established practices.
Stakeholders include Android developers, UI designers, and organizations invested in efficient Android app
development. The solution is relevant to developers seeking a smoother transition to Jetpack Compose and
organizations aiming for enhanced development productivity.
Failure to address the gap may result in prolonged adaptation periods for developers, leading to delays in
project timelines. It could also discourage the adoption of Jetpack Compose, limiting the benefits offered by
this recommended framework.
The proposed solution is the development of the "Compose Builder" tool, featuring a drag-and-drop interface
for Jetpack Compose. This tool will streamline UI design, generate error-free Kotlin code, and ease the
learning curve for developers. Key benefits include a more intuitive UI design process, faster development
cycles, and increased adoption of Jetpack Compose within the Android development community.
5
Compose Builder 2024
feedback and the rate of successful compilation of the generated code. This targeted approach emphasizes the
relevance of the solution to the specific needs of developers, making it both measurable and achievable.
Build a proof of concept (POC) for the "Compose Builder" tool, emphasizing a limited set of UI components
to demonstrate the core functionality of the drag-and-drop interface for Jetpack Compose UI design.
Following the successful POC, proceed to develop a functional prototype of the "Compose Builder" tool,
expanding on the initial limited set of components to showcase broader capabilities.
Achieve a higher success rate in generating compilable Kotlin code from the drag-and-drop interface,
ensuring the tool's efficacy in translating visual designs into functional Compose UI elements.
Implement an iterative feedback loop, collecting input from early adopters and developers, and incorporating
enhancements to the tool's usability and features based on their suggestions.
Create comprehensive documentation and tutorials for the "Compose Builder" tool, providing clear
instructions for users and ensuring the accessibility of the tool's functionalities.
6
Compose Builder 2024
Developmental cost
The project's emphasis on simplicity and practicality aligns with our existing knowledge and capabilities,
eliminating the necessity for costly external training or onboarding. By leveraging readily available
programming environments, such as Kotlin and Android Studio, the development process remains
cost-efficient while maintaining a focus on the essential features required for a successful drag-and-drop
interface in Jetpack Compose.
7
Compose Builder 2024
Operational Cost
Operational costs for Compose Builder are expected to be nominal. As the tool integrates seamlessly into the
existing Android development environment, there are no significant additional operational expenses
anticipated. The team will manage essential operational aspects, including continuous integration and testing,
within the scope of their existing resources.
1.7 Scope
Drag-and-Drop Interface
Code Generation
● Implement a robust code generation mechanism to produce error-free Jetpack Compose UI code in
Kotlin.
● Validate the generated code against common best practices and Compose guidelines.
Reliability
● Prioritize the reliability of code generation to minimize errors and bugs in the generated Jetpack
Compose UI code.
● Implement thorough testing procedures to validate the correctness of the generated code.
Documentation
● Provide comprehensive documentation for developers on how to use the tool effectively.
1.7.2 Exclusions
● The tool will focus on generating standard Jetpack Compose UI code and may not support highly
customized or advanced code configurations.
8
Compose Builder 2024
● The scope is limited to the generation of Jetpack Compose UI code and does not extend to generating
non-UI-related code.
● The tool will be limited to generating Kotlin code for Jetpack Compose and will not support other UI
frameworks like Flutter or React.
● Features such as extensibility and integration with Android Studio IDE are considered secondary
goals and may not be included in the initial release.
1.7.3 Deliverables
Drag-and-Drop Tool
● Deliver a web app drag-and-drop tool for designing Jetpack Compose UI elements.
● Provide a module for code generation that can be integrated into Android projects.
Documentation Package
● Deliver comprehensive documentation, including user guides and tutorials for the drag-and-drop tool
and code generation module.
Test Reports
● Provide documentation on the testing procedures conducted, along with reports on the reliability and
correctness of the generated code.
By defining these aspects of the project scope, exclusions, and deliverables, we aim to create a clear
understanding of the project's objectives and limitations.
9
Compose Builder 2024
● A deep understanding of Jetpack Compose is essential for generating accurate and efficient UI code.
Topics will cover Compose components, state management, and composables to ensure the generated
code aligns with best practices and efficiently represents the desired UI.
React.js Fundamentals
● Since the frontend will be developed using React.js, a solid understanding of React.js fundamentals
is crucial. Topics will include component-based architecture, state management, and the Virtual DOM
to ensure a responsive and efficient user interface
● Effective state management is vital for handling user interactions and maintaining the application's
state. Topics will include exploring state management solutions in React, such as React Hooks or
state containers, to ensure consistency and reliability in managing UI design elements.
● Ensuring the frontend is responsive and accessible is crucial for providing a positive user experience.
Topics will include responsive design principles, accessibility standards, and testing methodologies to
guarantee the tool is usable across various devices and for users with different abilities.
drag-and-drop framework in Compose significantly impedes the migration process for developers
accustomed to the XML paradigm. In fact, as of the date on this document, there is no drag-and-drop
available for Jetpack Compose that we know of. Our proposal aims to enhance the efficiency and ease of
Compose adoption by leveraging a creative solution that combines the intuitiveness of drag-and-drop design
with the power of the Compose framework.
The demand for tools that ease the transition from traditional XML-based UI frameworks to Jetpack
Compose is driven by the need for increased development efficiency.
● Targeted Approach: Compose Builder focuses specifically on Jetpack Compose, providing a niche
solution for developers in the Android ecosystem.
● Familiar UI Design: The drag-and-drop interface mirrors the familiarity of XML-based UI design,
making it easier for developers to transition.
● Open Source Model: The open-source nature of Compose Builder fosters collaboration,
community-driven improvements, and widespread adoption.
Potential Challenges
● Learning Curve: Developers may initially face a learning curve in transitioning to Jetpack Compose,
even with the drag-and-drop interface.
● Dependency on Jetpack Compose: The success of Compose Builder is closely tied to the adoption
and sustained development of Jetpack Compose by the Android community.
12
Compose Builder 2024
● Focused on Jetpack Compose: Compose Builder is tailored specifically for Android developers
embracing Jetpack Compose, offering a seamless transition without the need to learn an additional
framework.
● Familiar Drag and Drop Interface: The tool provides a user-friendly drag and drop interface,
mirroring the familiarity of XML-based UI design, reducing the learning curve for developers.
● Error-Free Code Generation: Emphasis on generating reliable, bug-free Jetpack Compose code,
ensuring the efficiency and quality of the development process.
1.10 Methodology
b. Analyze Google's Jetpack Compose documentation thoroughly to extract key features and best
practices.
2. Design:
a. Develop a detailed design plan for the drag-and-drop interface based on the gathered
requirements.
b. Create a comprehensive architecture for the tool, emphasizing scalability, modularity, and
strict adherence to Jetpack Compose standards.
3. Implementation:
13
Compose Builder 2024
a. Execute the design plan by implementing the drag-and-drop interface using suitable front-end
technologies.
b. Develop the back-end logic for code generation in Kotlin, focusing on accuracy and adherence
to Jetpack Compose guidelines.
4. Testing:
b. Implement system testing to validate the tool's overall performance and its compatibility with
various UI design scenarios.
5. Deployment:
a. Release the tool once it has successfully passed all testing phases and meets the predefined
criteria.
b. Provide comprehensive documentation to guide users in the effective utilization of the tool.
6. Maintenance:
b. Conduct periodic reviews to assess the tool's performance and address evolving user needs.
○ Oversees the entire project, ensuring it progresses through each phase in a linear and
systematic manner.
● Front-end Developers:
● Back-end Developers:
○ Develops the back-end logic for code generation in adherence to the established architecture.
14
Compose Builder 2024
● Back-end Development:
● Code Generation:
● Version Control:
● Project Management:
● Communication:
○ Weekly stands-ups.
● Documentation:
The Waterfall methodology will provide a structured and controlled development process, allowing for
thorough planning and documentation, which is crucial for the success of the "Compose Builder" project.
15
Compose Builder 2024
Hardware Requirements:
● High-Performance Workstations: Equipped with modern processors, sufficient RAM, and dedicated
GPUs to handle the computational demands of UI design, code generation, and real-time preview.
● Storage Capacity: Adequate storage to handle project files, assets, and code repositories efficiently.
We are planning to use third party cloud storages to accommodate the storage needs.
● Risk: Unforeseen compatibility issues between the "Compose Builder" tool and evolving
versions of Jetpack Compose.
● Impact: High, as it may result in delayed updates or a tool that is not in sync with the latest
Compose features.
2. Schedule Risks:
● Risk: Unforeseen complexities during the development phases leading to schedule overruns.
3. External Risks:
● Risk: Dependency on external libraries or tools that may not align with the project's schedule
or compatibility requirements.
● Impact: Medium, as delays in external dependencies can affect the overall project timeline.
16
Compose Builder 2024
2. Schedule Risks:
● Mitigation: Break down the project into smaller, manageable phases with clearly defined
milestones. Regularly reassess progress and adjust schedules as needed.
3. External Risks:
● Mitigation: Diversify dependencies where possible and stay informed about the development
roadmap of external libraries. Have contingency plans for alternative tools or libraries if
needed.
Contingency Plans:
1. Technical Risks:
● Contingency: Develop a rollback plan to revert to the previous stable version of the tool if
compatibility issues become insurmountable. This ensures continuity while addressing
technical challenges.
2. Schedule Risks:
● Contingency: Allocate buffer times in the project schedule to account for unexpected delays.
In case of schedule overruns, prioritize critical features and functionalities to ensure a phased
release if necessary.
3. External Risks:
17
Compose Builder 2024
Requirement Gathering
Design
Deployment
Risk: The tool may generate incorrect or suboptimal Jetpack Compose code, leading to functional issues in
the Android application.
Mitigation: Implement extensive unit testing for code generation, conduct code reviews, and provide a
mechanism for user feedback to iteratively improve code accuracy.
Risk: The drag-and-drop interface may not be intuitive, causing usability issues for developers transitioning
from XML-based design.
Mitigation: Engage in usability testing with target users, gather feedback iteratively, and refine the user
interface based on the results.
18
Compose Builder 2024
a. Code Reviews:
Implement a robust peer code review process to ensure code quality, identify potential issues early, and
promote knowledge sharing among the development team.
b. Automated Testing:
Develop and maintain a comprehensive suite of automated tests for both frontend and backend components
to catch regressions and ensure the reliability of the tool.
Utilize CI/CD pipelines to automate the build, test, and deployment processes, ensuring consistent and
reliable releases.
Integrate a user feedback mechanism within the tool to collect input from developers, allowing for
continuous improvement based on real-world usage.
a. Unit Testing:
Implement unit testing for critical components, including code generation algorithms, to ensure the
correctness of individual units of code.
b. Integration Testing:
Conduct integration testing to verify the seamless interaction between the frontend and backend components,
identifying and resolving any communication issues.
Engage users in UAT to assess the overall usability, performance, and reliability of the tool in a real-world
environment, incorporating feedback into the development process.
19
Compose Builder 2024
d. Performance Testing:
Perform performance testing to evaluate the responsiveness of the frontend, especially during drag-and-drop
interactions, ensuring a smooth user experience.
20
Compose Builder 2024
2. Requirement Analysis
2.1. Introduction
The transition from traditional XML-based User Interface (UI) frameworks to modern solutions
like Jetpack Compose presents a significant challenge for Android developers. While Jetpack
Compose promises increased efficiency and a streamlined development process, the complexity
of migrating existing UI code poses obstacles for developers accustomed to XML-based layouts.
Recognizing the need for a more intuitive approach to UI design, we have pivoted our project
scope to address this challenge by developing a drag-and-drop web application for building
Jetpack Compose UIs.
2.1.1 Purpose
This Software Requirements Specification (SRS) document serves to outline the requirements for
the development of our drag-and-drop web application. The purpose of the application is to
provide developers with a user-friendly interface for designing Jetpack Compose UI layouts
through intuitive drag-and-drop interactions. By simplifying the UI design process, our
application aims to facilitate the adoption of Jetpack Compose and enhance the efficiency of
Android app development.
2.1.2 Scope
The software product under consideration is a drag-and-drop web application for building
Jetpack Compose UIs. The application will be accessible through web browsers and will not
require installation or configuration on users' devices.
The drag-and-drop web application will enable users to design UI layouts by dragging UI
components onto a canvas and arranging them according to their preferences. Real-time previews
of the UI layout will be provided, allowing users to visualize the appearance of their designs.
Upon completion, the application will generate Jetpack Compose code corresponding to the
user's design, which can be seamlessly integrated into Android projects.
21
Compose Builder 2024
The drag-and-drop web application for building Jetpack Compose UIs will offer the following
functionalities:
● Real-Time Previews: The application will provide real-time previews of the UI layout as
users design, allowing them to visualize the appearance and structure of their designs
instantly.
● Jetpack Compose Code Generation: Upon completion of the UI design, the application
will automatically generate Jetpack Compose code corresponding to the user's layout.
This generated code can be readily incorporated into Android projects, saving developers
time and effort in manual coding.
The drag-and-drop web application will not include the following functionalities:
● Direct Code Editing: Users will not have the ability to directly edit the generated Jetpack
Compose code within the application. The application focuses solely on providing a
visual interface for UI design through drag-and-drop interactions.
● Advanced UI Customizations: While the application will facilitate basic UI layout design
through drag-and-drop, it will not support advanced UI customizations or complex layout
configurations. Users requiring advanced customization may need to manually edit the
generated Jetpack Compose code.
● Integration with External Tools: The application will not directly integrate with external
development tools or libraries. Its primary function is to simplify the UI design process
within the context of Jetpack Compose development.
The drag-and-drop web application for building Jetpack Compose UIs offers several benefits,
objectives, and goals, including:
22
Compose Builder 2024
● Improved Developer Experience: The application aims to improve the overall developer
experience by providing a visual, interactive interface for UI design, thus making the
process more engaging and intuitive.
● Facilitation of Rapid Prototyping: The ability to quickly design and visualize UI layouts
using the application enables developers to prototype and iterate on their designs more
rapidly, accelerating the app development lifecycle.
2.1.3 Overview
The overview section of the Software Requirements Specification (SRS) provides a concise
summary of the document's contents and structure, tailored specifically to the drag-and-drop web
application for building Jetpack Compose UIs.
● The SRS for the drag-and-drop web application includes the following key sections:
● Introduction: Offers an introduction to the SRS, highlighting the purpose, scope, and
conventions of the document as they relate to the development of the drag-and-drop web
application for building Jetpack Compose UIs.
● Specific Requirements:
23
Compose Builder 2024
○ Use Cases: Provides detailed scenarios and interactions to illustrate the behavior
of the software in various user-driven situations.
○ Inverse Requirements: Outlines aspects the software will not address, such as
direct code editing or integration with external tools.
● Change Management Process: Outlines the process for managing changes to the software
requirements throughout the project lifecycle, ensuring transparency and accountability.
● References: Lists all documents and sources referenced in the SRS, providing necessary
context and background information for stakeholders.
The SRS is organized in a structured manner to facilitate easy navigation and comprehension of
the document. It follows a logical progression from general to specific information, as follows:
24
Compose Builder 2024
● Change Management Process: Describes the procedures for managing changes to the
software requirements.
2.2.1.1 Overview
The drag-and-drop web application for generating Jetpack Compose UI code is envisioned as a
pivotal tool within the realm of Android app development. It addresses the transition from
traditional XML-based UI design to the modern paradigm offered by Jetpack Compose,
streamlining the process and enhancing efficiency for developers.
This application stands independently within web browsers, offering developers a versatile and
accessible platform for creating Jetpack Compose UI layouts. Its web-based nature allows for
seamless integration into various development environments, catering to developers across
different operating systems and devices.
The drag-and-drop web application harmonizes with existing development workflows, providing
developers with a visual interface to design Jetpack Compose UIs. It seamlessly integrates with
Android Studio and other development tools, facilitating a smooth transition from design to
implementation.
While the application focuses on UI design, it coexists with other web-based development tools
commonly used in Android app development. This includes version control systems,
collaborative platforms, and online repositories, enriching the development experience with a
comprehensive set of resources.
25
Compose Builder 2024
The application aligns with industry trends by leveraging modern web technologies to simplify
UI design processes. Its compatibility with Jetpack Compose reflects the industry's transition
towards declarative UI frameworks, empowering developers to create elegant and efficient
Android UIs.
Despite its web-based nature, the application must adhere to web standards and browser
compatibility to ensure consistent performance across platforms. It must also comply with
Jetpack Compose framework standards to maintain compatibility and seamless integration with
Android projects.
As web technologies and Android development practices evolve, the drag-and-drop web
application anticipates updates to accommodate emerging trends. Continuous improvements in
design, functionality, and compatibility will ensure its relevance and effectiveness in the dynamic
Android development landscape.
Users can build User Interface (UI) in the web application utilizing its drag and drop interface..
The application contains a code generator module, which takes the JSON representation of the
UI as its input and generates the appropriate Jetpack Compose code. This function is the root of
the system and allows users to effortlessly trigger the generation with a single action, enhancing
efficiency and productivity in UI development.
26
Compose Builder 2024
2.2.3.1 Overview
The drag-and-drop web application for generating Jetpack Compose UI code is designed to
accommodate a wide range of users involved in Android app development. Understanding the
diverse characteristics of these users is paramount to tailoring the application to their needs and
ensuring an exceptional user experience.
Experience Level:
● Novice Developers: Individuals with limited experience in Android app development can
utilize the application to simplify the transition from developing XML-based UI using
drag-and-drop to Jetpack Compose.
Technical Proficiency:
● Knowledge of Jetpack Compose: While not mandatory, users with prior knowledge of
Jetpack Compose may utilize the application more effectively to design intricate UIs.
Frequency of Use:
● Regular Users: Developers engaged in frequent Android app development tasks may
utilize the application regularly to create application screen UI in Jetpack Compose using
a drag and drop interface.
● Occasional Users: Users with intermittent UI development needs may employ the
application as required, seeking an efficient and user-friendly solution for their occasional
tasks.
27
Compose Builder 2024
Workflow Integration:
● Integration into Development Workflow: The application seamlessly integrates into the
development workflow within the web environment, becoming an integral part of users'
design process.
● Initiation of Generation Process: Users initiate the generation process when creating a
new screen, utilizing the web platform to ensure a smooth transition from design to
implementation.
● Quick Turnaround: Users expect a swift and efficient development process, minimizing
the time between coming up with the design and reviewing the generated Jetpack
Compose UI code.
● Intuitive Interface: Users appreciate an intuitive user interface within the web application,
featuring straightforward navigation and clear instructions for seamless creation of
Jetpack Compose UI code.
● Users within the dynamic Android development landscape are adaptable to emerging
technologies, such as the declarative UI paradigm introduced by Jetpack Compose.
● They expect the application to evolve alongside advancements in web technologies and
Jetpack Compose, ensuring continued relevance and effectiveness in the ever-evolving
Android development ecosystem.
28
Compose Builder 2024
2.2.4.1 Overview
The development of the drag-and-drop web application for generating Jetpack Compose UI code
is subject to various constraints that shape its design and functionality. These constraints
encompass regulatory, technical, and operational considerations, guiding the decisions made
throughout the software development lifecycle.
● The application must adhere to web standards and best practices to ensure compatibility
across different browsers and devices.
● The development process must align with industry-standard security and privacy
measures to safeguard user data and maintain the integrity of the generation process.
● The application's design and functionality should be compatible with commonly used
web browsers to ensure accessibility for users across different platforms.
● The application's interface should seamlessly integrate with other web development tools
and frameworks commonly used in Android app development, enhancing its utility and
versatility.
29
Compose Builder 2024
Concurrency Support:
● The application should support parallel operation with other web-based development
tools, allowing developers to concurrently perform various tasks related to app
development without interference.
● The application must incorporate audit functions, including logging and monitoring
capabilities, to track activities and assist in debugging or issue resolution.
● Adequate controls for user interactions should be provided within the application,
allowing developers to manage and monitor the generation process effectively.
● The application must meet reliability requirements, ensuring stable and consistent
performance across different web browsers and development environments.
● Security considerations involve ensuring the secure handling of data during the
generation process, preventing data loss or unauthorized access.
● The application should not put the code or the project at risk of data loss or corruption,
and no code should be persisted in any way to ensure the safety of proprietary data.
30
Compose Builder 2024
2.2.5.1 Assumptions
Assumption:
● It is assumed that the target users have a basic understanding of web development
principles and practices.
Rationale:
● This assumption is based on the expectation that users interacting with the drag-and-drop
web application for generating Jetpack Compose UI code are developers or individuals
involved in web development tasks.
Assumption:
● It is assumed that users have access to modern web browsers with JavaScript enabled.
Rationale:
● The functionality of the web application relies on client-side scripting using JavaScript.
Users are expected to have access to compatible web browsers to ensure optimal
performance and functionality.
Assumption:
● Users are assumed to be familiar with or willing to learn Jetpack Compose, the modern
Android UI toolkit.
Rationale:
● While the application facilitates the generation of Jetpack Compose UI code from
drag-and-drop interactions, a basic understanding of Jetpack Compose concepts is
beneficial for users to effectively utilize the generated code.
31
Compose Builder 2024
Assumption:
● The stability and reliability of users' web development environment are assumed.
Rationale:
● The performance of the web application relies on a stable and well-functioning web
development environment, including web browsers and internet connectivity.
2.2.5.2 Dependencies
Dependency:
● The functionality of the web application is dependent on compatibility with modern web
browsers.
Impact of Change:
Dependency:
Impact of Change:
Dependency:
● The application requires internet connectivity to access resources and perform certain
functions, such as fetching updates or external data.
32
Compose Builder 2024
Impact of Change:
Dependency:
Impact of Change:
The User Interfaces for the Compose Builder web application will be designed to provide a
seamless experience for developers crafting Jetpack Compose code. Accessible via modern web
browsers, the interface boasts an intuitive drag-and-drop functionality at its core, enabling users
to effortlessly construct complex UI layouts. Within the interface, users are greeted with a library
of native Android UI components, like buttons and text fields. This extensive library, coupled
with a user-friendly search feature, ensures easy access to desired components.
As users design their UI layout on the canvas, a real-time preview dynamically updates to reflect
changes, offering instant visual feedback. Alongside the canvas, a dedicated panel displays the
corresponding Jetpack Compose code generated from the user's design, allowing for a
comprehensive understanding of the code structure. Users can interact with individual
components on the canvas to customize properties such as size, color, and behavior, facilitated by
contextual menus or property inspectors.
33
Compose Builder 2024
Upon completion of the design process, users trigger the conversion to Jetpack Compose code
with a single action, prominently displayed within the interface. Throughout the design and
conversion phases, the application provides clear feedback and error handling mechanisms,
including interactive tooltips, contextual messages, and visual indicators. These features ensure
smooth navigation and address any encountered issues effectively, enhancing the overall user
experience.
The system has no hardware interface requirements. As long as the user has a computer that can
run a web browser, the program will work.
Mnemonic: MWB
Users are required to have access to a modern web browser compatible with the Compose
Builder Web Application. This allows for seamless operation across various operating systems
and devices, ensuring broad accessibility for developers without any additional software
dependencies.
Given the web-based nature of the solution, no specific version requirements are imposed on the
software products. Users are simply expected to access the Compose Builder Web Application
via their preferred web browser to utilize the conversion tool effectively. This streamlined
approach enhances usability and eliminates any barriers to entry associated with software
installations.
34
Compose Builder 2024
The code generator will be a backend service that accepts UI represented as a JSON and converts
it into Jetpack Compose code. The frontend will be responsible for generating the JSON
representation based on the status of the drag-and-drop interface. When the user attempts to
generate the code, the frontend will use a REST API to send a request to the service containing
the JSON as a request payload. The backend service will then generate the code and respond
with the appropriate Jetpack Compose files.
2.3.2.1.2 Inputs
Users should be able to choose from a variety of native components to drag and drop into a
screen, creating simple and complex UIs.
State Configuration:
Users should have the option to link different UI components they’ve chosen to different UI state
variables and types.
2.3.2.1.3 Processing
2.3.2.1.4 Outputs
35
Compose Builder 2024
The primary output is the Kotlin code representing the UI in Jetpack Compose, preserving the
original layout, styling, and functionality.
Documentation:
In case of conversion challenges or failures, the system provides clear and informative error
messages to help developers identify and resolve issues.
Integration with logging mechanisms to record and report errors, facilitating debugging and
troubleshooting.
The system gracefully handles scenarios where conversion cannot be completed successfully,
ensuring minimal disruption to the developer workflow.
2.3.2.2.1 Introduction
The User Interface Preservation ensures that the converted Jetpack Compose code maintains the
original UI design and layout from the drag-and-drop UI, adhering to the user's expectations.
2.3.2.2.2 Inputs
36
Compose Builder 2024
2.3.2.2.3 Processing
2.3.2.2.4 Outputs
Kotlin-based Jetpack Compose code files that closely resemble the original UI.
Detecting discrepancies between the original UI and the preserved Jetpack Compose UI.
Providing suggestions for adjusting preservation settings to achieve the desired UI outcome.
These structured requirements provide a clear framework for the development of the "Compose
Builder" project, specifying each module's purpose, inputs, processing steps, outputs, and error
handling mechanisms.
2.3.2.3.1 Introduction
The Code Quality and Readability is dedicated to ensuring that the Jetpack Compose code
generated by the system adheres to industry best practices and coding standards, promoting
high-quality and readable code within the Android development environment.
2.3.2.3.2 Inputs
This module takes as input the Kotlin-based Jetpack Compose code files produced by the
Conversion Module.
2.3.2.3.3 Processing
37
Compose Builder 2024
Analyzing the structure and syntax of the generated Jetpack Compose code.
Identifying code elements that deviate from established best practices and coding standards.
Implementing automated mechanisms to optimize and clean up the code, eliminating redundant
or unnecessary elements.
Applying coding conventions, such as proper indentation, naming conventions, and code
organization.
2.3.2.3.4 Outputs
Revised Kotlin-based Jetpack Compose code files that align with best practices and coding
standards.
Reports or logs detailing the optimizations and clean-up performed on the code.
Notifications highlighting areas where the code has been enhanced for improved readability.
Logging and reporting of issues found during the optimization and clean-up process.
Suggestions for developers to manually review and adjust code segments that may require
manual intervention for improved readability.
2.3.2.4.1 Introduction:
The system shall provide users with the capability to save their progress within the software
development environment. This feature enables users to retain their work and continue from
where they left off during subsequent sessions.
38
Compose Builder 2024
2.3.2.4.2 Inputs:
Users shall initiate the save progress action through a designated interface element, such as a
"Save" button or menu option.
Upon triggering the save action, users may input optional metadata such as a title or description
to label their saved progress.
2.3.2.4.3 Processing:
When the save progress action is initiated, the system shall capture the current state of the user's
workspace, including project files, code edits, task assignments, and other relevant data.
The system shall process the captured data and serialize it into a format suitable for storage, such
as JSON.
If metadata is provided by the user, the system shall incorporate this information into the saved
progress data for future reference.
2.3.2.4.4 Outputs:
Upon successful processing, the system shall generate a confirmation message indicating that the
user's progress has been saved.
The system shall provide users with the ability to access their saved progress at a later time
through a dedicated interface, such as a "Load Progress" option in the application menu.
If an error occurs during the save progress process, such as a failure to serialize the data or an
unexpected system error, the system shall display an error message informing the user of the
issue.
The system shall provide options for users to retry the save action or cancel the operation if an
error occurs.
In case of data corruption or loss during the save process, the system shall implement
mechanisms to recover and restore the user's previous progress from backups or auto-save
features.
39
Compose Builder 2024
2.3.2.5.1 Introduction:
The system shall enable users to create new accounts, allowing them to register and gain access
to the software development environment. This functionality facilitates user onboarding and
account creation within the system.
2.3.2.5.2 Inputs:
Users shall input their desired username during the signup process.
Users shall provide a valid email address for account verification and communication purposes.
Optional additional details may be provided by users, such as full name, organization, or profile
information.
2.3.2.5.3 Processing:
Upon submission of the signup form, the system shall validate the provided registration
information for completeness and adherence to formatting requirements.
The system shall check for the uniqueness of the chosen username and email address to prevent
duplication.
If the provided information passes validation checks, the system shall create a new user account
and generate a unique identifier for the user.
An email verification process may be initiated by the system to confirm the user's identity and
activate the account.
2.3.2.5.4 Outputs:
Upon successful registration, the system shall display a confirmation message indicating that the
user's account has been created successfully.
If email verification is required, the system shall prompt the user to check their email inbox for a
verification link or code to activate their account.
In case of errors or validation issues during signup, the system shall provide informative error
messages guiding the user to correct the input fields and resubmit the form.
40
Compose Builder 2024
If the signup form contains errors or missing required fields, the system shall display validation
messages highlighting the issues and guiding the user to correct them.
In case of registration errors such as duplicate usernames or email addresses, the system shall
notify the user and prompt them to choose alternative credentials.
The system shall handle errors related to email verification failures or expired verification links
by providing instructions for account recovery or assistance.
2.3.2.6 Log In
2.3.2.6.1 Introduction:
The system shall provide users with the capability to log in securely, granting access to the
software development environment upon successful authentication. This functionality ensures
user authentication and access control within the system.
2.3.2.6.2 Inputs:
Users shall input their registered username or email address during the login process.
A password shall be entered by users to authenticate their identity and gain access to their
accounts.
2.3.2.6.3 Processing:
Upon submission of the login form, the system shall verify the provided credentials by
comparing them against stored user account records in the database.
The system shall perform authentication checks to validate the user's identity and determine their
access permissions within the system.
If the provided credentials match an existing user account, the system shall authenticate the user
and grant access to the software development environment.
41
Compose Builder 2024
2.3.2.6.4 Outputs:
Upon successful authentication, the system shall display the main dashboard or landing page,
providing access to system functionalities and project resources.
In case of unsuccessful login attempts due to incorrect credentials or other authentication errors,
the system shall display appropriate error messages to alert the user and prompt them to retry or
recover their account.
If authentication fails due to incorrect credentials, the system shall display error messages
indicating the issue and prompting the user to verify their username/email and password.
The system shall handle errors related to account lockouts, expired passwords, or other
authentication issues by providing guidance on account recovery procedures or contacting
support for assistance.
2.3.2.7.1 Introduction:
The system shall allow users to specify state variables within the software development
environment. State variables enable users to define and manage dynamic data elements that
reflect the current state of their projects, tasks, or application components.
2.3.2.7.2 Inputs:
Users shall input the names and data types of state variables they wish to define.
Users may provide optional initial values for state variables during specification.
Additional metadata or descriptions may be included by users to document the purpose or usage
of each state variable.
2.3.2.7.3 Processing:
Upon submission of the state variable specification, the system shall validate the provided input
for syntactic correctness and adherence to defined data type constraints.
The system shall create metadata records for each specified state variable, storing relevant
information such as names, data types, initial values, and user-provided descriptions.
42
Compose Builder 2024
State variable definitions shall be processed and stored persistently within the system, enabling
users to reference and manipulate them during the development process.
2.3.2.7.4 Outputs:
Upon successful specification, the system shall confirm the creation of state variables and
provide users with a summary of the defined variables.
Users shall be able to access and manage their defined state variables through a dedicated
interface within the software development environment.
If the state variable specification contains errors or invalid input, the system shall display
informative error messages guiding users to correct the issues.
In case of conflicts or duplications with existing state variable names, the system shall notify
users and prompt them to choose alternative names to ensure uniqueness.
The system shall handle errors related to data type mismatches or unsupported variable
definitions by providing guidance on compatible data types and restrictions.
ID UC 01
Name Signup
43
Compose Builder 2024
3. The system requires the user to input first name, last name,
email, and password.
4. User fills out the form and chooses the signup option.
Extension (Error 1. Invalid inputs- The system will request the user to use the
Scenario) correct format for the invalid input.
ID UC 02
Name Login
44
Compose Builder 2024
ID UC 03
45
Compose Builder 2024
ID UC 04
46
Compose Builder 2024
Extension (Error Scenario) 1. User fails to select any component from the library.
ID UC 05
47
Compose Builder 2024
Precondition The UI page is created or the code is generated from the input
component
Extension (Error Scenario) 1. User fails to select any component on the canvas.
ID UC 06
Goal Enable users to generate UI code from the created UI page with
or without state.
48
Compose Builder 2024
3. UI code is generated.
Extension (Error Scenario) 1. User fails to select the “generate code” option.
ID UC 07
49
Compose Builder 2024
50
Compose Builder 2024
51
Compose Builder 2024
52
Compose Builder 2024
2.3.4.1 Performance
● Response Time: Compose Builder should respond within acceptable time frames during
UI creation and modification processes, ensuring a smooth and responsive user
experience with auto saving user’s progress in a defined time interval.
● Scalability: The Compose Builder web app should scale effectively, accommodating
larger projects without compromising performance by creating more instances of the
server based on the load.
2.3.4.2 Reliability
● Stability: Ensure the stability of Compose Builder across various web browsers and
versions, preventing crashes or unexpected behavior.
2.3.4.3 Availability
● Support and Maintenance: Provide timely support and maintenance services for
Compose Builder to address issues and updates, ensuring continuous functionality.
2.3.4.4 Security
● Data Privacy
○ User Data: Ensure the privacy and confidentiality of user data stored within the
Compose Builder application.
53
Compose Builder 2024
● Authentication
● Secure Communication
○ HTTPS: Ensure that the web application is accessible via HTTPS to encrypt data
in transit.
2.3.4.5 Maintainability
● Modular Design: Compose Builder should have a modular design for easy functionality
and scaling updates.
● Testing and Debugging: Facilitate efficient testing and debugging using unit tests and
e2e tests in the CI/CD pipeline.
2.3.4.6 Portability
● The Compose Builder web application must ensure high portability across various web
browsers and operating systems. Specific requirements include:
54
Compose Builder 2024
● State Management Support: Compose Builder is concerned only with UI level state and
doesn't support the creation and maintenance of view models and other state management
layers.
● Web Browser Compatibility: The Compose Builder design must adhere to the
specifications and guidelines provided by major web browsers to ensure seamless
integration and compatibility.
Data Formats: Data within the Postgres database will be stored in structured formats, primarily
using relational data models to ensure consistency and ease of querying.
Storage Capabilities: The database must be capable of accommodating the anticipated volume
of data generated by user activities and project management tasks. Scalability is a key
consideration, with provisions for increasing storage capacity as data volumes grow over time.
Data Retention: We have defined data retention policies specifying the duration for which
different types of data should be retained within the database. These policies align with industry
best practices and regulatory requirements.
Data Integrity: To maintain data integrity, the database will enforce constraints such as unique
keys, foreign key relationships, and data validation rules. Error handling mechanisms will be in
place to prevent data corruption or inconsistencies.
55
Compose Builder 2024
Training-related Requirements
Packaging Requirements
● Distribution: Package Compose Builder for web deployment according to modern web
application deployment standards.
56
Compose Builder 2024
57
Compose Builder 2024
3. System Design
3.1 Introduction
3.1.1 Purpose
The System Design document for the drag-and-drop web app for generating Jetpack Compose
code serves the fundamental purpose of translating business requirements and processes into a
technical blueprint for application development. It aims to provide a structured approach to
designing the system architecture and defining the key components and functionalities of the
application. By outlining the architectural framework and design principles, this document sets
the foundation for the implementation phase, ensuring that the development team has a clear
understanding of the project's objectives and requirements. Ultimately, the goal is to deliver a
robust and efficient solution that meets the needs of users and stakeholders while adhering to
industry best practices and standards.
The system operates within the context of Android app development, aiming to simplify the
process of designing UIs by enabling users to visually construct layouts through drag-and-drop
interactions. The basic design approach involves integrating frontend and backend subsystems to
facilitate the conversion of drag-and-drop UI designs into Jetpack Compose code.
System Architecture:
The system architecture comprises two main subsystems: the frontend web application and the
backend service. The frontend application hosts the drag-and-drop interface, allowing users to
create UI layouts intuitively. The backend service is responsible for parsing the user's input,
generating the corresponding Jetpack Compose code, and delivering it back to the frontend for
display.
59
Compose Builder 2024
Design Goals:
● Provide a seamless and intuitive user experience for designing UI layouts using Jetpack
Compose.
● Generate clean and efficient Jetpack Compose code based on the user's design inputs.
● Ensure compatibility with the latest versions of Jetpack Compose and Android Studio.
The project will adopt modern development practices to ensure efficiency and flexibility. Figma
will serve as the primary tool for UI/UX design, providing a collaborative environment and
versatile features conducive to designing digital products.
For the frontend development, Next.js will be employed. Next.js offers server-side rendering
capabilities, streamlined development workflows, and excellent performance optimization,
making it an ideal choice for building dynamic web applications.
On the backend, Django, a high-level Python web framework, will be utilized. Django offers
robust features for rapid development, including built-in authentication, ORM, and security
measures, facilitating the creation of scalable and secure backend systems.
PostgreSQL will serve as the database management system for the project. With its support for
complex queries, transactions, and data integrity, PostgreSQL ensures reliable data storage and
retrieval for the application.
3.1.3.2 Contingencies
The project acknowledges potential contingencies that may arise during development,
particularly in response to changes in requirements or resource constraints. Given that the
60
Compose Builder 2024
application generates Kotlin code for user-selected component designs, the following
contingencies are considered:
● Backend Design Changes: Changes to the backend design, such as database schema
modifications or integration requirements, may occur. The team will conduct thorough
reviews of proposed changes and implement them following a structured change
management plan to minimize disruptions to development.
● Kotlin Code Generation: As the application generates Kotlin code based on user-selected
component designs, potential issues in code generation algorithms or compatibility with
Kotlin syntax may arise. Rigorous testing and validation procedures will be implemented
to ensure the accuracy and reliability of the generated code.
This subsystem lives in the frontend web application and is responsible for generating the JSON
representation from the drag-and-drop UI. This component is activated when the user clicks
‘Generate Compose Code’ and takes no explicit inputs, implicitly observing the drag-and-drop
interface state as its only dependency. Its output is the JSON representation which will be sent to
the backend service for code generation.
61
Compose Builder 2024
This subsystem lives in the backend service and is responsible for parsing the JSON payload
from the incoming request into an in-memory component tree. This component is also
responsible for validating the JSON payload and handling any related errors. The output from
this component is a component tree.
This subsystem lives in the backend service and is the core component of the system. It takes in a
component tree and is responsible for converting it into valid Jetpack Compose code. This is also
the place where the UI state from the payload is processed and applied to the output. The final
output from this subsystem is Compose UI files (with the Kotlin .kt extension).
62
Compose Builder 2024
This subsystem is responsible for authenticating users. It is responsible for login, sign up and
delete account features. It requires access to a user storage through a predefined interface.
This subsystem is responsible for providing the user interface on the web application. It has two
main features, the drag-and-drop interface and the state editor. This subsystem requires access to
a user storage from which it can fetch previous stored work for a specific logged-in user. This is
through a predefined interface, and in reality the user storage will be in the backend service,
accessed through a REST API. The output of this subsystem is fed directly into a JSON
generator subsystem.
63
Compose Builder 2024
64
Compose Builder 2024
65
Compose Builder 2024
3.3.2.1 Signup
66
Compose Builder 2024
3.3.2.2 Sign In
67
Compose Builder 2024
68
Compose Builder 2024
69
Compose Builder 2024
70
Compose Builder 2024
71
Compose Builder 2024
72
Compose Builder 2024
73
Compose Builder 2024
74
Compose Builder 2024
3.4.1 User
Component
+FullName:String
+EmailAddress: String
-PasswordHash: String
+Login(): Boolean
+Logout():Void
-Delete():Boolean
+CreateProject():Boolean
75
Compose Builder 2024
EmailAddress String Public EmailAddress<> NULL and must be a valid email address
format.
PasswordHash String Private PasswordHash<> NUll
3.4.2 Project
Component
+Name:String
76
Compose Builder 2024
+CreateScreen():Boolean
-Delete():Boolean
Delete Private Boolean - Project exists and user Project is deleted from
is owner of the project the system successfully.
CreateScreen Public Boolean ScreenName Project exists and user Screen is created within
provides a screen the project.
name
3.4.3 Screen
Component
+Name:String
+GenerateComposeCode():String
+Delete():Boolean
+ToJson():String
+DrawPreview()
77
Compose Builder 2024
3.4.4 WidgetInstance
WidgetInstance
+AttributesValues:String
+Widget:Widget
78
Compose Builder 2024
3.4.5 Widget
Widget
+Name:String
+ClassName :Integer
+Attributes:String
+GenerateComposeCode()
+DrawPreview()
+ToJson()
79
Compose Builder 2024
3.4.6 Component
Component
+Name:String
+GenerateComposeCode()
+DrawPreview()
+ToJson()
80
Compose Builder 2024
81
Appendix
● Jetpack Compose: Google's declarative UI framework for building native Android applications.
● XML-based UI Framework: The traditional approach to Android UI development using XML files
to define layouts.
● UI Components: Visual elements such as buttons, text fields, and images that make up the user
interface.
● Drag-and-Drop Interface: An interactive method allowing users to move, manipulate, and arrange
UI components using a pointing device.
● Code Generation: The process of automatically producing code, in this context, Kotlin code for
Jetpack Compose UI based on user interactions in the drag-and-drop interface.
● Kotlin: The programming language used for Android development, particularly in the context of
Jetpack Compose.
Compose Builder 2024
Reference
Android View-Based UI
Jetpack Compose
83