Skip to content

Build and extend

Cofy is open source and built from separate packages, so you can extend it, or take only the parts you need. The details live next to the code, in each package’s README; this page tells you where to look.

Package What it is
packages/api cofy-api: the Cofy API itself, its modules, sources and formats
packages/management-api Stores community settings, and who may change them
packages/runner Serves each community’s settings as its own Cofy API
packages/frontend-sdk A typed TypeScript client and state stores for the management API
packages/web-components The building blocks of the console: generated forms, a YAML editor, lists and theming
apps/management-web The console, built from the two above
energy-cost The library that calculates energy costs; see energy cost

Every source belongs to a family, such as prices or production, and fits wherever that family does. A new source subclasses its family and fetches its data; once its package is installed, it shows up in settings files and in the console’s forms. packages/api shows how, and how a separate package registers its types with an entry point.

The console takes your brand colour, language and icons without code changes. apps/management-web describes how, and how to add a page.

The repository README sets up a development environment and runs the demos. Questions, ideas and bug reports are welcome as GitHub issues.