A man who used to be homeless has landed a job with a six-figure salary after making an app for homeless shelters.

After quitting his job, Preston Phan, flew to San Francisco from his hometown of Seattle, in the hope of getting a job at one of the major technology companies.

But with little money in his bank account and no family in the region, the 29-year-old ended up sleeping at homeless shelters.

While he was able to earn some money working as a security monitor, in his spare time took coding lessons.

More often than not, he ran into difficulties when he tried to locate a bed at the shelters. So he decided to develop an app to simplify the process.

"I started developing an application where you can make the bed reservation through your phone and walk to the nearest location," Mr Phan told SF Gate. "I think that was the start of my career, actually."

His idea was initially rejected when he presented his work to the local Homeless Coordinating Board.

Undeterred, Mr Phan continued to work on his coding skills and during one of the classes he met with a representative from the social media company, Linkedin.

After speaking to him about his idea they offered him a well paid job with corporate housing and other added benefits. He will now be paid $115,000 (£88,000) per annum.

Mr Phan started working at LinkedIn in April, but despite his day job, he said he wants to continue working on his first love.

"I do want to come back to the app. I feel like that [City Hall] rebuttal just wasn't really thought through," he said. "It would help people immensely. It would help them get back on their feet."

Independent News Service