Sofia Alvarez had been screenwriting for years, but seeing her work come alive in her first film — Netflix’s “To All the Boys I’ve Loved Before,” based on Jenny Han’s best-selling novel of the same name — was a new milestone.

When the film was released in August, Twitter exploded, with women and girls forming fan clubs for heartthrob character Peter Kavinsky (played by Noah Centineo). There were critiques and think pieces about the romantic comedy, which centers on half-Korean, half-white teen Lara Jean Covey (Lana Condor) and her cerebral approach to romance. And Yakult, a brand of the popular Asian dairy drink that appears in the film, saw a bump in sales, according to Bloomberg.

“It was exciting and unexpected,” said Alvarez, 33, a Baltimore native known by most as “Fia.” As a writer, “you sort of just never know what’s going to happen.”

The Juilliard School graduate was born into a family of writers. Her mother is Deborah Rudacille, a science journalist, professor at University of Maryland, Baltimore County, and a Guggenheim Fellow. And her father is former Baltimore Sun reporter Rafael Alvarez, who also wrote for HBO’s “The Wire.”

“We spent a lot of time at The Baltimore Sun when we were kids,” Alvarez remembered. Her father would often occupy Alvarez and her siblings with paper and pencils in a conference room, Rafael Alvarez said, or he’d drop them off at the Enoch Pratt Free Library.

“We were always reading and writing,” Alvarez said. “It was always in the family” — and still is.

Her brother, Manuel Jacob, a chemical engineer by trade, is also a cartoonist and a graphic novelist. Her older sister, Amelia, became an actress, fashion blogger and writer working in TV and film, and Alvarez carved out her own niche.

“I always really wanted to be a playwright,” said Alvarez.

During high school, she wrote and directed a school play called “Blue Hours,” inspired by poet Sylvia Plath’s poetry. She worked at the Charles Theatre — a film education in itself, she said, and after attending Bennington College in Vermont for literature and theater, she immersed herself in playwriting at Juilliard while supporting herself as a nanny.

Though her dream was to have a play produced in New York City, playwriting was not lucrative. After she graduated, “I had to make something happen,” she said.

Alvarez booked a one-way ticket to Los Angeles, where she spent months at the home of a friend’s parents while searching for TV screenwriting opportunities. In 2012, she sold “Brooklyn Nannies,” a show based on her experience, to ABC studios and the USA network, marking her first foray into television, she said.

The show never got made, but it catapulted Alvarez into the next stage of her career. She worked as a staff writer for USA’s “Sirens” in 2013 and later FXX’s “Man Seeking Woman.” But her desire to see one of her plays premiere in New York never died.

Alvarez left “Man Seeking Woman,” when her play “Friend Art” was produced at Second Stage Theater. One week’s pay from “Man Seeking Woman” was nearly equivalent to what she’d make for the entire play.

“It was a hard decision, but ultimately the right one,” said Alvarez, whose original goal was to work in theater.

After the play wrapped, Alvarez landed the opportunity to write the screenplay for “To All the Boys,” a book she found to be charming, sweet and lighter than the rom-coms she has written. She worked on the screenplay for around a year, adapting from her own experiences and imagination while attempting to stay “true to the warmth of the book.”

Some lines from the movie that Alvarez had taken from her own life — like a question a one of her friends liked to ask about whether it’s preferable to drink water for the rest of one’s life or drink anything one wants with a drop of pee in it — were immortalized in a Buzzfeed quiz.

Rafael Alvarez immediately recognized the line as his daughter’s. The film was ripe with her distinct humor and personality, he said.

“Sofia has always been a sweet, polite young woman — always the girl you’d want your kids to be friends with,” Alvarez said.

“She’s my daughter, but she’s her own person. She’s her own writer. … I couldn’t be prouder.”

Sofia Alvarez and book author Jenny Han didn’t meet until the film was complete, she said. (Han’s publicist did not immediately respond to emailed requests from The Baltimore Sun.)

The movie, released in August, was praised in particular for featuring an Asian female lead. Though the story touches on Lara Jean’s Korean heritage, the story isn’t just about her identity — it’s about her high school problems, her crushes and her apprehension of living out her romantic ideas. That’s what Alvarez liked about Han’s book, she said — it’s a traditional rom-com.

“Lara Jean lives life in her head and has to learn to live life in the flesh, and she happens to be a half-Korean character, but that’s not the thrust,” Alvarez said, adding that she sees this approach as a modern trend.

Her experience with “To All the Boys” has been an enjoyable and encouraging one, she said. Alvarez hopes to do more rom-coms and more writing (she said there are projects in the works that she can’t talk about now), and despite her success in film and TV, playwriting will always be a priority.

“I started as a playwright, and playwriting was my first love. It’s how I self-identify and how I train,” said Alvarez.

“I will never not be a playwright.”

bbritto@baltsun.com

twitter.com/brittanybritto