BELFAST, Maine — Brianna Spaulding, 9, has been critically ill since she was born. But out of her struggle has come a book to inspire other children. As part of a national project, she’s now a published author.

Two serious illnesses, mitochondrial disorder and dysautonomia, prevent Spaulding’s stomach from digesting food. It means that, each day, she must be fed through a feeding tube for 13 hours. She can only join her classmates in school when a nurse is present. Most of the time, she’s tutored at home.

The diseases prevent her cells from producing the energy they need to function, and can cause exhaustion, dehydration, and unstable temperature and blood pressure. Her mother, Shanna Grindle, knows the signs: Spaulding’s face turns white, and she could faint. “She can be fine, walking around the store, and turn white, and you know you just have to lie her down and get fluid into her,” Grindle said.

Her daughter’s body can’t digest a regular meal, so her diet consists mainly of pureed food. She must have surgery every six months to replace her feeding tube — an ordeal that requires two days at the hospital, since she needs one day of preparation with special IV fluids. Spaulding has had 28 surgeries since 2012.

But her world is about more than illness. It’s also about sea glass, cartwheels and imagination. She dreams of a grape soda river: Whoever drinks out of it will never be hungry again. In this world, a bird names Annsley seeks to drink from such a magical river and be transformed. She flies with her friends to the shore to solve a riddle about mystic sea glass. It’s all in Brianna’s book, “Searching for Sea Glass.”

Spaulding was selected to co-write the book as part of the work of an organization called the Red Fred Project. It aims to have children with critical illnesses in each state help write a book with founder Dallas Graham.

On Thursday, Graham will be in Maine for Spaulding’s book-signing party. It will be held from 6 p.m. to 8 p.m., Thursday, at the Waldo County YMCA, located at 157 Lincolnville Ave. in Belfast. Proceeds from the book sales will go to the family to help with medical bills.

Grindle said she mainly wants people to come to celebrate with her daughter: “She’s very proud of her book. I hope people can come and celebrate and just make it memorable for her. I’ve told people, even if you don’t buy a book, just come celebrate with Brianna.”

Why did sea glass become a special theme in the book? Spaulding loves visiting the ocean, Grindle said, and she can spot sea glass like no one else. One day, Grindle gave a challenge to her daughter: See how fast you can find green, blue, brown and white sea glass. Her daughter was done in four minutes.

“She loves sea glass, horses, so she wanted it all in the book. She wanted magic and love, and it’s all in the book,” Grindle said.

“It’s not about the quantity of life. It’s about the quality of life and living life to the fullest each day.”