{"id":41830448,"url":"https://github.com/cafjs/caf","last_synced_at":"2026-01-25T08:36:40.891Z","repository":{"id":6313814,"uuid":"7548741","full_name":"cafjs/caf","owner":"cafjs","description":"Give superpowers to your IoT device or Web App with an autonomous  Cloud Assistant.","archived":false,"fork":false,"pushed_at":"2023-04-19T01:42:05.000Z","size":965,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-10T01:42:56.871Z","etag":null,"topics":["actor-model","iot","proactive","serverless-framework"],"latest_commit_sha":null,"homepage":"https://www.cafjs.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"Tmeister/wp-api-jwt-auth","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cafjs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE-2.0.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-01-10T21:11:14.000Z","updated_at":"2022-02-10T22:32:57.000Z","dependencies_parsed_at":"2022-07-09T06:30:27.393Z","dependency_job_id":null,"html_url":"https://github.com/cafjs/caf","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/cafjs/caf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cafjs%2Fcaf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cafjs%2Fcaf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cafjs%2Fcaf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cafjs%2Fcaf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cafjs","download_url":"https://codeload.github.com/cafjs/caf/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cafjs%2Fcaf/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28749605,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T08:31:04.260Z","status":"ssl_error","status_checked_at":"2026-01-25T08:30:28.859Z","response_time":113,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["actor-model","iot","proactive","serverless-framework"],"created_at":"2026-01-25T08:36:40.071Z","updated_at":"2026-01-25T08:36:40.883Z","avatar_url":"https://github.com/cafjs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Caf.js\n\n\u003ca href=\"https://www.cafjslabs.com\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/cafjs/caf/master/assets/logosquare.svg?sanitize=true\" alt=\"Caf.js\" width=\"200\"\u003e\u003c/a\u003e\n\nCo-design cloud assistants with your web app and IoT devices.\n\n[Website](http://www.cafjslabs.com) |\n[Documentation](https://www.cafjslabs.com/docs/documentation) |\n[Installation Guide](https://www.cafjslabs.com/docs/documentation#install) |\n[Caf.js Cloud](https://root-launcher.cafjs.com) |\n[Twitter](https://twitter.com/cafjs)\n\n\n[![Build Status](https://github.com/cafjs/caf/actions/workflows/push.yml/badge.svg)](https://github.com/cafjs/caf/actions/workflows/push.yml)\n\n## Overview\n\nA Cloud Assistant (CA) has\n\n* some private and reliable state,\n* a public URL that exposes authenticated methods,\n* a queue that serializes requests, eliminating races,\n* and the ability to run autonomously for years with minimal cost (85 cents per year, Gold plan [Caf.js Cloud](https://www.cafjslabs.com/hosting)).\n\nCAs are implemented with the Actor Model.\n\nA billion CAs can be hosted with a few thousand servers. Every IoT device or Web App instance could have one. Why do you want one?\n\n#### Permanent Presence\n\nDevices and app instances are sometimes off-line, or hard to reach behind a firewall, or suffer from long or unpredictable network latencies.\n\nThis makes it very difficult to share them safely across the Internet, or integrate them in VR or AR using an avatar.\n\nA CA solves the connectivity problem by implementing a Reverse Service Worker (RSW), which represents the device or app instance at all times.\n\n#### Proactive Programming\n\nWe all have heard of reactive programming, where your code process a stream of events.\n\nThe dual to reactive is proactive. Compute without waiting for an event to arrive.\n\nWhat can you do with proactive programming?\n\n* Hide latency with a push model, as in PSSR (Proactive Server Side Rendering),\n* or create a GraphQL subscription source from legacy services,\n* or upload background tasks to the Cloud with cloud-based multi-tasking.\n\n#### Reliable Orchestration\n\nJamstack is all the rage, but the reality is that you still need a backend to orchestrate service API calls, because doing that in the browser is unreliable and not very safe.\n\nMicro-services are all the rage, but now the complexity has been shifted to tracking requests among thousands of micro-services. If something fails, can you safely retry? If the state is distributed across many micro-services, who is responsible to clean up the mess?\n\nYou can view a CA as a reliable state machine, which always checkpoints before externalizing state changes. Or a smart card for your API credentials. Or a reverse proxy that caches dynamic content, keeping your clients in sync.\n\n#### Collaborative Multi-Tenancy\n\nCAs interact with each other safely using the trusted bus. High level communication primitives ensure that these interactions scale to millions. Fast datacenter networks provide predictable low latency.\n\nWhen devices or apps want to interact, they can use their CAs to guarantee secure, scalable, and fast communication. This gives them superpowers:\n\n* Coordinate actions with global time on millions of devices across the World,\n* or bootstrap trust between strangers,\n* or control thousands of Web App Backgrounds (WABs) in your next Zoom-like meeting,\n* or provide a twitter-like service for devices with a hundred lines of Javascript.\n\n\nBut this is just the tip of the iceberg of what CAs can do. Learn more in our [website](https://www.cafjslabs.com)\n\n\n## About this repo\n\nThis repository is managed as a monorepo using yarn workspaces. It contains a consistent snapshot of all the other `Caf.js` sub-projects, included as git submodules. To create a `Caf.js` release, we test them all together.\n\nIt is recommended that you create your app within this monorepo, in a subdirectory of `caf/playground/app`, and then yarn workspaces will also manage your app dependencies.\n\nDitto with your modules. Just create them under `caf/playground` and they are part of the common workspace. No need to publish them during development!\n\n## Install\n\nInstall `node` LTS \u003e=12 and `yarn` \u003e=1.3.2. Our development is mostly on Linux. Note that `npm` does not understand Yarn workspaces, you need to use `yarn`.\n\nClone this repository (`git clone https://github.com/cafjs/caf.git`) and update submodules:\n```\n    cd caf; git submodule update --init\n```\nInstall all the dependencies (it takes about 30s in my laptop):\n```\n    yarn run installAll\n```\nadd to your path the `cafjs` tool path:\n```\n    export PATH=\u003cyour_install_directory\u003e/caf/bin:$PATH\n```\ndownload the Docker images\n```\n    cafjs update\n```\nand now let's build and run locally a simple app:\n```\n    cd apps/caf_helloworld; cafjs build; cafjs run helloworld\n```\n\nThe app server URL is http://root-launcher.localtest.me (DNS always resolves `*.localtest.me` to `127.0.0.1`, i.e., the local loop). With your browser, login with user `foo` and password `bar`, and then click the `+` icon to add a `helloworld` CA. Fill the form as follows:\n\n* Application publisher: `root`\n* Application name: `helloworld`\n* CA name: anything containing ASCII characters and numbers.\n\nand a `counter` example should appear. Use the `+` again to create other CAs, and then select the menu on the top left to switch between them.\n\nTo stop it, a single `Control-C` will initiate a gentle container shutdown but, for the impatient, a second `Control-C` will brute force a clean-up.\n\nIn both cases we should be able to restart without losing the CA's state. This state is checkpointed using a Redis container that mounts a host volume (log file in `/tmp/redis/appendonly.aof`, host port 6380). To start from scratch, delete the log file in the host.\n\n## Documentation\n\nThe Caf.js documentation is now in our  [website](https://www.cafjslabs.com/docs/documentation)\n\n\n## Contributing\n\nWe welcome contributions to Caf.js of any kind. See [Contribution Guide](CONTRIBUTING.md) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcafjs%2Fcaf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcafjs%2Fcaf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcafjs%2Fcaf/lists"}