Skip to content
carameldocs · 0.16.0
Browse documentation
Guides / Project structure

A place for every change.

Start with your intention. Caramel’s conventions give it a home, and its tools help you check the result.

ContractValue
CoversEndpoints, stored data, pages, background jobs, languages, the domain model, seed data, tenants and the production build
You will haveThe files that own each kind of change, the commands that check it, and the page that states its rules
Proved byfrappe check · frappe corretto

Find the file for a change

Each row names the files, the commands that check them, and the page that states the rules.

I want to…It goes inCheck it with
Add or change an endpoint Routes and contracts →config/routes.cr app/actions/ spec/requests/frappe routes · frappe check · frappe corretto
Change the data the application stores SugarORM →app/models/ app/changesets/ db/migrations/frappe db diff · frappe migrate · frappe corretto
Change what the browser renders Views → Test rendered HTML →app/views/ app/assets/ spec/requests/frappe check · frappe corretto
Move work into a background job Cold Brew →app/jobs/ spec/requests/frappe check · frappe corretto
Translate the application Internationalization →app/locales/ config/application.crfrappe translations · frappe check · frappe corretto
Model the domain in SweetTalk SweetTalk →app/domain/ spec/domain/ .claude/skills/sweettalk/SKILL.mdfrappe check · frappe db diff · frappe corretto
Seed development data Local environment →db/seeds.crfrappe seed
Serve many accounts from one application Multi-tenancy →The tenant block in config/routes.cr app/models/frappe make tenancy · frappe routes · frappe corretto
Build for production Production →The committed tree; public/ in the artifactfrappe build · APP jobs unknown

Your application’s files are the extension point. Best practices says what to do when the public API falls short →

Meet the framework

Seven components, one job each, all standing on PostgreSQL, and one opt-in language on top of them.

ComponentWhat it does
BlueprintHTML written in typed Crystal
SugarORMSchemas, changesets and queries
Cold BrewBackground work, backed by PostgreSQL
CorrettoApplication tests with real data
CremaLogs, metrics and traces
FrappéYour developer command line
LatteLocal services and named HTTPS
SweetTalkAn opt-in language for the domain model, experimental

What does not compile

A change in the wrong place is caught by frappe check, before any request. Each page linked above states its own rules; these are the ones a newcomer meets first.

ConditionOutcome
A route parameter without a field in the action’s contractfails compilation
An association a view reads without a preloadfails compilation, reported as N_PLUS_ONE
Two schemas that name one tablefails compilation
A mocking library compiled beside Correttofails compilation

Not covered yet

  • app/commands/ is generated empty and config/application.cr does not require it; a command registered with Caramel::Crema.command lives in a file you require yourself.
  • spec/system/ and storage/ are generated empty; no page describes browser tests or file storage.
  • Caramel ships no command that provisions servers or deploys.

Prove it

Check the change you made

Terminal · inside your application
frappe check
frappe corretto

Passing: frappe check exits 0 and frappe corretto ends with Corretto: N of N workers passed.