DEV Community

Cover image for Wrapping a dApp
Fuego Blanco
Fuego Blanco

Posted on

Wrapping a dApp

In the ever-evolving world of web applications, sometimes we find ourselves longing for the convenience and familiarity of a desktop app. That's where Nativfier comes into play. In this blog post, we will explore how to transform NftyChat, a web3 Discord alternative, into a wrapped Electron desktop app using Nativfier. Let's dive in!

Step 1: Setting up the Project
To get started, create a new directory called "wrappedElectron" and navigate into it using the following commands:

$ mkdir wrappedElectron && cd wrappedElectron
Enter fullscreen mode Exit fullscreen mode

Step 2: Installing Nativfier
Nativfier is a command-line tool that allows you to wrap web applications into native desktop apps. Install it globally using npm:

$ npm install -g nativefier
Enter fullscreen mode Exit fullscreen mode

Step 3: Creating the Desktop App
Now that we have Nativfier installed, let's create our NftyChat desktop app. Use the following command:

$ nativefier --name 'nfty chat' 'nftychat.xyz'
Enter fullscreen mode Exit fullscreen mode

Here, we specify the app's name as 'nfty chat' and provide the URL of NftyChat as 'nftychat.xyz'. Nativfier will now begin the process of transforming the web app into a native Electron desktop application.

Step 4: Exploring the Wrapped Electron App
Once Nativfier has completed its magic, you will find a new folder named 'nfty chat-darwin-x64' (or a similar name based on your operating system). This folder contains the wrapped Electron app files.

Step 5: Launching the App
To launch the newly created desktop app, simply navigate into the app folder using the following command:

$ cd nfty\ chat-darwin-x64/
Enter fullscreen mode Exit fullscreen mode

Inside this folder, you will find the actual app file with an extension like '.app' (e.g., 'nfty chat.app' on macOS). Double-click on it, and voila! Your NftyChat desktop app should open.

Conclusion:
With Nativfier, we have successfully turned NftyChat, a web3 Discord alternative, into a wrapped Electron desktop app. This allows us to enjoy the benefits of a native desktop experience while using this web application. Nativfier provides a simple and efficient way to convert web apps into desktop apps, opening up possibilities for enhanced productivity and user convenience.

GitHub: https://github.com/nativefier/nativefier

You can find me at @ https://nftychat.xyz/community/38728ab

Top comments (0)