Sara Bareilles sang Cyndi Lauper’s “Time After Time” when she graduated from Eureka High School in 1998. Almost two decades later, Bareilles joined Lauper as one of the rare pop music stars to have composed music for a Broadway hit. Lauper’s show, Kinky Boots, has been running since 2013, and Bareilles’ Waitress has been open for nearly 2½ years.

“There are moments in my life that are part of a ‘pinch me’ scenario,” Sara says backstage at the newly refurbished SHN Golden Gate Theatre, where the Waitress tour makes its Bay Area debut on Tuesday 16 October. “I sometimes can’t believe that things have materialised in my life that are so surprising and so rewarding in so many ways.”

One of those moments was when Bareilles and Lauper performed a mashup of Lauper’s “True Colors” and Bareilles’ hit “Brave.” Another was when Carole King (another pop star with a Broadway show, “Beautiful”) came into Bareilles’ life.

“Carole arrived as a beacon of hope and guidance at a time when things got tricky in my career,” she says. “She arrived at a time I really needed a hero to be in the flesh, and she stepped into those shoes in a big way.”

Other “pinch me” moments involve performing for President Barack Obama and his family – “They are unforgettable, and those are moments I cherish to the deepest part of my core.” And the most recent of those moments? “A musical I wrote is coming to San Francisco,” Bareilles says.

Having grown up romping through the Northern California redwoods of Humboldt County, the local debut of “Waitress,” an adaptation of the 2007 film of the same name with a book by Jessie Nelson and a score by Bareilles, is a big deal for the 38-year-old composer and her family.

“My mom is renting a bus and coming down with a group of about 30 ladies to see the show,” Bareilles says. “To be able to share the work we’ve been doing on Broadway with this community makes it feel very much like a hometown show to me. It’s magical.”

When Broadway director Diane Paulus sat down with Bareilles in 2012 and asked if she’d ever considered writing the score for a Broadway musical, the pop star only had to recall her foundational experiences in community and school theatre as a kid to sign on to the project that would become Waitress.

“I grew up as kind of an awkward kid. When I was introduced to community theatre, I didn’t feel awkward. I felt embraced and encouraged. I didn’t need to apologise for myself or feel that it was unsavory to love the spotlight or to be silly or dramatic – all these things that course naturally through my veins. Theatre people made me feel safe and loved.”

Now, looking back on the creative process that resulted in Waitress, which would earn four Tony nominations including best musical and best score for Bareilles, the singer-songwriter says her life is divided into BW and AW: before Waitress and after Waitress.

“Quite literally everything in my life has changed because of this project and the people who came with it. All the things I’m working on now – a new album, a TV show for Apple about a young singer/songwriter in New York – are fruits of the seeds sown either through relationships with or connections from people involved in that show.

“I was surprised to find I was seen differently as an artist because of the show. In some ways, this show deepened my own sense of feeling established in the music industry. I’ve been making records for a long time, but this is the first time I feel like I’m not crashing the parties. I’m proud of everything I’ve done, but this is a particularly special piece because it’s so deeply collaborative. I’ve had wonderful collaborators in the pop world, but working as a solo artist can feel solitary. And with a musical, well, I can’t imagine anything more collaborative, but then again, I haven’t done everything. Maybe surgery is more collaborative?”

Before Waitress came along, Bareilles had attempted to write a musical with Sugarland’s Jennifer Nettles about a women’s college in the ‘90s called “LESBIANS!” Nothing came of that intriguing project, and then Bareilles attempted to break into the world of Broadway performance by auditioning for a revival of Stephen Sondheim’s “Into the Woods” as Cinderella. She was not happy with her audition, and that was that.

With Waitress, Bareilles not only became a Broadway composer but also a Broadway performer. In March 2017, she took over the leading role of Jenna, a waitress with a talent for creative pie baking as a way to escape her abusive marriage. “Jenna is so courageous and relatable and vulnerable,” Bareilles says. “She’s not perfect and is really trying but is not getting it right all the time. That’s what I love about the show itself – it’s not black or white or binary good or bad or red or blue. It’s a show about good people making mistakes and doing the best they can, even if they’re just muddling through.”

She played the role for 10 weeks and returned to the role earlier this year for six weeks. She says playing the part gave her the courage to begin thinking about other roles, like Mary Magdalene, a role in NBC’s “Jesus Christ Superstar: Live in Concert” that nabbed her an Emmy nomination. She also co-hosted the Tony Awards with her friend (and fellow pop star turned Broadway baby) Josh Groban.

“If they’ll have me, I hope there’s a home for me in theatre for the rest of my life. But I had no f-ing clue how much I was signing up for with Waitress. I have worked harder and longer and more hours on this than anything in my life, probably combined. It was the biggest mountain by far, but the rewards have been immeasurable. I would love to take on another show. But I know what I’m getting into now.”