Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/mikelevins/electron-lisp-boilerplate

A rudimentary boilerplate for building Electron apps with embedded Lisp helper processes
https://github.com/mikelevins/electron-lisp-boilerplate

Last synced: 2 months ago
JSON representation

A rudimentary boilerplate for building Electron apps with embedded Lisp helper processes

Lists

README

        

= electron-lisp-boilerplate
v0.0.1
mikel evins
:toc:

== Overview

A very simple Electron boilerplate that sets up an app whose application logic is handled by a Lisp child process and whose UI is handled by Electron. Uses sbcl with quicklisp and Hunchentoot to build the Lisp helper process, and electron-packager to build delivered apps.

== Prerequisites

You'll need the following prerequisites to work with this boilerplate:

. https://nodejs.org/en/download/[node and npm]
. https://github.com/electron/electron-packager[electron-packager]
. http://www.sbcl.org/platform-table.html[sbcl]
. https://www.quicklisp.org/beta/[quicklisp]

== Usage

. Clone electron-lisp-boilerplate
. Remove the .git subdirectory
. Rename the project from electron-lisp-boilerplate to the name of your project +
There isn't yet a quick and easy way to do this; you'll have to search for all occurrences of "electron-lisp-boilerplate" in the project and replace them. I intend to address this deficiency in a future version.
. Run the command `./buildapp.sh`

The `buildapp.sh` command

. uses sbcl to build the `lispapp` program from sources in the `lisp` subdirectory
. installs the needed Node modules in your project's directory
. uses electron-packager to build the Electron app

The resulting app is saved into the subdirectory `electron-lisp-boilerplate-`, where `` is the OS name and the hardware type--for example, `darwin-x64`.

When you launch the delivered app it creates a window and populates it a "Hello, World" message and a simple form you can use to verify that round-trip processing between the Electron and Lisp processes is working.

Once that's working, you can start building your own app by replacing and extending the code in the `lisp` subdirectory.

You can remove the files generated by the build by running the command `./clean.sh`

== Making it your own app

The built app is an Electron application that spawns a Lisp process when it launches. It then sends an HTTP request to its child Lisp process, which returns an HTML document that contains the initial UI of the application. The Electron process presents the UI, and the Lisp child process handles requests generated by user interactions.

To build your application, write Lisp code in the `lisp` subdirectory, implementing HTTP handlers using Hunchentoot's handler framework. To add UI elements, write Lisp code that embeds those elements in the pages served by Hunchentoot.

This version of the boilerplate uses https://htmx.org/[htmx] to build HTML widgets, and the https://github.com/n-elements/core[native-elements CSS framework] for styling.