Sitting alone in a lifeguard tower watching the sun sink below the horizon, Amanda Southworth had a decision to make.

This Los Angeles teen, gripped by depression and anxiety, could continue on as she had, not eating, addicted to painkillers and attempting repeatedly to kill herself, or she could grab a lifeline and use her love of coding to save her own life and others.

On that chilly summer evening in 2015, she hatched the idea for AnxietyHelper, a mobile app that offers the resources she herself needed and embarked on a journey of healing and recovery that has led to a career in the tech world.

“I can honestly say that technology has saved my life,” Southworth said. She says she hasn't harmed herself or attempted suicide since. “When I found something greater than myself, I realized that I am not just a person with a life. I am a person who has something to contribute.”

Now 16, she has dropped out of high school and last month started her own company — but not the way most young technology entrepreneurs do. Astra Labs is a software nonprofit funded by donors and a $25,000 grant from the TOMS Social Entrepreneurship Fund. She spoke to USA TODAY from Apple's Worldwide Developers Conference in San Jose, California, on Friday.

Southworth's commitment to creating mobile apps and other software that help others was reinforced this week. The deaths of designer Kate Spade and chef and television host Anthony Bourdain were grim reminders of the toll of suicide, the 10th-leading cause of death in the United States and one of three that is increasing, particularly for teens.

The suicide rate for white children and teens ages 10 to 17 rose 70 percent between 2006 and 2016, according to the Centers for Disease Control and Prevention. Although black children and teens kill themselves less often than white youth do, the rate of increase was higher, 77 percent.

Southworth estimates she has been mentally ill for more than half her life. She says she attempted suicide at least seven times.

The bottom fell out when, as a nerdy kid, she moved to a new town for middle school, where she had no friends and felt like an outsider. Southworth used to send her future self emails that reflected her feelings of isolation and worthlessness: “I hope you’re not alive to get this email.” She daydreamed at school about killing herself. She'd wake up in the morning and cry that she was still alive.

What saved her: a sixth-grade robotics club in 2011, which introduced her to the possibilities of technology and inspired her to soak up knowledge about web development and artificial intelligence from the internet and textbooks.

Her first app, AnxietyHelper, a mental health resource guide, debuted in the app store in September 2015 duringherninth-grade Latin class. Her excited classmates downloaded it, and she finished the day with 18 users. Even that small achievement gave her belief in her own power and a sense of purpose, Southworth says.

“I was always very destructive toward myself. Coding is the opposite. It’s about creating. It’s about taking different characters on a keyboard and transforming them into something bigger than you,” she said.

In May 2017, she launched a mobile app called Verena for the LGBTQ community after friends were bullied in the tense political climate around the presidential election. Verena, which means protector in German, locates hospitals, shelters and police stations and users can create a list of contacts to be alerted in an emergency.

"Everything in my life has shown me that both good and bad things in this world will continue to happen and that's out of our control. But it's what we do with the things that happen to us that can make all of the difference," she said in a TedX talk last November in Pasadena, California. "My name is Amanda Southworth, I’m 15 years old, a junior in high school and I'm still alive."

Building apps relieves stress and helps her cope and problem solve, she says. And helping others has helped her heal herself.

“The more I work, the more I do what I love, the better I feel,” she said.

Until she started Astra Labs, Southworth bootstrapped her apps, working random tech jobs. The apps are free, and she runs no ads and does not collect user data. “My core philosophy is that people should not have to pay for something if their life would be ended without it,” she said.

Three more apps are in the works: one to help turn handwritten class notes into study guides and practice tests, another to help people follow political and social issues they care about and a third that uses artificial intelligence and machine learning to help those with schizophrenia determine when they are experiencing hallucinations.

People come up to Southworth and say: Your app stopped me from killing myself. One user told her the app helped her after a rape. A facilitator at a tech summit confided that if her friend had had the Verena app, that person might still be alive.

Stories of suicide, like that of Linkin Park frontman Chester Bennington, whose music helped Southworth through dark passages in her life, still haunt her.

“Maybe if I worked a little harder on this," she said. "I could have gotten help to him or to someone else thinking about suicide.”