Klyra.toml

The file Klyra.toml can be used for project-local configuration. For the current options available, check out Deployment files.

Workspaces

Klyra supports cargo workspaces, but only one Klyra service per workspace. The first workspace member found with a klyra-runtime dependency and a binary target will be targeted for local runs and deployments.

If Klyra.toml or Secrets are used, those files should be placed in the root of the workspace.

This is an example of a workspace structure with shared code between a backend and frontend crate:

.
├── .gitignore
├── Cargo.toml
├── Secrets.toml      (optional)
├── Klyra.toml      (optional)
├── backend/
│   ├── Cargo.toml    (depends on klyra-runtime)
│   └── src/
│       └── main.rs   (contains #[klyra_runtime::main])
├── frontend/
│   ├── Cargo.toml
│   └── src/
│       └── main.rs
└── shared/
    ├── Cargo.toml
    └── src/
        └── lib.rs

Cargo feature flags

If the cargo feature klyra exists, Klyra activates it and disables default features.

Cargo.toml
# Compiling this package on Klyra will enable the features
# "klyra" and "bar". To use default features on Klyra, add
# "default" to the klyra array.
[features]
default = ["foo"]
klyra = ["bar"]
foo = []
bar = []

Multiple binaries

If you want to keep your project structured for allowing both running with and without Klyra, check out the standalone-binary example. This is great for gradually adding Klyra into your project.

.klyra/config.toml

The .klyra/config.toml is created when linking your project folder to a Klyra project. It is added to .gitignore by default, and should not be committed.