yorkie-team / codepair

Build your own AI-powered collaborative markdown editor in just 5 minutes
https://codepair.yorkie.dev
Apache License 2.0
49 stars 19 forks source link

Add support for Desktop application using Electron #285

Open devleejb opened 2 months ago

devleejb commented 2 months ago

What would you like to be added: Currently, the project only supports web applications. It would be beneficial to add support for Desktop applications as well. Utilizing framework like Electron could enable the project to expand its compatibility to desktop platforms.

Why is this needed: Adding support for Desktop applications would enhance the versatility and reach of the project, providing users with more options to interact with the application beyond just web browsers.

Additional Information:

minai621 commented 1 month ago

@devleejb I Interested in this issue, Can I try it?

If I proceed with the issue, I wonder if I can use cross platform framework like tauri in addition to electron.

devleejb commented 1 month ago

@minai621 Sure, I'll assign this to you.

However, I'm not familiar with desktop applications. Could you share the pros and cons of the different solutions you're considering?

I believe it would be good to discuss this before proceeding with the implementation.

minai621 commented 1 month ago

@devleejb It seems like Tauri and Electron are the most popular libraries for building native desktop applications. After comparing the two.

Tauri

Electron

Additionally, there’s NW.js, but it has a less mature ecosystem compared to Tauri and Electron, though it offers a simpler, unified JavaScript environment for accessing native features.

devleejb commented 1 month ago

It would be good to use JavaScript, just like in other projects.

There seem to be many things to discuss regarding the project setup, so let's discuss them together here.

minai621 commented 1 month ago

It would be good to use JavaScript, just like in other projects.

In Tauri, Rust is primarily used for interacting with native system features such as the file system, OS APIs, or hardware. However, the complexity of Rust is mostly abstracted, so unless there is a need to implement specific native system functionality, the majority of the code can be written in JavaScript/TypeScript.

Focus on converting an already developed website into a native application, Tauri might be the better choice due to its lightweight nature and lower resource consumption.

minai621 commented 3 weeks ago

@devleejb After considering the deploy for current work, I think Tauri might be a better option than Electron, mainly due to the smaller packaging size. Once we move forward with distribution, we’ll need to set up a proper process for it.

compares the two framework: https://www.levminer.com/blog/tauri-vs-electron

devleejb commented 3 weeks ago

@minai621 I understand that Tauri has advantages in terms of resource usage. However, considering the open-source projects, I believe Electron is easier to manage due to its larger ecosystem. What are your thoughts on this?

Both frameworks seem to have their pros and cons. @hackerwins May I ask for your opinion?

hackerwins commented 3 weeks ago

@devleejb @minai621

Thank you both for your valuable input. After careful consideration:

I hope we proceed with Electron, primarily because:

However, we'll keep our options open:

This approach leverages our current team's strengths while allowing flexibility for future developments. I hope we start with a small prototype in Electron and reassess as we progress.

Your continued input is welcome as we move forward.

minai621 commented 2 weeks ago

@devleejb

I’ve encountered platform-specific limitations when building with Electron. To build a macOS app, it must be done on a macOS environment, and the same goes for Windows builds—they need to be built in a Windows or Wine environment.

We need to discuss two issues

minai621 commented 2 weeks ago

@devleejb

I’ve encountered platform-specific limitations when building with Electron. To build a macOS app, it must be done on a macOS environment, and the same goes for Windows builds—they need to be built in a Windows or Wine environment.

We need to discuss two issues

  • How to handle platform-specific builds macOS builds must be performed in a macOS environment, and Windows builds can be done using Docker with Wine, though this has some limitations.
  • Pipeline considerations After the builds, we need to create an environment where the resulting packages can be downloaded for codepair testing.

Additionally, could we resolve the issue by making our app a PWA instead of an Electron app?

devleejb commented 2 weeks ago
  1. Handling platform-specific builds We can use Electron Builder Action, which supports multiple environments.
  2. Deployment considerations For now, I believe uploading GitHub release artifacts is sufficient.
  3. PWA While PWA is also a good option, its support varies depending on the user’s OS and browser (e.g., Safari). Additionally, for installable applications, registering on the App Store in the future could provide more opportunities for users to discover CodePair.