Residents have transformed the "kampung", as traditional neighbourhoods are known in Indonesia, into a model of clean and green living in an effort to fight off the threat of eviction.

Tongkol kampung was once much like many other down-at-heel riverside communities found across the overcrowded, traffic-choked metropolis of 10 million, blighted by dilapidated housing and strewn with rubbish.

But a series of controversial evictions of waterside neighbourhoods in the past two years, aimed at getting houses away from the capital's rivers to combat annual flooding, spurred the residents into making major changes.

"We want to prove that poor people can bring about change, change in their environment," said Gugun Muhammad, a resident and one of the people behind the initiative to transform the kampung.

The project, which began in 2015, involved launching a major clean-up by sending rafts onto the stretch of river running through Tongkol to remove mountains of trash, putting up bins around the kampung and signs to remind residents not to litter.

The most drastic part of the facelift saw residents taking sledgehammers to their own houses to remove sections that previously went right up to the water's edge, with poor families sometimes demolishing entire rooms.

They wanted to ensure the buildings were at least five metres (16 feet) from the river to lessen the risk of flooding and allow road access, something required by local authorities.

By doing so, they hope to prove they have already taken measures to stop the community being inundated every rainy season and prevent the local government forcing them out.

- Riot of colour -

They built new walls for their houses and painted them in greens, yellows and blues, creating a riot of colour in a city notorious for being a drab concrete jungle dominated by dreary tower blocks.

Vegetable and herbs are cultivated abundantly in specially constructed growing boxes; papaya, mango and banana hang from trees; and composting organic waste is now second nature to the 260 families that make up the small community.

Septic tanks have also been fitted to some houses to reduce the amount of raw sewage being pumped directly into the river.

While some residents are still in the bad habit of littering, and not all mindsets have been altered, it is a stark contrast to how the kampung looked a few years ago.

The piles of rubbish that once lined the riverbanks are gone and the floods that used to inundate the neighbourhood every wet season are a thing of the past.

"I wouldn't say it's a success just yet -- but it's far better than before," said Muhammad, 30, who also works for an civil society group called the Urban Poor Consortium.

The community financed the overhaul themselves but also received help from local environmental groups.

The residents decided to take matters into their own hands as they feared being forced from their homes in the eviction drive spearheaded by Jakarta governor Basuki Tjahaja Purnama.

The Jakarta Legal Aid Institute, which helps people facing eviction, estimates over 8,000 families were forced from their homes in 2015 alone, and sent to apartment blocks often far from the communities where they had lived for generations.

While forced evictions have always taken place in Jakarta, the number has increased dramatically over the past two years.

Purnama has defended the campaign, saying it will prevent the annual floods that inundate poor neighbourhoods in the rainy season by allowing rivers to be widened.

- 'Eviction no option' -

As the government drive gathered momentum and authorities threatened Tongkol kampung with eviction in 2015, transforming the neighbourhood took on an urgency for a community that has existed for half a century.

"To build a new life is scary -- being evicted is not an option," Puji Rahayu, a 43-year-old Tongkol resident, told AFP.

The land that Tongkol stands on belongs to the government and the residents do not claim to own it. It is not clear whether the kampung's efforts will be enough to save it, with authorities still insisting the evictions are part of a long-term plan to overhaul riverside communities.

"The priority in that area is to reorganise the riverbanks by relocating the people," said Jakarta government spokesman Christian Anthony.

Still, the eviction drive appears to have slowed down for now as the Christian governor's focus has shifted to fighting a high-stakes election overshadowed by allegations he insulted Islam, which led to him being put on trial for blasphemy.

Muhammad said the kampung is trying to live day by day and not focus on the ever-present threat of losing their homes.

And he has a favourite analogy about their efforts to convince authorities that Tongkol is a model neighbourhood.

"If I were to propose, I would wash and tidy myself up so I look respectful, so you know I am serious about this," he said.