# ICP Online IDE Proposal ## 1. Table of Contents 1. [Table of Contents](#1-Table-of-Contents) 2. [Executive Summary](#2-Executive-Summary) 3. [Features and Functionality](#3-Features-and-Functionality) 3.1 [Intuitive User Interface and Experience](#31-Intuitive-User-Interface-and-Experience) 3.2 [Code Editor](#32-Code-Editor) 3.3 [File Manager](#33-File-Manager) 3.3.1 [Importing Projects from GitHub](#331-Importing-Projects-from-GitHub) 3.3.2 [Templates](#332-Templates) 3.3.3 [Package Management](#333-Package-Management) 3.4 [Terminal](#34-Terminal) 3.5 [Compiler](#35-Compiler) 3.6 [Deployment](#36-Deployment) 3.7 [AI Assistant](#37-AI-Assistant) 4. [Development Roadmap](#4-Development-Roadmap) 4.1 [Phase 1: Core Development (Month 1)](#41-Phase-1-Core-Development-Month-1) 4.2 [Phase 2: Feature Expansion and Refinement (Month 2)](#42-Phase-2-Feature-Expansion-and-Refinement-Month-2) 4.3 [Post-Launch](#43-Post-Launch) 5. [Resource Requirements](#5-Resource-Requirements) 5.1 [Team Composition](#51-Team-Composition) ## 2. Executive Summary The Internet Computer Protocol (ICP) Online IDE project aims to improve the development experience for ICP developers by providing a comprehensive, browser-based integrated development environment. This initiative addresses the common challenges faced by developers, particularly newcomers, in setting up their local development environments for ICP projects. Key aspects of the proposed IDE include: - A user-friendly, browser-based interface eliminating the need for complex local setups - Support for multiple ICP development languages: Motoko, Rust, and Azle - Integrated compiler and deployment features for seamless development and testing - An AI-powered assistant specifically trained for ICP development, offering contextual help and code suggestions - Built-in tutorials and project templates to accelerate the learning curve for new developers Drawing from our team's extensive experience in blockchain development tools, including collaboration with the Ethereum Remix team, we understand the impact a well-designed online IDE can have on a blockchain ecosystem. By combining this expertise with AI technology, we aim to create an IDE that not only simplifies the development process but also actively assists developers in writing better, more efficient code for the Internet Computer. This project aligns with the ICP's goal of expanding its developer base and making blockchain development more accessible. By lowering the entry barriers and providing intelligent, context-aware assistance, the Online IDE will play a crucial role in accelerating adoption and innovation within the ICP ecosystem. ## 3. Features and Functionality ### 3.1 Intuitive User Interface and Experience The IDE will feature a highly intuitive and user-friendly interface, setting it apart from many existing blockchain development environments. Drawing from our team's extensive experience in creating engaging user interfaces, we aim to deliver an attractive and intuitive development experience that stands out in the blockchain space. Our design philosophy focuses on clarity, efficiency, and aesthetics. The IDE's layout will be carefully crafted to maximize productivity while maintaining a clean, modern look. Key features such as the code editor, file manager, and deployment tools will be logically organized and easily accessible. To showcase our expertise in this area, we invite you to explore one of our previous projects with ICP that also offer an AI assistant [ICP AI Chatbot](https://icp-ai-chat-frontend.vercel.app/tutorial/typescript-smart-contract-101/1-introduction). ### 3.2 Code Editor The IDE's code editor will be built around the [Monaco Editor](https://github.com/microsoft/monaco-editor), a very popular open source code editor, developed by Microsoft and used by many IDEs including VSCode. The editor will be configured specifically for Motoko, Rust, and Azle. It will provide features like syntax highlighting and error checking tailored for these languages. The editor supports various features such as file management, package imports, and canister deployment, it also interfaces with a backend canister on the Internet Computer, which handles deployment and execution of the compiled code. ### 3.3 File Manager The IDE will feature a comprehensive File Manager component for efficient project organization and file manipulation. Key aspects include: The File Manager will use a hierarchical structure for intuitive file and folder organization within projects. Users will be able to create, save, and manage multiple projects, each with its own file structure. It will support essential operations like creation, deletion, renaming, and moving of files and folders within these projects. The File Manager will work closely with the code editor to ensure proper file loading, saving, and updating across different projects. This seamless integration will enable developers to efficiently manage their project structures while incorporating external libraries and code samples into their development workflow. #### 3.3.1 Importing Projects from GitHub Integration with external services will allow users to import files and projects from GitHub repositories. Users will be able to specify a GitHub repository URL, along with optional parameters such as a specific branch, directory, or file. The system will fetch the relevant files, process them, and add them to the IDE's file system. For package imports, the system will also update the compiler's package list, making the imported code immediately available for use in the user's project. #### 3.3.2 Templates The file manager will offer a Template Integration feature, providing users with pre-defined project templates for quick start-up. These templates will include sample code, configuration files, and necessary resources for various types of projects across supported languages. Users will be able to select from a range of templates, instantly populating their workspace with a working project structure. This feature will streamline the development process, especially for newcomers, by offering ready-to-use examples of common application patterns and best practices. #### 3.3.3 Package Management The IDE will incorporate a comprehensive package management system, supporting Vessel for Motoko, Cargo for Rust, and npm for Azle projects. This integration will allow users to easily import and use external libraries across different project types, all within the browser-based environment of the IDE. For each supported language, the IDE will maintain curated lists of available packages from their respective ecosystems (Vessel package set, crates.io, and npmjs.com). Users will be able to search for and add packages to their projects through a unified interface. The IDE will then fetch the package files from the corresponding repositories, typically using a CDN for faster access. These files will be added to the project's virtual file system, making them immediately available for import and use in the user's code. The integration will also handle package dependencies automatically for each ecosystem, ensuring that all necessary code is available for compilation and execution, regardless of the chosen language or framework. ### 3.4 Terminal The IDE will feature a built-in Terminal component, serving as a crucial output display for various operations and interactions within the development environment. This Terminal will be integrated into the main editor interface, typically positioned at the bottom for easy access and visibility. It will act as a central hub for displaying compilation results, deployment statuses, and other important messages, keeping users informed about the state of their projects and actions in real-time. The Terminal will receive and display log messages from different parts of the application, including language-specific compilers, deployment processes, and other user actions. As users work in the IDE, the Terminal will provide immediate feedback. For instance, during code compilation or deployment, it will show progress updates, any encountered errors or warnings, and the final result of the operation. The Terminal will also display information about package imports, canister deployments, and other system-level operations relevant to Internet Computer development. ### 3.5 Compiler The IDE will feature a sophisticated compilation system to support multiple languages targeting the Internet Computer. This system will combine in-browser processing with cloud-based compilation services to provide a seamless development experience. For languages that can be efficiently compiled in the browser, such as Motoko, we'll utilize Web Worker-based compilers. The Motoko compiler will leverage the approach used in the Motoko Playground, using a JavaScript version of the Motoko compiler (`moc`) created with `js_of_ocaml`. This allows for real-time syntax checking and WebAssembly generation directly in the browser. For languages requiring more complex compilation chains, such as Azle (TypeScript to Rust to WebAssembly) and Rust, we'll implement a cloud-based compilation service. Due to the complexity of the Rust compiler, we'll set up a dedicated compilation server. The IDE will send code to this server, which will compile it using the full Azle and Rust toolchain. Compiled WebAssembly and Candid interfaces will then be sent back to the browser. The compiler system will provide real-time syntax checking for all supported languages, integration with package managers for dependency resolution, and generation of WebAssembly modules and Candid interfaces for deployment. An efficient error reporting and warning system will display compiler output in the IDE's console. In-browser compilers will run as Web Workers to maintain UI responsiveness, while the cloud compilation service will use a queue system to manage requests from multiple users. A caching mechanism will be implemented to improve performance for repeated compilations. ### 3.6 Deployment Our IDE will leverage the Internet Computer's playground for deployment, providing users with a free, simple, and temporary testing environment. This approach aligns with ICP's philosophy, where the mainnet itself often serves as the primary deployment target due to its upgradeability and relatively low cost. The deployment process in our IDE will be streamlined to work seamlessly with the ICP playground. When a user initiates a deployment, the system will first compile the code (whether it's Motoko, Rust, or Azle) into WebAssembly (Wasm) using our compiler system. This process will also generate the necessary Candid interface description for the canister. Next, our IDE will interact with the playground's backend canister, which manages the deployment process. This backend handles the creation of new canisters or updates to existing ones, allocating resources from a shared pool. Each deployed canister in the playground receives an initial 0.5T cycles and can run for 20 minutes, providing ample time for testing and experimentation. The compiled Wasm and any initialization arguments will be sent to the playground's backend for deployment. After successful deployment, our IDE will update its state with the new canister information, including the canister ID and Candid interface. Users will then be able to interact with their deployed canister through a Candid UI integrated into our IDE, allowing for immediate testing and verification of functionality. ### 3.7 AI Assistant The IDE will feature an AI assistant, accessible through a chat interface on the right side of the development environment. This intelligent system will be designed to understand and assist with Motoko, Rust, and Azle development, offering support for both newcomers and experienced developers in the ICP ecosystem. The AI assistant will have access to comprehensive documentation for Motoko, Rust, and Azle, as well as relevant GitHub repositories. It can analyze the user's current code, offer suggestions, explain complex concepts, and provide code snippets. Additionally, the assistant will be able to answer questions about the IDE's built-in tutorials, helping users navigate the learning process more effectively. ## 4. Development Roadmap The development of the Online IDE is planned to span two months from the receipt of funding. The roadmap is divided into two main phases, with a focus on core functionality in the first month and expansion to additional features in the second month. ### 4.1 Phase 1: Core Development (Month 1) #### Week 1-2: - Set up project infrastructure and development environment - Implement basic Monaco Editor integration with Motoko syntax highlighting - Develop initial file manager functionality - Create basic UI layout and design system #### Week 3-4: - Implement Motoko compiler integration - Develop basic deployment functionality for Motoko projects - Create initial terminal component for compiler and deployment feedback - Implement basic project management features ### 4.2 Phase 2: Feature Expansion and Refinement (Month 2) #### Week 5-6: - Integrate Rust and Azle support (syntax highlighting, compilation, deployment) - Implement GitHub integration for project import - Develop template system and create initial set of project templates - Begin implementation of AI assistant feature #### Week 7-8: - Finalize AI assistant integration and functionality - Implement in-IDE tutorials - Refine UI/UX based on initial testing feedback - Integrate advanced features (e.g., package management, advanced deployment options) - Conduct thorough testing and bug fixing - Prepare documentation and launch materials ### 4.3 Post-Launch - Gather user feedback and implement high-priority improvements - Continue expanding language support and feature set based on community needs - Regular maintenance and updates to ensure compatibility with the latest ICP developments This roadmap is designed to be flexible, allowing for adjustments based on development progress and emerging priorities. The goal is to have a fully functional IDE with core features for Motoko development by the end of the first month, with expanded language support and advanced features completed by the end of the second month. ## 5. Resource Requirements ### 5.1 Team Composition The project will be executed by a skilled team with experience in Internet Computer development. Our team members have previously worked together on ICP projects. Team members include: - Dario Aschero - Designer (https://de.linkedin.com/in/darioaschero, https://github.com/darioaschero) - Jonathan Zihindula - Developer (https://github.com/Jonath-z) - Moritz Stellmacher - Developer/Manager ([moritzfelipe.com](https://moritzfelipe.com/), https://github.com/moritzfelipe) - Philipp Piwo - Developer (https://de.linkedin.com/in/philipp-piwowarsky, https://github.com/thepiwo) - Taras Herasymchuk - Developer (https://github.com/tarasherasymchuk) - Yannick Musafiri - Developer (https://www.linkedin.com/in/yannick-musafiri-2396a4156, https://github.com/musayann)