COMPRISING more than 13,500 islands sprawled across almost 2m square kilometres, home to 250m people speaking over 700 languages and practicing virtually every religion on earth, Indonesia’s only real rival for the title of “most diverse country” is India. The World Bank considers Indonesia a “lower-middle-income economy”, but economically as in everything else, this masks huge differences. More than half the country’s populace lives on the relatively wealthy and densely populated island of Java, with more than one-tenth in greater Jakarta. In resource-rich Riau, East Kalimantan and West Papua regional GDP per person tops $6,000 a year, while the average resident of some of Indonesia’s farther-flung southern and eastern islands—particularly those without natural resources—earns less than $2,000.

Joko Widodo, best known as Jokowi, elected to Indonesia’s presidency in July 2014, has been vocal about wanting to return Indonesia to 7% growth—a rate unseen since before the Asian financial crises of the late 1990s.

In fact, its economy is slowing: preliminary figures show that last year its GDP grew at just 4.8%, its slowest rate since 2009. In absolute numbers it remains the biggest economy in ASEAN, but it lags China and India—the only Asian countries that exceed it in population, whose booming economies it desperately wants to match. But on a GDP-per-person basis, it lags its neighbours, Malaysia and Thailand—smaller and more cohesive countries with fewer people to lift from poverty, less territory to defend and sunk-cost advantages in manufacturing.

Jokowi launched a massive infrastructure campaign designed to spur growth by driving down logistics costs and improving internal maritime connectivity, thus tying east Indonesia more closely to Javanese prosperity. Demographically, he has picked the right time to do it: Indonesia, like India and the Philippines, has a bumper crop of young people about to enter the workforce. The workforces of Thailand, Malaysia and (especially) China, by contrast, are aging, and will soon start to shrink. By driving down the cost of moving goods into, out of and around Indonesia, Jokowi hopes to attract better jobs—advanced manufacturing and services, mainly—and so wean Indonesia’s economy off of its dependence on extractive industries such as mining and palm oil.

Such a shift is not without precedent: in the 1970s and 1980s, oil prices fell and Indonesia attracted investment in industries such as food processing and carmaking. When Jokowi’s predecessor, Susilo Bambang Yudhoyono, took office in 2004, manufactured goods and raw commodities contributed roughly equal shares to national GDP. But during his time in office, thanks largely to a hungry China, commodities’ share soared while manufacturing’s fell. But accomplishing it will require policy changes, and there Jokowi may face trouble. His coalition controls just 204 of the 560 seats in Indonesia’s House of Representatives—less than the 259 controlled by the Gerindra coalition led by Prabowo Subianto, whom he defeated in last year’s presidential election. Golkar, second only to Jokowi’s own PDI-P in number of seats held, defected from Gerindra and is now officially neutral and thus open to persuasion (but at what cost remains unclear).

Still, the often-violent political turmoil that followed the fall of Suharto, Indonesia’s long-time dictator, appears to have settled down into fairly ordinary political sniping. The 2004 Boxing Day tsunami effectively put paid to Aceh’s secessionist movement—the last big, threatening separatist drive. Indonesia has now directly elected two presidents; both transitions have been peaceful and orderly. Extremism, however, is a growing concern: roughly 250 Indonesians are fighting with Islamic State, while over 2,000 have publicly proclaimed allegiance to the group. After a long period of quiet, terror returned to Jakarta in January: jihadists killed four civilians in the city's business district.

Still, support for jihadism in Indonesia, the world's biggest Muslim-majority country, remains vanishingly small. Indonesia's chief concern is its growth rate. If Jokowi fulfils his campaign promise and gets it back up to 7%, Indonesia looks likely to reap the benefits of its current demographic dividend. If he fails, the middle-income trap looms.

For more, read our special report on Indonesia