Here is an overview of how the Tauri integration is set up in Barashka, how the Discord RPC works, and how you can prepare the application for production.
- When the music player (
js/player.js) plays or pauses a track, it calls theupdateDiscordPresence()function fromjs/discord-rpc.js. - This function uses the Tauri API (
invoke) to send a message to the Rust backend, passing track details (Title, Artists, Pause State). - The Rust backend receives this via the
set_discord_presencecommand and passes it to thediscord-rich-presencecrate. - The crate communicates with the Discord client on your computer via IPC (Inter-Process Communication) and updates your profile status instantly!
The default Discord Application ID is a placeholder (123456789012345678). To set up your actual Discord app:
- Go to the Discord Developer Portal.
- Click New Application and give it a name like "Barashka".
- Copy the Application ID.
- In
src-tauri/src/lib.rs, replace123456789012345678with your new Application ID. - In the Developer Portal, go to Rich Presence > Art Assets, and upload an image named
logo. This will be shown alongside your playback status.
When you are ready to ship your application to users, running npm run tauri build will compile the code into a standalone installer.
-
Install C++ Build Tools (Windows Only): You MUST have the Visual Studio C++ Build Tools installed to compile Windows apps. You only need the "Desktop development with C++" workload.
-
Update Application Metadata: Open
src-tauri/tauri.conf.jsonand ensure the following are correct:productName(e.g., "Barashka")version(e.g., "1.0.0")identifier(e.g., "ru.barashka.desktop") — must be unique.- You should also update the
src-tauri/icons/directory with your real logo.
-
Building the Application: Run:
npm run tauri build
This process will take a few minutes. Once finished, the installer will be located at:
- Windows:
src-tauri/target/release/bundle/nsis/Barashka_*.exe - macOS:
src-tauri/target/release/bundle/dmg/Barashka_*.dmg - Linux:
src-tauri/target/release/bundle/deb/and.AppImage
- Windows:
-
Distribution: You can take the generated installer and upload it to GitHub Releases, your website, or any other hosting service. Users simply run it to install Barashka on their machines!
- NSIS installer is created by default
- Requires Visual Studio C++ Build Tools
- Output:
.exeinstaller innsis/folder
- DMG and .app bundles are created
- Requires notarization for distribution outside App Store
- Output:
.dmgindmg/folder
- DEB package and AppImage are created
- Works on most Debian/Ubuntu-based distributions
- Output:
.debindeb/folder and.AppImageinappimage/folder