[Edit 2020-03-27] Instructions have changed yet again! This tool is now available in the ‘blessed’ Holochain dev tools release.
[Edit 2020-03-05] instructions for installing and running have changed.
Hello developers! This week we’re releasing the first iteration of a new tool for rapid application development. It scaffolds, compiles, and runs an entire app — both DNA and GUI!
Right now it only builds one app — a note-taking app — but those curious among you can take a look around and see how it’s architected. (More on that later.) Next iteration will build a full app (yes, even the GUI) from nothing but a GraphQL schema definition, and after that we plan to create a fully graphical builder!
Why are we doing this?
Our goal is to make it easy for anyone to build a hApp. More hApps means a stronger Holochain ecosystem, which means more groups of people who are empowered to take their online activities into their own hands!
- App devs who are new to Holochain and Rust can get going quickly with a template that shows them how Holo’s own hAppy team do things.
- Experienced hApp devs can give their keyboard a rest and let their computer generate all the boilerplate code for data storage, retrieval, display, and interaction.
- Non-devs can create collaboration tools for their teams and communities without deep programming knowledge.
This prototype is a partial answer to that first goal, and later iterations will tackle the others.
Try it out!
So we invite you to fire up the newest version of the Holochain dev environment (Holonix v0.0.72 with Holochain v0.0.46-alpha1 at time of writing):
$ nix-shell https://holochain.love
Then run this command in your usual project directory:
$ hn-happ-create my-notes-app
The first run will take a while (downloading and compiling dependencies), but once it’s done you can fire up the app thusly:
$ cd my-notes-app $ yarn start
Your browser will show you a simple UI that lets you write personal notes and back them up to your friends’ devices.
How is it architected?
This notes demo app uses:
- A Holochain DNA on the back end (of course)
- Apollo GraphQL middleware in the browser to translate zome calls into something easy for front-end frameworks to understand and manipulate
- React for UI and data flow
- create-react-app for development tooling.
As with most hApps, much of the business logic lives in the front-end and is delivered as static assets to the browser. The create-react-app dev tooling builds it all from source, gets it ready for the browser, and serves it up using Webpack’s dev server. (We’re using this instead of Holochain’s built-in static asset server because it supports live reloading of changes to the UI code.)
Share your experience!
We invite you to share your thoughts below in this thread! If you think you’ve found a bug, please go to the project’s GitHub issue tracker.