Indonesian President Joko Widodo (C) speaks during a visit to a Mass Rapid Transit (MRT) project in Jakarta on February 23, 2017. Photo: AFP/Adek Berry

Indonesians looking at a brightening future may have God to thank.

Southeast Asia’s biggest economy is on roll relative to Thailand, South Korea and other countries slammed by the 1997 Asian financial crisis.

It’s 5.2% growth this year hasn’t come easily. The revival began in 2004, when then-President Susilo Bambang Yudhoyono reduced debt, strengthened institutions and attacked corruption.

When he took over, Jakarta ranked 133rd on Transparency International’s corruption perceptions index — behind Democratic Republic of the Congo and Tajikistan.

By 2011, Yudhoyono had improved that score to 100, putting Indonesia in Argentina’s orbit. Not optimal, but still a spectacular feat.

It took time for successor Joko Widodo, who’s known as Jokowi, to make the transition from Jakarta governor to leading 263 million people and an economy McKinsey says will be a Group of Seven power by 2030.

For a while there, investors feared Jokowi was succumbing to nationalism and turning his back on the foreign capital needed to finance growth and poverty reduction.

The good news is Jokowi is finding his reformist mojo.

The good news is Jokowi is finding his reformist mojo.

He’s made the process of approving and planning giant infrastructure projects faster and more transparent, announced a tax amnesty to get Indonesians to invest money at home, put tax collection and government procurement processes online and made good governance a priority.

By cutting out myriad middlemen and writing more realistic and frugal budgets, Jokowi recently won Jakarta an investment-grade rating from Standard & Poor’s.

He’s also rebuilt currency reserves in case another crisis hits. Lower borrowing costs will make it easier to implement $350 billion in infrastructure projects and raise living standards.

That gets us back to God.

Late last year, Jokowi ally Basuki Tjahaja Purnama was coasting toward re-election as Jakarta governor. Instead, Basuki, a Christian of Chinese lineage, was put on trial for blasphemy -– and jailed — for telling voters it was okay to vote for a non-Muslim.

Jakarta’s former Governor Basuki Tjahaja Purnama is seen inside a court during his trial for blasphemy in Jakarta. Antara Foto, Sigid Kurniawan, via Reuters

It was a blow to Muslim-majority Indonesia’s reputation for religious tolerance, fanning fears of creeping Islamization of the kind seen in Malaysia.

An added wrinkle: the victor in the Jakarta governor race is an ally of the politician Jokowi beat in 2014 — a man expected to run against the president in 2019.

Having the political opposition in charge of Jakarta, which provides roughly a fifth of Indonesia’s gross domestic product, may catalyze Jokowi to overachieve.

Jokowi’s reputation is as a man of the people who’s above reproach. As governor, he was known as “Mr. Fix It” for rolling up his sleeves to tackle problems.

Jokowi’s reputation is as a man of the people who’s above reproach.

As governor, he was known as “Mr. Fix It” for rolling up his sleeves to tackle problems, often showing up at the scene of power outages or water-supply problems –- sometimes on a bicycle.

Competition ahead of 2019 may prod him to accelerate reforms to reduce graft and ensure that low-income Indonesians share in GDP gains.

Jokowi has the mandate, controlling roughly 70% of parliamentary seats and supportive collation supporters.

He just needs to use it to accelerate the gains Indonesia has made since the darkest days of 1997 and 1998.

It was hit hardest, with deadly riots and protests large enough to oust strongman Suharto after more than 30 years in power. At the time, many investors bet on Indonesia, an archipelago of nearly 18,000 islands, breaking apart like some Asian Soviet Union.

The president still faces a daunting to-do list: cutting poverty, reducing corruption, battling extremism and fighting domestic pressure to wall off the economy from foreign influence.

But considering where Indonesia might’ve been today, if not for the competence of the Yudhoyono-Jokowi years, it’s hard not to be impressed.

It’s imperative that Jokowi use this window of opportunity to take Indonesia’s reforms to the next level. And, perhaps, even by the grace of God.

(William Pesek is a Tokyo-based journalist, former columnist for Barron’s and Bloomberg and author of “Japanization: What the World Can Learn from Japan’s Lost Decades.” Twitter: @williampesek)