Comment on page
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.
- 1.set up your development environment by following the steps in Environment Setup, and if you are having issues with nix see Without Nix
- 3.Clone this repository & run
- 4.add your zome code (copy/edit files under to
- 5.replace all instances of
providerto match your hApp zome name (including in file or directory names), remember to review the
- 6.create your applet config and add it to both
./we-applet/src/appletConfig.ts. See Creating Applet Config
- 7.build your front end store object (see
- 8.test your UI with
npm run start
- 9.package your applet as a
.webhappfile 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
dnasdirectory in this repository with the
dnasdirectory 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:
- 1.create a separate repo
- 2.inside that repo, run
hc scaffold example forum(or more specific uses of the command)
- 3.copy the generated
dnasfolder and replace the
dnasfolder in this repository with that one.
- 4.replace the root level
Cargo.tomlwith the one from the scaffolding tool.
- 5.you will still need to change references to
providerto 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:
- 2.git fetch and switch to the
- 4.create a we group
- 5.create your user in the group
- 6.go to applet library
INSTALL APPLET FROM FILESYSTEMbutton
- 8.navigate to you applet
.webhappfile and click
The Applet Config is where the Sensemaker compatible social interactions of your applet are defined, you can specify:
- Dimensions and Ranges: to define in what ways your users can assess (for example, react or rate) your applet resources (computed dimensions can only receive values from Methods)
- ConfigResourceTypes: they allow you to map hApp entry-types to sensemaker resources that can receive assessments
- ConfigThresholds: they define how a Cultural Context will filter resources to be shown
- ConfigCulturalContexts: these allow the SenseMaker to filter and order resources according to rules defined in Thresholds and ordered according to order_by.
- AppletConfigInput: this object holds together all defined configurations for your Applet.
In the future we are providing a visual Wizard to make the creationg of such config files easier.
mkdir -p ~/.config/nix
echo "experimental-features = nix-command flakes" >> ~/.config/nix/nix.conf
- 3.Clone this repo and
cdinside of it.
- 4.Enter the nix shell by running this in the root folder of the repository:
This will install all the needed dependencies in your local environment, including
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:
To package the web happ:
You'll have the
workdir. This is what you should distribute so that the Neighbourhoods Launcher can install it.
You will also have its subcomponent
provider.happin the same folder`.
This repository is using this tooling: