I use superstatic to run webCoRE locally, there is a superstatic.json config file in the repo so once installed just run
superstatic in the webCoRE repo directory. Files are served up from the dashboard directory, and any edits you make there should show up on refresh. There is almost zero setup to run it on a real server, you just have to map all paths (e.g.
/piston/:abc123:) back to the index.html file.
The various webCoRE APIs are private and may be restricted to access from specific referral hosts, but I’m not sure. I believe that only the APIs used directly by pistons (e.g. emailing, fuel streams,
$nfl) are restricted and those restrictions would apply to the SmartThings endpoint rather than where you host the dashboard. A local install will still connect to the shared webCoRE API endpoints (backup bins and initial dashboard registration).
SmartThings provides a token for communicating with your SmartApps and the “Register a browser” process is how the token gets from the webCoRE SmartApp to your browser. The dashboard host is irrelevant in that exchange, so you can host it anywhere without making any changes. The dashboard server has zero state or storage, it just serves up static files. All of the connection details remain in the browser’s local storage.
I always edit in VS Code then paste into the IDE, any text editor will work. You will quickly notice looking at the code that it is a horrible mess of space and tab indentation since it was primarily developed at the whim of the ST IDE. There is no linting or .editorconfig or any of the typical resources to aid contribution.
A few other relevant notes
- Always check out the
dev branch for local development and submit any pull requests to that branch to avoid conflicting with other work in development.
- There is no package manager; third party dependencies are just copied into the repo and many of those dependencies seem to have been edited. Best not to upgrade or otherwise mess with them.
- The code in dist/dashboard is generated by a private build script on the dashboard server and should not be edited. You would either have to set up a minification and upload pipeline for your host or just serve the raw files.
- There is a beta group of a few dozen people with a private category in this forum, but it is still difficult to get changes tested.
- With every release there are at least a handful of people that are certain the update broke something so each release is a time commitment. Often I get unlucky and a release coincides with SmartThings outages, a recipe for a ruined weekend. There is a release nearly ready to go out, but the world is just too crazy right now to push out a mandatory update.
If you are interested in future webCoRE development (i.e. for the inevitable but still distant Groovy platform shutdown), please PM me with some details on your experience. There exists some new code following better practices but I have been waiting on some milestones from ST before moving forward.