AI Income LabJoin AI Income Lab ↗

Build an Electron habit tracker with OpenCode

Jump to video chapters

Watch on YouTube ↗ Subscribe on YouTube ↗

By · · 14:22 · 21,872 views

Written guide: OpenCode Desktop: Habit Tracker With Electron

Build a React and Electron habit tracker with OpenCode, diagnose the blank desktop window, and verify that habits persist after reopening.

Video summary

How to build a desktop app with OpenCode (step-by-step): OpenCode desktop install on Linux/Windows/Mac, then generate a React + Electron daily habit tracker with local storage — including white-screen troubleshooting. Free open-source AI coding agent tutorial.

OpenCode tutorial for beginners who want a Claude Code alternative that can ship a real Electron app.

The video covers 10 parts: Introduction to OpenCode and its library of free AI models, Comparing OpenCode’s free access to paid Claude and ChatGPT plans, How to install the OpenCode desktop app on Linux/Debian, Navigating the interface and setting reasoning levels, Starting the Daily Habit Tracker project build, Choosing the tech stack (React and Electron), Monitoring the automated code generation process, Switching models to MiniMax M2.5 for faster building, Troubleshooting and fixing the white screen display error, and Implementing local storage for data persistence.

What this video covers

What you build

A daily habit tracker desktop app. OpenCode generates a React and Electron project, a switch to a faster model finishes the build, the blank window is fixed and data is saved in local storage.

Tools used

Compare pricing: OpenCode. Some ↗ links are affiliate links, so I may earn a commission or credit. See every tool I recommend →

Key steps

Not covered

Summary based on the saved video description, chapters and transcript. Free models and plans change, so check OpenCode for current options.

In this video

  1. 0:00 Introduction to OpenCode and its library of free AI models
  2. 0:44 Comparing OpenCode’s free access to paid Claude and ChatGPT plans
  3. 1:21 How to install the OpenCode desktop app on Linux/Debian
  4. 2:04 Navigating the interface and setting reasoning levels
  5. 3:24 Starting the Daily Habit Tracker project build
  6. 4:14 Choosing the tech stack (React and Electron)
  7. 5:40 Monitoring the automated code generation process
  8. 8:31 Switching models to MiniMax M2.5 for faster building
  9. 11:02 Troubleshooting and fixing the white screen display error
  10. 13:05 Implementing local storage for data persistence

Questions and answers

Do you need a paid subscription to use OpenCode?

No, Mike says, because OpenCode has free models built in, and he compares that with paid Claude and ChatGPT plans.

What stack does the app use?

React for the interface inside an Electron desktop shell.

What fixed the white screen?

Mike troubleshoots it with the agent partway through the build, then moves on to local storage.

Build notes: a successful build still needs a launch test

This walkthrough uses OpenCode to create a small React habit tracker inside Electron on Debian. The important result comes after two fixes: the desktop window loads correctly, and a saved habit survives closing and reopening the app.

Notes checked October 9, 2026 against this walkthrough’s captions. Model prices, free access, and installation options may have changed.

Define the small app first

The initial brief asks for a desktop habit tracker with daily completion marking. Mike chooses React, then clarifies that the desktop wrapper should be Electron. OpenCode creates the Vite project and installs the packages. During generation, Mike switches models and continues the task.

Verify the actual desktop result

  1. Run the generated start command. In this walkthrough, the build succeeds but the desktop window is blank.
  2. Compare it with the development-server version. The browser version renders, narrowing the problem to the packaged loading path.
  3. Report the precise difference to the assistant. The recorded fix changes Vite’s base so built asset paths are relative. This fixes this project’s loading problem; it is not a universal fix for every Electron blank window.
  4. Launch again and add a habit. Then close and reopen the app to check persistence.
  5. Add local storage when the habit does not survive a restart. Repeat the same check. The walkthrough confirms the saved data appears on reopening.

Know the finish line

The demonstration establishes a basic local prototype. It does not test synchronization between devices, packaged installers on other operating systems, or backup and recovery. The elapsed-time remarks are informal observations, not a controlled model-speed comparison.

Use the small-change workflow guide to practice the same brief, inspect, change, and verify loop in an existing repository. For the provider-selection setup, watch OpenCode as a Claude Code alternative.

Transcript

Hey there, welcome to the channel. In this video, I'm going to be taking you showing you step by step how to get started setting up the OpenCode desktop app, which is now available for MacOSS, Windows, and Linux. I've got the website pulled up here. As you can see, OpenCode is a truly free and open- source AI coding agent. They have all sorts of free models built directly in, including Claude, Chetchip, Gemini, and more.

You can see over here they've got a lot of different options to choose from. Big Pickle, Miniax, Kimi 2.5, Neotron, which is Nvidia, Quinn 3.5, 3.6, Ring, Trinity large preview, and many more. You don't need to pay for a subscription plan to Claude, which starts at $20 per month. For the pro plan, that gives you access to Claude code, and then it also goes up to the max plan, which is $100 per month or more. And we've also got ChatGpt Codex over here.

