From the August 2014 issue of Entrepreneur

After California legalized the sale of medical marijuana, hundreds of thousands of people were left hunting down doctors willing to give them prescription cards and searching for local dispensaries--which have the habit of closing abruptly or being buried with invisible signage. One entrepreneur wondered why there wasn't a better way. 

"I realized that these dispensaries could use internet marketing," says Justin Hartfield, CEO of Weedmaps.com. "I was like, wait a minute. Yelp doesn't have any dispensaries. Why don't I make a portal for dispensaries? I could optimize it myself, get the No. 1 on Google. When people click through and see my awesome website, they'll come back next week when they want more weed."

From that half-baked idea, Irvine, Calif.-based Hartfield and partner Doug Francis, a former mortgage-industry executive who brought sales savvy to the venture, have built a company that's on course to do $25 million in sales this year--and has become one of the biggest brands in an industry that is virtually brand-nameless. All without touching marijuana, which still is classed as a Schedule 1 narcotic. It's mere pocket change, though, compared to where Hartfield sees things going. 

"It's inevitable that federal prohibition of marijuana is going to end, and we think that when that happens, we're going to have a billion-dollar business," he says.

He's not blowing smoke. Weedmaps is a listing of dispensaries, which pay $420 per month to appear on the site, and doctors, who pay $295, plus a copious review site where weed companies can display their wares and prices. Revenue currently comes from only a handful of the 21 states that have medical marijuana dispensary systems. As states add dispensaries or fully legalize cannabis, as Colorado and Washington have done and Oregon and Alaska may do this year, sales should jump for Weedmaps, which Hartfield says is registering 200,000 new users per month. The company's iPhone app has been downloaded 2 million times.

As with most genius ventures, there was a pre-brilliant period. Hartfield, a computer science grad, had quit a well-paying tech job at the University of California, Irvine, and launched three failed e-books in pursuit of a cubicle-free life. He had visions of Zen Presence, his personal-development guide for men, becoming a bestseller. However, he says, "nobody bought it, maybe a dozen people. It was a horrendous failure."

By the time he came up with the marijuana-portal idea, he had maxed out two credit cards and was using funds from a third on a do-or-die mission to make something work. "I was tripling down," Hartfield recalls. "I had all these failed projects. My parents were really disappointed in me, to the point where they almost didn't want to talk to me."

With the last card, he went door-to-door in 2008 to more than 500 medical marijuana dispensaries in California, pitching them to advertise on his site. He found enough interest to know he was on to something. For the first year, listings were free. When the site became pay-to-play in 2009, Weedmaps rang up sales of $300,000 the first month, a figure so off the charts that Hartfield's bank thought the funds were stolen and held the money in escrow for a year. As a result, Weedmaps employees missed two paychecks.

Now Hartfield is positioning his company to transition to a post-legalization empire that will include partnering with labs that will provide marijuana testing and other services. Weedmaps has bought a software company whose product can track marijuana, seed to sale. It also purchased the Marijuana.com website--which Hartfield says will be "the Amazon.com of weed"--for $4.2 million. He and Francis have launched a venture capital fund, Ocean Emerald Capital, to invest in cannabis-related companies.

San Francisco investment and research firm Arc-View Group has estimated that the burgeoning legal marijuana market will reach $2.7 billion this year. Hartfield welcomes other entrepreneurs interested in getting in on that action. "If you love this space, come on in," he says. "The water's warm."