There are not many people who have a story worthy of a book after just 25 years of life.

Tierra Rogers is one.

There are even fewer people who would, alone and with no experience, write and publish that book.

Rogers did.

“I have something to say,” Rogers said this week at a coffee shop not far from her San Francisco home. “There was something deeper driving me to do it.”

Rogers was perhaps the best female high school basketball player in San Francisco history. Her sad story has become etched in city lore. She was playing a game for Sacred Heart Cathedral on a January night in 2008 when her father Terray was gunned down outside the school at halftime.

In the wake of the tragedy, Rogers accepted a basketball scholarship at Cal. But, before she played a game for the Bears, she collapsed at practice and was diagnosed with a potentially fatal heart condition. Her basketball career, and dreams of playing in the WNBA, were over.

She dealt with depression and thoughts of suicide. But with therapy and faith, she kept going. She graduated from Cal.

And she decided to write a book about her story: one of overcoming the odds of her background, overwhelming tragedy and the crumbling of dreams, to make a life worth living.

The book, “Life in Overtime,” was released in August. Rogers has sold several hundred copies through word of mouth. She is hoping to use her basketball connections to reach a wider audience.

“I feel like I have a bigger purpose in my life,” said Rogers, 26.

Rogers grew up in Bayview-Hunters Point and writes vividly about life in her childhood neighborhood.

We had all been conditioned to run inside as soon as we heard gunshots. None of us thought much of it at the time. It was just the backdrop of our daily lives, and we’d become accustomed to it. It wasn’t unusual to hear gunshots echoing through the neighborhood like an ice cream truck. I just hated to stop playing when the shots rang out.

“Eh, T is that an AK-47 or a 9-caliber?” my friends would joke. As disheartening as it sounds, this was the norm.

“Can I go back outside now?” I’d always plead to my parents.

“Give it a few more minutes,” Dad always said. “Let’s just make sure they’re done shooting.”

Rogers barely recognizes her old neighborhood these days. She sees people walking their dogs at night, fewer minorities.

“It’s gentrification,” said Rogers, who did a film project on the subject at Cal.

Despite her rough surroundings, Rogers felt safe in her home with her parents and her brother. Though her father dealt drugs, and went to prison for it, he also turned his life around and became a community leader, appointed to a task force to combat gang violence. He was a man to whom people turned for help and inspiration.

Terray Rogers’ murder was not solved. Tierra doesn’t want to talk about what she knows or theorizes. She still needs to be careful.

Her world imploded with his murder, but with the guidance of her mother, Dalonna Ingram, she navigated the recruiting process. She and her father had formed a bond with Cal head coach Joanne Boyle and Tierra accepted Cal’s offer, though she was intimidated by the academic challenge.

She was figuring out life at Cal when she collapsed in practice. After three weeks in the hospital, specialists determined she had a heart abnormality that could have killed her. Doctors surgically implanted a defibrillator and said her basketball career was over. Forever.

Rogers was devastated. It felt like another death. But the night before her surgery, she had a revelation:

Maybe I’m supposed to be here on this earth for a reason. Maybe my purpose wouldn’t be in basketball, but it seemed like God might have other things in store for me.

Rogers remained a member of the team and retained her scholarship. She continued to have Boyle’s support, and when Lindsay Gottlieb arrived to take over the program, she made sure Rogers was a vital part of the team that went to the Final Four in Rogers’ senior year.

During her time at Cal, Rogers struggled academically and dealt with depression. She cut herself and tried to overdose on drugs. But she got therapy and learned to get out her feelings in a journal. She also began going to church with a friend and found a sense of peace and purpose.

Nothing was easy. Rogers writes how she was sexually assaulted by a Cal football player who she thought was a good friend. How, one day in a team hotel, she hit rock bottom and was so despondent that she scared her friends. The police were called and she ended up being committed to a mental institution. She found the group therapy helpful and began to understand more about mental illness and depression. During that time, her younger brother learned he also had the gene for the heart abnormality and had to give up his football dreams.

In 2013, Rogers graduated from Cal with a degree in African American studies.

As I wore my cap and gown I thought about how I stood as living testimony that there is a way out of our circumstances, a way to bigger opportunities and a better life, if only we’re willing to do the hard work. … Certainly, I could have easily become a statistic, left to wallow in my circumstances.

Rogers’ first experience with public speaking came in her church. The response was overwhelmingly positive and she understood that others could learn and gain inspiration from her.

She was determined to share her story, asking for advice from writers, exploring agents and publishers. She took writing and speaking classes at City College of San Francisco to learn more about what she was tackling.

Rogers wanted to tell her story her way, so she decided to self-publish, raising money through crowdfunding to help pay for an editor and get the project going through Amazon’s CreateSpace platform.

It took about a year, writing at night several times a week after she finished work at a rental-car company, which also helped fund the project. Her friends read and gave her input. She went back over her journals to remember details.

“Some days, it was painful to read that,” said Rogers, who includes a reference list for suicide prevention and bereavement groups in the book.

Rogers is in a good space, strong and healthy. Her defibrillator has shocked her only once, when she overdid it in the gym. She does yoga and hikes. When we met, she was wearing a shirt that said, “Hope Dealer.”

Now the book is helping her to connect with groups, schools and sports programs, giving her more opportunity to tell her story. In a very real way, she is carrying on the legacy of her father, trying to give young people inspiration to rise above their circumstances.

“It’s crazy how the universe works,” Rogers said. “He was so involved in the community. And now I’m trying to inspire my community.

“I’m trying to figure out life right now.”

In that regard, Rogers is way ahead of the game.

Ann Killion is a San Francisco Chronicle columnist. Email: akillion@sfchronicle.com Twitter: @annkillion