Skip to content

Conversation

@jacobstern
Copy link
Contributor

I've been looking into developing a desktop music player app for my own personal use, and since my main expertise is in JavaScript development I got an interest in Tauri as a desktop app development solution. Along the way, I stumbled upon the impressive work here and thought I would try my hand at adding a Tauri standalone client based on this application.

It turned out to be surprisingly simple - a testament to your modular implementation and technology choices here.

This PR adds a proof of concept Tauri client implementation. It currently runs only in dev mode and may or may not work OOTB on your system (tested on MacOS only). It wraps the web UI in a desktop shell and runs its own backend independently of the server, though it's not fully independent since it won't initialize the database or scan the music directory, as that would require extra UX considerations.

Screen Shot 2022-11-26 at 7 18 37 PM

Ultimately I think the goal here would be to make the client fully independent so a user could install the packaged app on their system without also installing the server/CLI application. In all likelihood that's contrary to your vision for the project, in which case I'm happy to continue to poke around in my fork.

Regardless, I thought you would be interested in what it looks like.

Overview of changes:

  • Add Tauri boilerplate from the CLI (assets, Tauri main, etc.)
  • Add REACT_APP_NATIVE_WRAPPER env variable in the client to identify if the app is running in the Tauri shell
  • Use Tauri asset protocol to serve cover images. Unfortunately this does require the client to use different URIs where applicable. Also this adds an async initialization step for the client since the Tauri API's are all async.
  • Set up app in the Tauri main function following other main.rs files
  • Add a custom GraphQL communication layer for Tauri. There's sort of an existing solution for this but it's not very well maintained. Anyway as you can see it ended up being pretty simple.

Et voila! Desktop app.

@tsirysndr
Copy link
Owner

Hi @jacobstern, thanks for your interest in the project.
I just tested it locally, it's really a great job you did.

Yes, this is how I imagined the desktop version would look like.

I think we should keep the GraphQL server behind but make it optional in the config file (enable/disable), so we can control the player remotely (with a mobile application for example)

@jacobstern
Copy link
Contributor Author

@tsirysndr Right on! Added an optional GraphQL server here.

@tsirysndr tsirysndr added the enhancement New feature or request label Nov 30, 2022
@tsirysndr tsirysndr merged commit e4bed39 into tsirysndr:master Dec 3, 2022
@jacobstern jacobstern deleted the tauri-port branch December 18, 2022 02:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants