I like Tunis.

Of the many Arab cities I've visited its friendly people and openness struck a chord with me. In the throes of the 2011 revolution and civil war in neighbouring Libya, passing through Tunis with its wide French- style boulevards and relaxed cafes provided a kind of psychological decompression stop from the conflict next door while en-route home to Scotland.

Tunisia's own 'Jasmine Revolution' appeared to be proof that the Arab Spring uprisings could have a happy ending. Here was a country that had not only rid itself in a comparatively peaceful way of a corrupt dictator but went on to usher in democratic elections a new constitution and a fair degree of political tolerance between secular and Islamist parties.

To be fair to Tunisia and its people that largely remains the case, but as ever in a troubled neighbourhood there are those hell-bent on destabilising the situation.

Wednesday's attack by Islamic extremist gunmen on the Bardo Museum in Tunis that killed 23 people including a British woman was a sharp reminder of that.

Few doubt that the attack was squarely aimed at Tunisia's economy. Tourism in the country accounts for seven percent of gross domestic product, and yesterday the local stock exchange dropped nearly 2.5 percent and two German tour operators said they were cancelling trips from Tunisia's beach resorts to Tunis for a few days.

Europe's largest hotel group, Accor said too it had tightened security at its two hotels in Tunisia and Italy's Costa Cruises confirmed it had cancelled stops in the country.

Significant as the impact of Wednesday's attack was to the economy, what though of the wider political implications for Tunisia, and how real is the possibility the country now faces an escalation of jihadist inspired terrorism?

Yesterday, the Tunisian authorities said the terrorists shot dead by security forces in the attack had been identified as Tunisians, Hatem al-Khashnawi and Yassin al-Abidi, the latter having been under surveillance but "not for anything very special" according to Prime Minister Habib Essid.

So far the motives of the attackers and the links they had to specific extremist groups is not fully clear. That Tunisia though lies in a volatile neighbourhood is beyond question. To the east lies the violent political quagmire that is Libya. Looking westwards meanwhile are terrorist cadres hiding in the Chaambi mountains of the Algerian border.

In general the region is home to militants associated with a number of groups, including the Islamic State (IS), al-Qaeda, and al-Qaeda-linked groups such as Ansar al-Sharia, al-Mourabitoun and al-Qaeda in the Islamic Maghreb (AQIM)

Add to this that Tunisia has been the largest source of foreign jihadis journeying to fight in Syrian and Iraq, and a clear picture of the country's vulnerability becomes fully apparent.

As ever the 'chatter' on jihadist websites and social media accounts have begun expressing their 'satisfaction'over Wednesday's Tunis attack.

Over the last few months the Islamic State group and its supporters have launched an online campaign aimed at recruiting Tunisians and inciting attacks.

On March 15, IS released a video of a fighter in Raqqa providing advice to fighters in Nigeria's Boko Haram and then stated that Tunisian jihadists should follow in the group's footsteps.

Two days ago one IS-linked account tweeted in Arabic: 'Allah permitting, there will be earthshaking surprises in Tunisia, Egypt, and Libya during these days....'

The user also included a hashtag translating to "#Invasion_ofTunisia" in the message, which was tweeted nearly 6,000 times in the first few hours of its creation.

Reacting to this there is always the possibility that the Tunisian government will take assertive action to neuter the crisis rather than allow it to become a long, drawn-out affair.

Yesterday the president's office said the army would be deployed and large cities secured by troops. It's perhaps worth remembering that faced with a similar crisis during the January 2013 Ain Amenas gas plant hostage situation in Algeria, the government there sought to resolve the standoff quickly. If that occurs in Tunisia, the resolution may prove to be quite bloody, especially if the attackers are suicide bombers wearing explosive vests.

All this will weigh heavily on the minds of Tunisia's political leaders throwing up both a pressing and potentially pivotal test for the country's tentative transition from dictatorship to democracy.

These same leaders must resist the temptation to react in a heavy handed way that might allow old divisions among them to poison the country's fragile new democratic mix.

Most likely some within the party of newly elected president Beji Caid Essebsi who regard Islamists as agent provocateurs will call for a robust authoritarian crackdown.

For its own part Tunisia's main Islamist party, Ennahda, must continue to work collaboratively with the government and avoid provocative rhetoric that lays blame for the Tunis attack at the doorstep of any specific political party or figure.

Should Tunisia's political establishment fail to do this the spectre of chaos and violence that swept Egypt and continues to fuel events in Libya will loom large. This is a time for cool heads if the jihadists are to be deprived of their dangerous ambition to manipulate and destroy the hopes of the Arab Spring's only success story.