Who knew you could cook up a musical with sugar, flour and butter (among other ingredients)?

Singer-songwriter Sara Bareilles (best known for soulful, piano-based songs like “Love Song” and “Gravity”) is making an impressive Broadway debut with “Waitress,” a musical adaptation of the 2007 film of the same name, which stars Jessie Mueller (“Beautiful”) and has direction by Diane Paulus (“Hair,” “Pippin”).

It marks the first musical in Broadway history where the four-person creative team (book writer, songwriter, choreographer and director) is made up entirely of women.

Set around a small-town diner, Jenna (Mueller) “bakes from the heart,” reacting to her boorish and possessive husband and expressing her sadness through creative pie design. Over the course of the show, Jenna confronts an unwanted pregnancy, has an affair with her doctor and watches how her colleagues find happiness in unexpected ways.

It’s a tall order to combine romantic comedy with troubling depictions of spousal abuse, leading to an uneasy, disjointed feel (think “She Loves Me” pierced with shards of “Carousel”). Nevertheless, the characters are authentic and surprising, and it ends with a heartwarming climax where Jenna finally gains the strength to take charge of her life.

Bareilles’ country-flavored, cute and quirky, introspective songs are nicely integrated into Jessie Nelson’s book. The lyrics are down-to-earth, intended to reflect the working-class milieu. In a winning touch, Bareilles has penned a pre-curtain song warning audience members to turn off their cell phones.

The production is intimately scaled, which is appropriate. However, a few questionable choices stick out, like putting the band prominently onstage on a moving platform and having ensemble members mimic Mueller’s gestures in the background.

Mueller looks browbeaten most of the time, but she has a warm aura and a stunning voice, and she depicts Jenna’s long-delayed transformation with credibility and conviction. Christopher Fitzgerald also makes a strong impression as the overeager, dorky suitor to one of Jenna’s colleagues.

Slices of pie are available for purchase before the show and during intermission. The theater lobby also smells like pie. Can you say that about “Hamilton”?