This repository is a template for creating nh-we applets. It is meant to be cloned and provide the basic repository structure and scripts for developing and testing your nh-we applets.
DISCLAIMER: Please note this is only a template that mostly provides repository structure and helpful npm scripts, you will still need to write your own zome functions, entry types, validation functions, and the relevant tests. To speed up this process you can try the Holochain Scaffolding tool to get basic CRUD functionality and tests scenarios. However, you will still have to implement much of the logic of your application.
@neighbourhoods/nh-launcher-applet
& @neighbourhoods/sensemaker-lite-types
npm i
dna
, tests
and ui
folders)provider
to match your hApp zome name (including in file or directory names), remember to review the .yaml
files too./ui/src/appletConfig.ts
& ./we-applet/src/appletConfig.ts
. See Creating Applet ConfigproviderStore.ts
)npm run start
.webhapp
file to be imported by nh-we with npm run package
If you want to use the scaffolding tool to generate your holochain code, you can easily replace the dnas
directory in this repository with the dnas
directory generated through the scaffolding tool. In the future we hope to have a smoother integration between the two, but for now the steps look like:
hc scaffold example forum
(or more specific uses of the command)dnas
folder and replace the dnas
folder in this repository with that one.Cargo.toml
with the one from the scaffolding tool.provider
to whatever you are calling your dnas.
once you are ready to test your applet in we, you will need to run nh-we in developer mode to upload the webhapp file. To do that:
nh-launcher
develop
branchnix develop
, npm i
, npm run start
) to get we running in dev mode (it should launch into the browser)INSTALL APPLET FROM FILESYSTEM
button
.webhapp
file and click install
The Applet Config is where the Sensemaker compatible social interactions of your applet are defined, you can specify:
In the future we are providing a visual Wizard to make the creationg of such config files easier.
Install the holochain dev environment (using nix): https://developer.holochain.org/docs/install/ (see https://hackmd.io/BKCt3FckSiSDJ4aSJ1Ur6A for a more comprehensive guide, especially if you are used to using nix-shell
and default.nix
)
Enable Nix commands and Nix flakes for your use:
mkdir -p ~/.config/nix
echo "experimental-features = nix-command flakes" >> ~/.config/nix/nix.conf
Clone this repo and cd
inside of it.
Enter the nix shell by running this in the root folder of the repository:
nix develop
npm install
This will install all the needed dependencies in your local environment, including holochain
, hc
and npm
.
Run all the other instructions in this README from inside this nix environment, otherwise they won't work.
It is possible to work with these repos without nix, but you will need to install the needed cargo packages to your local system. Run the following commands:
cargo install holochain --version 0.1.0
cargo install lair_keystore --version 0.2.3
cargo install holochain_cli_launch --version 0.0.11
cargo install holochain_scaffolding_cli --version 0.1.6
make sure they are properly installed with:
holochain --version
lair-keystore --version
hc-launch --version
hc-scaffold --version
npm run test
npm run build:happ
To package the web happ:
npm run package
You'll have the provider.webhapp
in workdir
. This is what you should distribute so that the Neighbourhoods Launcher can install it.
You will also have its subcomponent provider.happ
in the same folder`.
This repository is using this tooling: