Not so long ago it made headlines as the centre of the drug war, a city in which hundreds were slain every year.

Nowadays, Tijuana is earning a reputation for something altogether more productive. It has transformed itself into the world's premier hub for making flat-screen televisions, and a site for aerospace and medical equipment manufacturing. Expensive bars and restaurants have followed, putting the city at the crest of a wave of optimism about Mexico's economic future.

"Tijuana is above and ahead of the rest of the country," says Noé Fuentes, an economist from the College of the Northern Frontier. "We can't call it a boom, but we are putting conditions in place for what we hope will be a boom later."

Few made such rosy predictions in Mexico back in 2009, when plummeting exports led the country into one of the worst recessions in the world with GDP shrinking by 6%. Still fewer thought that just three years later international financial experts would be saying the country was on the brink of making the leap into the big economic league that its size and resources have promised for so long.

"You hear it everywhere," says Mexico City economist Rogelio Ramírez de la O. "Right now we are in a sweet spot, but the challenge is to make it sustainable."

Part of the enthusiasm comes from markets finding glimmers of hope amid the global gloom in Mexico's projected fiscal deficit of about 2% this year, with inflation at about 4% and projected growth just under 4%. This follows 3.9% growth in 2011 and 5.5% in 2010.

At the same time Brazil's status as a darling of the emerging markets is beginning to look like a bubble on the point of bursting, leaving Mexico to fill its place as regional favourite.

The buoyant economy has resulted in stronger consumer confidence, even if the trickle-down effect is still limited. A range of statistics show that over the past 15 years ever more Mexican families have acquired the trappings of middle-class life such as cars, fridges, and washing machines, but about half of the population still lives in poverty and inequality rates are among the worst in the world.

"Oh no, we're not thinking of buying it," says Aidee Chaparo as she stares at an LG flat-screen TV in a electronics store with her husband. "We just came to have a look on our day off." The couple, with their combined monthly income of about £260, nevertheless consider themselves middle class because so many others are worse off.

Flat-screen TVs may be beyond reach for people like the Chaparos, but a surge in demand has been reported for other, more affordable products. "In the last few months we get people coming in here who you can tell aren't rich and they will blow a lot of money on these beers to show off to their girlfriends," says David Gómez, who sells expensive speciality craft beers.

Many economists give former president Felipe Calderón, who left office in November, much of the credit for the relative solidity and nascent signs of dynamism which, they say, is rooted in his dedication to fiscal prudence even during the recession. "Fortunately he resisted the sirens' call to overspend or close the economy," says Carlos Elizondo of the CIDE thinktank.

Elizondo also stresses that kickstarting the wider modernisation of the internal economy is a far more complex business than merely maintaining that discipline.

There is widespread agreement that generating the kind of jobs that would allow people such as Chaparo to start actually buying, rather than dreaming, requires forcing competition on the monopolies and oligopolies that keep prices for even basic goods and services higher in Mexico than they are in many developed countries. It also is accepted that the atrophied state-owned oil company must be reformed, sub-standard state education improved, corruption tackled and a strategy found to bring drug-related violence under control.

Part of today's optimism is based on the hope that the new president, Enrique Peña Nieto of the Institutional Revolutionary party, the PRI, is more likely to provide the bold political leadership necessary to do this than Calderón. Aside from his ill-fated offensive against the cartels, the former president was politically timid and almost never adroit.

The new government gained kudos from left and right last week with an education reform proposal that undercuts the power of the teachers' union leader, Elba Esther Gordillo, who had become a symbol of the way entrenched interests have gained more power in recent years.

Peña Nieto's ability to construct a honeymoon period – after an election mired in accusations of dirty tricks – is telling. He still faces determined opposition from the more radical left, but his apparent determination to make the most of the opportunity he inherited appears to be convincing even some of those who are uncomfortable with the return to power of the PRI, which governed Mexico from 1929 to 2000.

"They seem to be pretty serious to me and their authoritarian tendencies may even help them get things done," says Ramírez de la O, who was once floated as a possible finance minister in the event of a leftwing victory. "I think they have two, maybe three years. But if things aren't on track by then there will be a real problem of unfulfilled expectations."