DEV Community

Swanand Hirve
Swanand Hirve

Posted on

Day 1: I'm building a secure text editor with Electron in public

I often feel like everyone around me is ahead, so I’m doing something about it: 30 days, one project, built in public. I’m learning Node.js, Express and Electron by making simple projects, for starters a simple mini text editor.

Day 1: a window that opens.

It’s an empty dark window right now, but it’s mine. I customized the background, edited index.html.

What I learned: Electron has two sides. main.js runs in Node and creates the window. index.html is just a web page that the window displays. I didn’t understand this split until I saw it work.

What confused me: I didn’t understand how index.html connects to everything else and how it all works together. Here’s how I understand it now: main.js creates the window and loads index.html with win.loadFile('index.html'). index.html is just a normal web page. That’s the whole connection. This is called through "app" module which controls the whole application's lifecycle

Next: I want the page to be able to open and save files, and remove the the toolbar which is currently viewable

Repo: Repo Link

Top comments (0)