Most Tunisian schools are cash-strapped and run down, but an innovative project has allowed one to become self-sustaining by generating its own solar power and growing its own food.
Today the man behind the initiative hopes the success of the rural Makthar boarding school can serve as a model to improve the crumbling public school sector in the small North African nation.
Entrepreneur Lotfi Hamadi, 46, founder of the "Wallah (Swear to God) We Can" non-profit group, grew up in France but moved to Tunisia after the 2011 revolution that overthrew dictator Zine El Abidine Ben Ali.
Based in Tunis, the hospitality consultant set his sights on the school, located in a remote and poor region 170 kilometres (100 miles) southwest of the capital and close to his parents' hometown of Kesra.
PAY ATTENTION: Join Legit.ng Telegram channel! Never miss important updates!
"I wanted to take what works in the business world and turn schools into social enterprises," said Hamadi, whose parents were economic migrants to France who could not read or write.
"We're not trying to fill the gap left by the education system but to compensate them a bit, teach them to learn, give them the curiosity to open up to the world," he said about the school's 565 students, most of whom are boarders.
Hamadi started a decade ago by gathering donations to buy 50 solar water heaters -- allowing regular hot showers for the students for the first time -- and 140 photovoltaic panels that produce four times the power consumed on site.
By selling one-third of the surplus back to the national power company, the school could pay back debts to utilities and fund site improvements and extra-curricular activities.
The remaining extra power is distributed for free to three other nearby schools.
Last year, Hamadi's group launched Kidchen, a farmers' cooperative that grows vegetables on around eight hectares (20 acres) of nearby land.
While some produce goes to the school canteen, 90 percent has been sold since this summer, with the profits helping to pay for school activities.
Kidchen is staffed by six school parents, formerly unemployed, and an agricultural engineer, who receive stable incomes and a share of the equity and dividends.
"That pushes us to work harder and produce more," said chief gardener Chayeb Chayeb, a 44-year-old father of three.
"It's a project for ourselves."
Hamadi said better schooling is urgently needed in the country gripped by years of political instability and economic woes since the revolution.
The situation now is a far cry from the era of Habib Bourguiba, Tunisia's first president after independence from France in 1956, who strongly promoted primary education.
Initially the Arab Spring uprising inspired hopes of greater social and economic rights, but today "75 percent of pupils leave primary school without being able to write two sentences", Hamadi said.
"The education system has been suffering since the revolution... because every government has caved in to pressure from the unions," he said.
As a result, over 95 percent of the ministry's budget goes to paying staff salaries, leaving little for maintenance, schoolbooks and teacher training.
Some 100,000 pupils drop out of the Tunisian school system every year, and many parents, worried about low academic standards in state schools, opt for expensive private tuition.
Chayeb, the chief farmer, said the Makthar model had helped his family and given his children better school meals and activities ranging from business skills and foreign languages to robotics and drama.
"Before, I was a seasonal worker on five- or six-month contracts, always somewhere different," he said. "Now I work near where I live."
Former student Chaima Rhouma, 21 and studying law with a view to becoming a diplomat, said the project had completely revitalised the school, replacing a garbage-strewn yard with a sports field and garden.
Literature, theatre and cinema clubs had filled her with "good vibes", she said. "I've become more curious, I'm always looking for new things. Here you can study by having fun."
The school has gained a reputation in the region and is in high demand, with 80 children now on the waiting list, said its director Taher Meterfi.
Hamadi is meanwhile forging ahead with his next project -- a largely organic 40-hectare farm project to supply the city's 23 schools with energy and food for some 3,500 students.
At a time when Tunisia's crisis is driving many young people to emigrate, he hopes to help children "come to terms with their country and discover the opportunities it has to offer them".