As a child, freshman Jess Avellino was obsessed with “Willy Wonka and the Chocolate Factory.” But Avellino’s most recent accomplishment — writing a musical that was performed at the Fringe Festival in Scotland over the summer — goes beyond a candy dream.

“Black Heart” follows the story of Emma, a girl whose sister died in a boating accident. The plot goes back and forth between present reality, where Emma is in a mental institution because of supplementary issues post-accident, and her consciousness. Here, her sister appears as a character alongside Emma’s emotions, which take on character forms as well.

Avellino received the assignment to write a show late in her junior year of high school, when her theater director approached her directly.

“My director normally takes a group to do an off-Broadway show in New York City and then to the festival in Scotland every other year,” Avellino said. “He typically writes it himself, but asked me and said he would mentor me in the process and help me develop my scenes.”

She only had a year to write the musical, which she did in addition to applying to colleges and completing all other work that she was assigned during her senior year of high school. She said it was stressful, but rewarding.

This past May, there was a trial run on a community theater stage in Avellino’s hometown in Westchester County, New York.

“It was good in that it happened, but bad in that I saw a lot of holes and that it didn’t make a lot of sense,” Avellino said. “Being able to see it fully through, though, let me figure out what I needed to change.”

Avellino got to work. She only had a month before rehearsals for New York City started up again at the end of June, and she couldn’t change anything after the off-Broadway performances.

“I basically re-wrote the whole show in a month,” Avellino said. “I added six or seven new songs and adapted older songs to make more sense. I was writing the show basically up to the week before the performance.”

After making her changes, Avellino rounded up her group of high school performers, comprised of freshman, sophomores and a few juniors, and got ready for the show.

When they got to Scotland, “Black Heart” was ready to go. The festival had stages all throughout Edinborough. Theater reviewers came to write about preliminary performances prior to the main ones.

“I was nervous because this would dictate how many people come to your show because they’ll read the reviews,” Avellino said, noting her surprise when “Black Heart” received three and four stars out of five.

The inspiration for the show was largely based on Avellino’s experience with one of her best friends, who struggled with depression.

“It was really sad to watch someone deteriorate,” Avellino said. “I knew her parents were neglecting that something was wrong, and I watched it unfold. It made me realize how serious these things are and how no one really realizes it.”

Her personal experience is why she hoped to make people understand the seriousness of mental illness with her words and song.

Currently, Avellino has taken this real-world experience to Elon, a school she chose for its academic prowess in the music department. So far, she is in the electric ensemble run by Todd Coleman, associate professor of music, and hopes to continue writing songs that make an impact.

“I wanted to be able to make some sort of impact in that way, and be able to at least change someone’s thoughts on this,” Avellino said. “These things are real,”

“Whether it’s the parent knowing it’s happening by noticing your child acting in these ways and not to neglect them. Or also as a friend to know that your friends are going to be there for you, but also you as a person — you’re not alone.”