Gurbaksh Chahal built his dream and sold it to millions, appearing everywhere from Oprah to Men's Health magazine. Inside the tech world, his advertising-tech companies like Blue Lithium sold for millions to match.

He published a memoir, "The Dream: How I Learned the Risks and Rewards of Entrepreneurship and Made Millions," at 25.

Then the dream unraveled.

On Friday, Chahal was sentenced to a year in jail after facing a judge for violating his probation. His sentence was suspended pending appeal, but he has already been forced to surrender his passports and has transferred ownership of his latest company to his sister.

Chahal was serving probation after pleading guilty to misdemeanor charges for hitting a girlfriend in 2013. He faces other lawsuits from former employees alleging wrongful termination and discriminatory hiring. Those cases are still working their way through the courts.

We culled news articles, public records, court records, Chahal’s memoir, and his public appearances to learn more about the man who had it all, and how it all went wrong.

From nothing to millions

Every telling of Chahal's story begins the same way: Chahal was born in India, but moved to the slums of San Jose with his family when he was one month shy of four.

A Sikh, Chahal wore a turban growing up, and was bullied in school as a result. At one point, he claims, kids threatened him with a knife on the playground.

While his parents struggled to make ends meet, Chahal didn't care about school and found his own way to do business. He was turned away from a McDonalds job. He started buying and reselling printers on eBay.

Then, at 16, Chahal decided to start his own business. DoubleClick was "the big Kahuna" of internet businesses, Chahal says in his memoir, but he knew he could build a different business that tracked the number of clicks on an ad. He contracted with a programmer in London to build an ad-clicking program for him. To help get the gig, he created a fictitious name, Gary Singh, and said he was much older, according to his memoir.

He promised his London partner the money in 90 days once he had a chance to test the program, despite having no money to pay him. But Chahal landed a client, the bare-bones program worked, and soon he was making hundreds of thousands of dollars a month. He lost the turban and cut his hair.

Twenty-one months after he started Click Agents, ValueClick bought the startup in an all-stock deal valued at nearly $40 million.

The 18-year-old bought a Lexus and paid off his parents' mortgage. His rags-to-riches story had happened in a blink of an eye.

Planet Bollywood

Without a college or high-school degree, Chahal started what would become a career as a serial entrepreneur. His next venture, though, is often left out of the Chahal narrative.

"G," as he's been called since he was little (it's a sound-alike of "Ji," not an abbreviation for "Gurbaksh") and his older brother, Taj, created the Planet Bollywood restaurant: A place where Chahal wanted the Indian movie stars flying in and out of California to stop and eat.

"Bollywood promises to be a place 'where everyone feels like a star.' But obviously some get to be more of a star than others," wrote India Abroad in a 2002 review of the restaurant. "Every Thursday night, a lucky lady is selected to ride around downtown Milipitas in the owner's Lamborghini."

Every Thursday night, a lucky lady is selected to ride around downtown Milipitas in the owner's Lamborghini.

That brief career as a restaurateur ended in literal flames when Planet Bollywood burned down.

"That's when we started hearing the rumors," Chahal explains in his memoir.

Some people in the Indian community thought Chahal had burned it down for insurance money, he describes. In one scene from his memoir, a girl confronts Chahal about burning down his restaurant. He explains how he responded:

"Man, it was all I could do not to explode. I tried to count to ten, but I only got as far as five. 'Listen to me,' I said. 'I don’t know who told you that story, but it’s bulls---. If you want to know the truth, I’m a cheap bastard, and I was grossly underinsured. I got $100,000 from the insurance company. That’s it. And after paying off my debts and the lawyers, I was left with nothing. Zip. Zero. I put a million dollars of my own money into that place, and I lost every penny of it.' "I guess my outburst startled her a little. 'I’m sorry,' she said. "'You should be,' I said, and I stormed off."

To Chahal, this was a turning point, as he writes in his memoir: "I had been trying to do something for the community, and clearly that had been a big mistake. It taught me another lesson: Forget noble motivations. Pursue your own interests and focus on making yourself happy."

Flashy habits, solidified

In 2003, after Donald Trump rejected his application for "The Apprentice," Chahal returned to the ad-tech business. The 21-year-old cofounded internet-advertising company Blue Lithium with Krishna Subramanian.

The launch party in 2004 was seen as a symbol of the rebirth of tech, right after the dot-com crash. In a write-up of the party in the San Jose Mercury News, the paper described Blue Lithium's launch as the "era of extravagance" having briefly returned.