Read the rest of the transcript

The plus plan is $20 a month and it goes all the way up to $100 a month. Gemini, which starts at $8 a month and goes up to over $250 per month for the Google AI Ultra plan. Nice thing about OpenCode is that they have all the free models built in over here. So, you can get started on any budget. You can install it either in the terminal or as a desktop app, which is now beta.

And if you want to get started, you can just run this brew install command. Or you can download it for Mac OS, Windows, or Linux. In this case, I'm on Debian. We're going to type in this command over here. And what that's going to do, it's just going to install the latest version of OpenCode Desktop app on my Linux machine. So, it's downloading all the packages now. And right here it actually says Mac OS is required for this software.

But luckily I already have it installed over here. So we can go ahead and open up the OpenCode desktop app. And I will need to update to the latest version. So I'm just going to go ahead and install and restart. And you can see right away this provides a very intuitive and clean interface versus over here in the terminal. From here you can easily set your model on OpenCode Zen which is the free plan.

And then you also have OpenCode Go in here as well, which starts at $5 per month for the first month and then it goes up to $10 per month that provides a lot of other models. And then we've got Open Router built in here as well, which provides a lot of other free models as well. But in this case, I'm on OpenCode Zen. So I'm just going to set the model to Neotron 3 Super Free, which is an Nvidia model.

We can also set the reasoning level. So I'm just going to choose high. And we can either do build or plan. In this case, I'm just going to plan. And we could just get started right away. So, I'm going to say hello. And that's going to start up a new session. And you can see here it's using the Neotron 3 super free model. I can also go ahead and open a terminal inside the OpenCode desktop app. And we can go into our projects directory.

And I'm just going to go into the OpenCode example. And from here we can list the files. Of course, there are none. And we can go ahead and run OpenCode right here. So we can also run OpenCode in the terminal inside the desktop app as well. In this case, I want to open a project. So I'm just going to click on open project right here. We're going to go ahead and open that up. And now we are in the this specific project.

uh build a simple app to track my daily habits. So you can see now it's asking me some qualifying questions to determine what type of app I would like to build in more detail. So it's asking what type of app would you like to build for tracking daily habits. In this case, I'm just going to build a desktop application. And we're going to click on next. And now it's asking what features would you like in your habit trackers.

I would just like basic habit tracking built into the app to mark habits as completed each day. We can click next. And now it's asking what technology stat do you prefer? HTML, CSS, React, Python, or no preference. I'm just going to choose React in this case. And then we can click on submit. And now it's going to get to building the basic habit tracking app. One thing you have to keep in mind when building with OpenCode is that you're using free models.

So, it's potentially going to take longer than if you were doing this in Claude Code or Codex or Gemini, but it still gets the job done. And that way, you don't have to use a bunch of credits or pay a monthly subscription. Like over here in Claude Code starts at $20 a month. For Codex, it starts at around $20 per month for the plus plan to access the Codex app.

And then for Gemini, it starts at around $20 a month for Google AI Pro to get access to all of the coding agents. Whereas over here in OpenCode, you can get started completely for free. So now it's asking, you mentioned wanting a desktop app with React. React is typically used for web applications. And it's just saying what what would you like me to do? Build a web app with React. Build a desktop app using Electron with React. That's an option.

So, I'm just going to go ahead and set that because I usually build web applications, but in this case, I want to build an actual desktop app that can run on my Linux machine. Now, it's going to get started building a desktop app using Electron with React. So, you can see here it's creating the project directory right here, showing exactly what it's doing, and it's just going to start building out this app completely for free.

If you just click here, you can see exactly what it's doing. So it's creating the app right here and it's just removing some directories. It's creating the app with vite. So it's installing the package here. It's checking the Node.js version which should be the latest version. It's creating the React app with the subdirectory. And you can see exactly what it's doing over here. And if I come over to my directory here, we should see the files being created.

As you can see here, it's now creating all the files. So under node modules, these are all of the different packages that it needs to build the app. So it's gone ahead and installed all the NodeJS packages and we've also got the source code files. So it's going ahead and creating the components over here. Open this. We can see here's all the CSS for the website. It's also creating the JSX file as well. This is like 120 lines of code that it wrote completely for free.

And we can also come up to source here. And you can see the assets that it's creating. So these are just some icons that it's creating for the site and it's building out all the files. You can easily expand any of these to see exactly what it's doing. So it's just a really nice uh userfriendly intuitive interface over here. And then if I did want to create a Git repository, I also have the option to do that as well.

And then we can easily just push up changes to Git anytime I want to. And you can also see all of the files over here as well. So you don't have to go back and forth to your finder over here. You can just see all the files that it's creating over here. And then if I want to preview these, I can just click and as you can see, it'll open it up. Make this a little bit bigger.

You can see what the file looks like over here. So you can easily preview any of the changes as it's writing the code. And you can see over here it's still continuing to build out the files. And this shouldn't take very long at all to build a fully functional desktop app that tracks my daily habits. How cool is that? So far, we're about 15 to 20 minutes into building the daily habit tracker. And you can see it's still continuing to create all of the files.

