Tesla hopes that making cars in China will help supercharge its sales. That's easier said than done.

The US electric car maker was given the green light this month to build a production center in Shanghai, following years of negotiations with Chinese officials.

Once complete, the factory will allow Tesla (TSLA) to build up to 500,000 vehicles a year in the world's biggest market for automobiles.

The first cars should begin rolling off the production line within five years, but Tesla will have to overcome a series of huge challenges to make its bold plans a success.

Related: How American cars are really sold in China

Tesla is going it alone. Is that a good idea?

China is letting a foreign automaker open up shop without a local joint venture partner for the first time.

Going solo means there's less risk that Tesla will have to share valuable technology with a Chinese rival, but it could make navigating China's byzantine regulations tougher.

"Tesla will need to maneuver through levels of bureaucracy with the local and national government before this thing gets built," said Tu Le, head of Chinese auto consultancy Sino Auto Insights.

Chinese authorities will likely want to influence everything from how Tesla stores customer data to its local suppliers, which could delay the project.

Tesla is aiming to build the factory in two years. That "seems very, very optimistic, " Le said.

Even though the company is going it alone, there is still a risk that Tesla's intellectual property could end up in the hands of rivals if workers leave and join competitors.

"Tesla can't guarantee secrets won't leak out," said Eric Harwit, an expert in Chinese business at the University of Hawaii at Manoa. Tesla may also struggle to find enough skilled engineers to staff its Shanghai factory, he added.

How will Tesla pay for it?

Tesla has not said how much it expects the Shanghai production center will cost — or how it will pay for it. The electric carmaker's "Gigafactory" in Nevada, which makes lithium-ion batteries, cost billions of dollars.

The company is already facing a cash crunch, with more than $1 billion in bonds due over the the next year.

Despite being a major force in the auto industry, Tesla has yet to turn an annual profit.

Credit ratings agency Moody's downgraded Tesla debt further into junk territory in March. That could make it difficult and more expensive for the company to raise money in future.

"Entering the debt market to raise capital for the factory will be an unattractive option," said Fabrice Gatwabuyege, an analyst at research firm BMI.

Tesla CEO Elon Musk's spate of Twitter rants and attacks on analysts have also damaged his reputation with investors.

Related: Will Elon Musk's antics hurt his businesses?

Tesla could look for potential partners to share the cost, Gatwabuyege added. Musk has gone down this path before, getting Panasonic to invest in the Nevada Gigafactory.

Can Tesla meet deadlines?

If Tesla is to achieve its ambitions in China, it first needs to prove it can become a mass carmaker.

The company keeps missing its production targets for the Model 3, and is burning through cash as it does so. Some suspect Tesla could face similar issues in China.

Related: Another problem for Tesla's Model 3

"Unless it suddenly figures out how to build at volume quickly in California, it is hard to imagine it won't endure the same challenges in China," said Michelle Krebs, an analyst at consultant Cox Automotive.

Tesla has relied too heavily on automation and misjudged demand for battery technology, mistakes it will have to learn from quickly, said BMI's Gatwabuyege.

If it does, it may "be able to stay on track at meeting delivery deadlines at its China plant," he added.

Will Tesla become a victim of the trade war?

China is already a vital market for Tesla. Revenues from China doubled last year to more than $2 billion, accounting for almost 20% of the company's total.

Its share of China's electric vehicle market is just 3%, according to BMI data. That shows the enormous potential if Tesla can get its factory built.

First it must navigate the escalating trade tensions between the United States and China.

Earlier this month, Tesla hiked its prices in China by about 20% after Beijing slapped new tariffs on American vehicles in response to President Donald Trump's decision to tax Chinese imports.

Having a factory inside China would let Tesla avoid steep import tariffs in the future. But higher prices today could weaken its position in a market hotly contested by BMW (BMWYY) and Volkswagen (VLKAY), as well as big Chinese players such as BYD (BYDDF) and Geely (GELYF).

"The current trade tensions between the United States and China make it even more imperative that Tesla build its electric vehicles in China," said Cox Automotive analyst Krebs.

Related: China is owning the future of cars. German automakers want in

BMI's Gatwabuyege said the key to success will be whether having a factory in China will allow Tesla to cut costs.

Brand strength is also important.

"Elon Musk has a huge following here in China," said Le from Sino Auto Insights.

Musk will be hoping that survives the trade war.

-- Chris Isidore contributed to this report.