In this low-slung colonial city of whitewashed buildings, cars career down lanes reserved for trolleys and black-market street vendors have clogged the sidewalks, sometimes erupting into turf battles that make pedestrians scramble for cover. Tunisian flags flutter on balconies, and graffiti on the main avenue read: “Thank you, Facebook.”

Three months after it launched the first in a series of revolts across the Arab world, Tunisia is perched delicately between revolutionary exuberance and chaos. Tunisians are proud that their sit-ins ousted a longtime dictator and, a few weeks later, a prime minister associated with the old regime. They use words like “freedom” and “democracy” liberally.

But in this Mediterranean nation of 10 million, few have real experience with these concepts. For 23 years, authoritarian leader Zine el-Abidine Ben Ali made the decisions for them. Now that he is gone, Tunisians must figure out how to rule themselves.

Their first attempt is scheduled for July, when the country will vote on a 200-member assembly that will elect temporary leaders and write a constitution in anticipation of new elections.

Until then, a weak interim government is in place, while a coalition of politicians, civil society representatives and legal experts rush to hammer out a new electoral code.

They are getting advice from international groups, but the future is inTunisian hands.

“People now are at the time of exploring politics, exploring liberty, democracy,” said Me Chawki Tabib, a lawyer who is part of the coalition. “Now you see in the media, in newspapers, people are discussing what is the parliament, what is the presidential system, and people are discovering what it means to live in liberty.”

After watching their uprising spark similar ones across North Africa and the Middle East, many Tunisians want to make their post-revolution restructuring just as exemplary.

“In the West, many people say this part of the world is not made for democracy, that we are not ready for this,” said Ghazi Gherairi, a law professor and coalition member. “It is vital that we succeed, to show that there is no kind of contradiction between an Arab Islamic identity and a democratic state.”

With its well-educated and homogenous population, this former French colony may have an easier time launching a democracy than other nations in the region. Tunisians are proud to have been the first Arab country to have a constitution and equal rights for women, and the only one to ban polygamy. The nation wears its Muslim identity lightly: Tunis residents sip beer at outdoor cafes as the muezzin calls, and women in head scarves and robes walk arm-in-arm with women in berets and skinny jeans.

So far, at least 44 political parties have been officially registered, and 15 more have put in requests. The Islamist party, Ennahdha, one of the few political groups that existed before the revolution, is one of the country’s better known and better organized, but it is hard to predict how any party will fare.

It is also unclear how voters will receive Ben Ali associates who are forming parties. Although the president’s picture has been ripped and defaced on public walls, many believe his party is angling for a comeback. Some accuse his sympathizers in the interim government of ignoring, or even contributing to, the increased petty crime and street fights since he left.

“They’re trying to create a void in security so as to say that this revolution is heading to chaos, so the Tunisian people will come and say, ‘We want security back and we want things back the way they were,’ ” Tabib said.

After two groups of vendors attacked each other off the main avenue last week, Morad Warli, 30, a Tunis resident, shook his head in disgust. “This is a tourist street, it can’t be like this,” he said. “Under Ben Ali there was respect for the law.”

A day later, police began cracking down on the vendors, and by Thursday, they had mostly disappeared from the main avenue and migrated to less visible areas nearby.

Support for the revolution still has a feverish quality, and the interim government continues to give in to popular demands. Earlier this month it arrested three former Ben Ali ministers and advisers and announced the dismantling of the State Security Department, which had been accused of human rights abuses.

Eager to keep up the patriotic momentum, regular Tunisians have turned to grass-roots actions, presenting themselves at the border to help refugees from Libya’s conflict, or joining convoys to take food and supplies to poor villages.

For many it is their first voyage from the country’s sparkling coastal towns into its neglected inland areas. “It astonishes us a little,” said Tunis resident Asma Abdessamad, 30, standing in a field where she had helped deliver supplies on a recent weekend. “We knew there was poverty, but we didn’t know how much.”

Such gestures will hardly stem the damage to the economy since the revolution. Tourism is expected to suffer, and the conflict in neighboring Libya has reduced the flow of Libyans crossing the border for trade and medical treatment, as well as the remittances sent by Tunisians living in Libya.

“The government has to immediately address the issues of security and the economy, otherwise we’re going to face an explosion and it could lead to another dictatorship,” said Mukhtar Trifi, president of the Tunisian League of Human Rights, which for three decades challenged the government and is now part of the group restructuring it.

A Western diplomat in Tunisia who spoke on the condition of anonymity said that while Tunisia has “all the ingredients for a successful transformation,” the process could be endangered if there is “too much floundering” or too little transparency.

For now, though, Tunisians are feeling a new sense of power.

“We don’t know, really, what they’re doing,” Manel Ouerghemmi, 19, a university student from Tunis who was part of the food convoy, said of the interim leaders. “But we are watching them, and if they do not work good, we will not be happy.”

Special correspondent Samuel Sockol contributed to this report.