Spec
A spec defines the interface of your Confect API. It is made up of group specs and function specs. Each function spec defines the function’s name, arguments schema, and returns schema — but not the function’s logic. Specs are built using@confect/core, which means they can be shared between the server and client. This separation is what enables end-to-end schema decoding and encoding: the client knows the exact shape of every function’s arguments and return value without importing any server code.
confect/notes.spec.ts
.spec.ts suffix used here is a naming convention, not a requirement. Only the entry-point files (spec.ts and impl.ts) have fixed names.
Your spec must be the default export of a spec.ts file in your confect/ directory.
confect/spec.ts
Impl
An impl provides the logic for each function declared in your spec. It is built using Effect layers: each function impl is aLayer that is composed into a group impl, and group impls are composed into the top-level impl.
confect/notes.impl.ts
impl.ts file in your confect/ directory, and must be finalized with Impl.finalize.
confect/impl.ts