How it works
Write your system in CruftFree code. CruftFree checks it and generates the entire application. You keep every file.
From CruftFree code to running system in three steps
Describe
Describe your system in short, readable CruftFree code: what each service does, what data it stores, what users see on each screen, and who can view, create, or change what. Focus on how the application should work, not on the files needed to build it.Check
CruftFree checks your CruftFree code before generating anything. If a type doesn't match, a name isn't defined, or a value might be missing, it points to the exact file and line and tells you how to fix it.Generate
Once your CruftFree code passes validation, CruftFree generates the entire system in the stack you choose. You're not locked into a language, platform, or framework. You write what makes your product unique. CruftFree generates the rest.You write CruftFree code. CruftFree generates the rest
You write what a help desk ticket contains, who can read it, and what the ticket list page shows. CruftFree generates the database model, the service route with its sign-in check, and the code and template for the page. Every generated file is available in the public examples repository.helpdesk, shortened from ticket-service.cfree and help-app.cfree Open the whole example on GitHubopens in a new tab
// ticket-service.cfree: the data, and who may read it
entity Ticket extends BaseEntity {
String(20) number : unique;
String(200) subject : filterable;
TicketTopic topic : filterable;
Priority priority : filterable = Priority.Normal;
TicketStatus status : filterable = TicketStatus.New;
String(64) customerId : index;
}
get mine() : auth(required, providers: [identity]) -> Array<TicketCard> {
return cardsOf(ticketDb.Ticket.where(customerId: Auth.userId()).orderBy(createdAt: desc).limit(100).all());
}
// help-app.cfree: the customer's list of tickets
page Tickets() {
data { tickets = TicketService.TicketAPI.get.mine() : poll(30s); }
view {
list(data: tickets) : onClick(Nav.to(TicketDetail, id: item.id)) {
heading(Msg.ticketLine(number: item.number, subject: item.subject));
row { badge(item.status); badge(item.topic); }
}
}
}
Every layer from one CruftFree codebase, so every layer agrees
DatabaseAPISign-inWeb appMobile appTestsCloud
A single new field can mean changes to the database, the API, the web and mobile apps, and the tests. With CruftFree, you add the field once in your CruftFree code and regenerate. Everything that uses it updates together, including the database migration scripts.Keep the code you generate
You own your CruftFree code on every plan, and the generated code on a paid plan. The generated code runs without CruftFree, with no runtime license fees and no exit fees.Already have a system or a prototype? You can start from it.Start from what you already have