Foliage SDK
Foliage is a collaborative application platform built upon a distributed graph database, providing a unified and extensible environment for effortless automation, cross-domain connectivity, and high-performance, edge-friendly runtimes.
Table of Contents
Introduction
Foliage is an open-source collaborative platform that uses a distributed graph database, offering a unified, extensible environment for automation, cross-domain connectivity, and high-performance, edge-friendly runtimes. It provides a robust foundation for IoT solutions, automation workflows, and edge computing applications.
Core Concepts
Abstract
Foliage introduces abstraction, where knowledge about complex systems converges into a unified space, promoting transparent understanding and blurring the boundary between system models and the system itself.
Features
Foliage promotes transparency, consistency, and clarity among system components by consolidating knowledge from diverse domains into a unified space. It reveals hidden dependencies, simplifying system evaluation and relationship management.
Click here to see all features.
Getting Started
Minimum Requirements
Native Install
Foliage platform native install requirements correspond to the NATS Jetstream installations requirements listed here:
https://docs.nats.io/running-a-nats-service/introduction/installation#with-jetstream
Same is for supported OS:
https://docs.nats.io/running-a-nats-service/introduction/installation#with-jetstream
Docker Container Install
Foliage platform install via docker requires as minimal resources as docker engine itself:
https://docs.docker.com/desktop/install/linux-install/
Installation
To begin using Foliage, clone the repository:
git clone https://github.com/foliagecp/sdk.git
For detailed installation instructions and prerequisites, visit the official documentation.
Health Status Check
- Check that NATS server and Foliage runtime are running fine:
% docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
...
b5a2deb84082 foliage-sdk-tests:latest "/usr/bin/tests basic" 11 minutes ago Up 11 minutes tests-runtime-1
fac8d1bfef3a nats:latest "/nats-server -js -s…" 11 minutes ago Up 11 minutes 0.0.0.0:4222->4222/tcp, 0.0.0.0:6222->6222/tcp, 0.0.0.0:8222->8222/tcp tests-nats-1
- Check that NATS server is running fine:
% docker logs tests-nats-1
...
[1] 2023/10/16 09:00:43.094325 [INF] Server is ready
- Check that Foliage runtime runs without errors:
% docker logs tests-runtime-1 | grep "error" -i
Running Tests
Foliage provides a set of test samples to help you get familiar with the platform. Follow these steps to run them:
1. Navigate to tests
:
cd tests
2. Build the tests runtime:
docker-compose build
3. Modify the .env
file:
Customize the test environment by editing the .env
file. For the basic test, find it at ./basic/.env
.
4. Start the tests:
docker-compose up -d
To select a different test sample, set the TEST_NAME environment variable before running docker-compose up -d. The basic test sample starts by default.
5. Stop and clean up:
When you're done testing, stop and clean up the environment:
docker-compose down -v
Customization
Explore available test samples and customize them to gain insights into Foliage's development principles. Refer to basic test sample documentation.
For statefun logic definition, consider using plugins like JavaScript.
Development
Working with the SDK
Use SDK To develop applications with Foliage:
go get github.com/foliagecp/sdk
- Learn to work with the graph store here
- Explore Foliage's JSON Path Graph Query Language (JPGQL) here
- See how to visually debug your graph here
- Find out how to write your own application here
- Measure performance with guidance here
Technology Stack
Foliage relies on a versatile technology stack that includes:
- Backend
- Jetstream NATS
- Key/Value Store NATS
- WebSocket NATS
- GoLang
- JavaScript (V8)
- Frontend
- React
- TypeScript/JavaScript
- WebSocket
- Common
Learn more about our technology choices.
Roadmap
Check out our Roadmap for more upcoming features and enhancements.
References
License
Unless otherwise noted, the Foliage source files are distributed under the Apache Version 2.0 license found in the LICENSE file.
Contribution
Foliage welcomes contributions from the open-source community. Join us in building a collaborative application platform that empowers developers worldwide!