"Rotating go-go dancers graced two corners of the dance floor, while SF DJ Donovan spun techno and groove. The company hired two Cirque du Soleil performers to do a trapeze act in front of a very blue screen, as well as two stilt walkers/dancers," the paper said, noting that Blue Lithium hadn't sprung for an open bar.

The company specialized in display advertising and soon took off as Chahal's second ad-tech triumph. The company was featured in the 2006 Business 2.0 cover story on "The Disruptors: 11 Important Innovations."

Chahal, meanwhile, used the success to explore other areas. MySpace was hot back in 2007, and Chahal wanted to launch his own social network called MingleNow, designed for club-goers and party people. Even this had Chahal's Midas touch. MingleNow landed a partnership deal with Anheuser-Busch.

Within three years, Yahoo bought BlueLithium for $300 million. Chahal's personal stake was valued at around $100 million. MingleNow shut down after the acquisition, but Chahal was just getting started.

Fame and fortune

Chahal used his newfound riches to create a flamboyant and extravagant lifestyle, according to reports.

A 2008 profile in the Mercury News painted the picture:

"You'll find the world of G at the top of a 37-story elevator ride up to a fabulous San Francisco penthouse with a stunning view of Treasure Island and the bay. It would be hard to miss, actually. There's the letter G emblazoned on the entryway rug and the entryway mirror and the headboard of the penthouse's occupant. And then there's G himself, a Silicon Valley high-tech high-flyer who embodies everything we love and hate about celebrities."

Secret Millionaire Screengrab

That year was pivotal. He landed a book deal to detail "The Dream" — his story from a starting a company in his bedroom to selling his second company to Yahoo for $300 million.

In October, Chahal appeared on Oprah Winfrey's TV show — "He's single!" she gushed twice — addressing the bullies of his past and the opulence of his present. They had a detailed conversation about his Lamborghini doors, only to swivel back to the subject of him crying when he got home from school. (That "family-style" dinner his family is seen eating in his penthouse apartment was secretly catered by local restaurant Amber India, according to the San Francisco Chronicle.)

Weeks later, Chahal was featured on Fox's "Secret Millionaire." The multimillionaire lived in a hotel in the Tenderloin neighborhood for a week, volunteering for neighborhood charities, including a battered-women's shelter. By the end, he had donated more than $100,000 to charity.

He was also written up in Men's Health as No. 7 on the list of the world's fittest and richest men — one of the other techies on the list was PayPal cofounder Max Levchin — followed by an appearance on "Extra" as one of the most eligible bachelors. In his memoir, Chahal reveals the one show he promised not to do was "Dancing With the Stars."

That didn't stop Chahal from seeking attention everywhere else. Chahal appeared on talk show after talk show, expounding on the world economic situation while talking about his fortune.

All of the interviews seem to go over the same Oprah narrative. When talk show host Seamus O'Regan asked him about his Lamborghini, he quickly corrected him: "A Bentley."

"You did buy a Lamborghini at one point?" he responded.

"Yeah, I did that when I was 16."

Things fall apart

Chahal's memoir, "The Dream," ends in 2008, before he appears on Oprah and eight years after he sold his first company.

By 2008, Chahal was working on a new company, GWallet. The idea was to become a type of virtual currency for the Facebook games that were becoming so popular (that Farmville craze). Chahal eventually turned the company into RadiumOne, another ad-tech company, in 2009.

RadiumOne was focused on taking data from social-media companies and using it to target ads. Once again, Chahal was right on the nose of the next trend in advertising and raised more than $85 million, valuing the company at half a billion, by 2012.

The company kept climbing, and he was named one of the 2013 entrepreneurs of the year by Ernst and Young. RadiumOne was rumored to be on track to an IPO — the first company Chahal was to take public. On Twitter and on his blog, Chahal published inspirational sayings. He started the Be Proud Foundation (later renamed the Chahal Foundation) after the 2012 attack on a Sikh temple in Wisconsin.

At the same time, he followed the path of MingleNow and experimented with more new social networks like PingMe, a messaging platform, and Via.Me, a Instagram/Pinterest hybrid that applied filters to share favorite photos to social networks.

Still, rumors started to percolate that Chahal had overhyped his companies and that RadiumOne wasn't his original idea. When Business Insider contacted industry experts in 2011, the most charitable opinion of him was "a great marketer."