Right now, it's working on the main.tsx file. So, if I want to come over here and preview that, I can just open it up quickly and easily within the OpenCode desktop app. This is a really short one that it's creating. We've also got the app.js JSX file so we can easily preview that one as well. These are going to be responsible for displaying the guey of the app. I believe it's creating the index.html file.

If I want to preview that, I can see that over here as well just by clicking and expanding. Very very simple file that's just excluding the main.js file. And we should have a finished version of the app relatively soon. If I wanted to switch to a different model like Miniax 2.5, I also have the option to do that. If it the Nvidia model is a bit slow, I could just switch over to Miniax.

And then basically what we'd have to do is just pause that and then do continue so that it pulls in the new model. And this one tends to be quite a bit faster, I found. I'm really pretty happy with the MiniAX model. So, you can see it's just going to continue where it left off and keep building the app with Miniax 2.5, which is also completely free. You can see it's now starting the development server.

So, we've basically got like a working functional app uh in the process here. Starting up the development server on this port. Now, it's installing Electron for the desktop app. So, that's just going to install the Electron package inside node modules. Uh so yeah, we can actually preview the Electron uh app over here as well. So it's gone ahead and installed that. And now it's just writing the main.js file. You can see what it's doing here as well as index.html.

And we should have a semifunctional app relatively soon that we can now open up on our desktop on our machine. And now it's doing another rebuild for the production app. And it looks like it was able to successfully build. You can see right here, built in 391 milliseconds. And here we are. It says the desktop app is now ready. It also includes what was built.

So it says your daily habit tracker includes add delete habits, track completion for at least 7 days, street counting, and also a clean modern UI. To run the app, it gives me instructions as well. So I just have to go into this project directory and then run npm start. So in this case, I'm just going to come over to the terminal here. We're going to open up a new tab. And I'm going to go to projects, OpenCode example, and then into the habit tracker.

And we're going to do npm start just like it said over here. And that's going to download the electron binary, which it's doing right now. And it's just going to launch it in its own window on my Linux machine. There we go. So now we have a desktop app ready to go. Unfortunately, it's just like a white blank screen. There doesn't seem to be any way to use it currently. So, that's not very good. I'm just going to close that out.

Uh, looks like it did have an error. So, we're going to have to fix that up. If I want to run this in the browser, we should be able to do npm rundev. And you can see it is now started up vite. And we can open this up in the browser. So, here it is, the daily habit tracker running in the browser. We can go ahead and say, you know, create a YouTube video. And it's just going to add that in here.

As you can see, I can set the days as well that I have created new YouTube videos. I think I've created a new video every single day this week. So, we're going to do Monday, Tuesday, Wednesday. This definitely needs a little bit of work. But overall, that looks pretty good. And it also shows my streak here as well. Keep in mind, this is just a very, very simple example of a daily habit tracker. uh that we've built in about 15 minutes using OpenCode. Completely free.

I didn't spend a single credit building this. So, pretty pretty cool. And I'm just going to go ahead and close out the server. We're going to try starting up the desktop app again. And unfortunately, yeah, it's not actually showing any anything over here. So, if I wanted to fix that, I could just come over here and say exactly what the issue is. I just said the desktop app is just a white screen. The local server looks fine. and go ahead and fix this.

And it was able to identify what the error was that the built HTML used absolute paths which doesn't work in electron. So it went ahead and added the base to vite config so that the paths are now relative. And sure enough, if I come over to the terminal here and I do npm start, it is now working correctly. As you can see, I could say, you know, YouTube video and we can go ahead and add that habit. And it shows a streak here. here.

And then if I go ahead and close this, what I would like is for it to remember the data. So I would need to add some sort of local storage to the desktop app. Uh we'll see. I don't think that's actually working yet, but we can easily add that in over here. If I just said, uh add local storage to the app. It says your habits now persist in local storage between sessions. Just run npm start in the habit tracker folder to use the desktop app.

we can see exactly which files it changed over here. So if I just come up to the terminal again, we're going to do npm start and I'm going to add a daily habit. We'll just put YouTube video once again. We're going to select a few dates. And now if I go ahead and close this and reopen it, it should have saved that data. So there we go. It's saving the data now using local storage. Very cool. So hopefully you've enjoyed this tutorial.

Please go ahead, subscribe to the channel if you haven't already, and please go ahead and check out the OpenCode AI coding agent. I highly recommend installing this as a desktop app, and then you get access to all of these free models. Also, please go ahead and check out my Skool community, which is available over here. We've got about 2,700 members in here at the time of recording. It's completely free to join. And then I also offer paid plans as well.

You will get access to the classroom with lots of helpful tutorials as well as the community tab where you can ask your questions. And with that being said, thank you so much for watching. Please subscribe to the channel. Take care. Stay safe. Peace from Thailand. Signing off.

Not ready to join? Get the weekly build notes: new guides and tested builds in one short email.

You may also like