In 2013, Chahal sued his driver and personal assistant for embezzling money. In emails that came to light as evidence, his personal assistant complained to a board member that Chahal was making him do illegal things and that he had a drug problem. Chahal claimed the emails were defamatory, and the lawsuit was later dismissed.

The next time Chahal would surface in media reports it was for a very different reason. In August 2013, the San Francisco District Attorney's office filed 45 felony charges and two misdemeanors of battery and domestic violence against the RadiumOne CEO.

A video of the attack was recovered by police from the scene and reportedly showed Chahal hitting his girlfriend 117 times in an hour, but a judge ruled that the video was inadmissible because police officers had seized it illegally. In September 2015, The Wall Street Journal reported that Chahal had sought help from ex-Mayor Willie Brown to get the video tossed, paying him a $250,000 retainer for the job.

By April 2014, Chahal ended up pleading guilty to the two misdemeanors and started serving three years on probation.

But Chahal maintained his innocence, blaming his fame as a magnet for trouble.

Gurbaksh Chahal, former CEO of RadiumOne Getty Images/Charley Gallay

"Celebrities in sports, entertainment and business, and high net worth individuals in general are all potential targets. It was only a matter of time when I would fall prey," he wrote in a blog post after his plea deal. (The post has since been taken down.)

"What is the American Dream? That you can come from nothing and make something of yourself not once, not twice but three times, only to have all of it come crashing down from misinformation, that is spun wildly out of control into the world of make believe and then goes viral into the blogosphere. We need to hold on to the American Dream, and reject those who would rather make it a nightmare," he added.

A month later, in May 2014, Chahal resigned from the board and slammed the RadiumOne leadership for backing him in private only to use him publicly.

"I sincerely hope you wake up from this greed, betrayal, and dishonesty," Chahal wrote in an open letter he posted on his blog.

Two months later, Chahal moved on and started another ad company called Gravity4.

Arrested again

In October 2014, Chahal was taken into custody for kicking another woman multiple times, as first reported by the San Francisco Business Times. Since Chahal was on probation, the district attorney's office did not create a new case, but instead filed a motion to revoke his probation and set Chahal free after he posted bail.

News of the incident didn't come out until May, but the police report painted a picture of a CEO out of control.

The woman told the police that she and Chahal drank three to five shots of tequila and two to three beers after work. "Additionally he would take 10 to 13 pills, antidepressants and sleeping pills one to two hours before bed," the police chronology said. "He would also drink alcohol while under the influence of the pills. Usually he is very mellow and becomes almost unconscious at times." The police chronology also said Chahal's security guard would record him yelling at his dog at night and show it to him when he woke up.

There were other legal troubles as well.

In 2015, two ex-Gravity4 employees filed new lawsuits against Chahal.

One employee alleges a workplace of sexual harassment and gender discrimination. Chahal and several Gravity4 employees publicly denied it.

"As Chairman and CEO of Gravity4, I am shocked at these allegations, as they’re simply baseless, false, and can not be supported by facts. We are very clear on knowing what the motives were on having this case filed, and look forward to defending it and clearing the name of Gravity4 based on actual facts," Chahal wrote.

A second lawsuit alleges Chahal never paid an employee before wrongfully terminating him. In response, Chahal tweeted about the lawyer involved in both cases as his statement. These are still working their way through the courts.

The end of the dream

The once famous entrepreneur is now seen as a villain by some in the tech industry, as venture capitalist Jason Calacanis cheered for his jail time.

Over the last six months, Chahal's life has gradually fallen apart. His cofounder left the company, and he had to sign over Gravity4 to his sister. A judge found him guilty of violating his probation for attacking the second woman. He had to surrender his passports.

A report from Bloomberg revealed increasingly erratic behavior. For instance, he reportedly created a pseudonym "Christian Grey," the character from "50 Shades of Grey," and was using it to attract clients and test salespeople. He also used a company holiday party as a release party for a hip-hop record he produced, called "The Legacy," the report says.

During the hearings, his lawyer told the court that Chahal had been recently diagnosed with a neurological problem similar to Parkinson's and that jail time would exacerbate it.

On Friday, judge Tracie Brown sentenced Chahal to 12 months in prison for violating his probation, but granted a stay in the sentencing so his lawyer can appeal. His lawyer, James Lassart, issued a statement saying "Mr. Chahal's sentencing was stayed today. The court is allowing the appellate court plenty of time and opportunity to 'get it right' to honor Mr. Chahal's full constitutional rights."

Chahal walked out of the courtroom with his family — and a 30-day window to fight to stay out of jail.