It is the job of the medina to provide five fundamental services, matching in number, the five pillars of Islam and the five prayer times each day.
Our guide Hakima tells us each and every medina must provide access to medicine, baths, public ovens, mosques and schools.
And shops - everywhere shops.
A severed camel's head hangs in front of one stall, advertising the meat on sale. There's a bundle of green grass in the mouth of the camel, as if it's happy, healthy and chewing.
In another concrete rendered stall, a man is selling big bags of snails. Those not packed into large plastic bags are lining the walls and ceiling of his establishment. The snails need to be boiled seven times, with spices such as cinnamon added at the last boil.
Brains on trays are sold from another nearby stall.
Then there are the less confronting wares: the beautiful mountains of multi-coloured olives and spices, the pink and white nougats, the glistening jewellery, the cloth, the brass and wooden ornaments. Tailors and their sewing machines are everywhere.
Down another lane, through a narrow doorway, up a twisting, tiled stairway there is loud music leading to a leathergoods shop high above the medina.
We are assured all the jackets, bags, belts, shoes and slippers are made here as we look down from a balcony to workers wading through row upon row of concrete baths where the leather is cleaned and cured. We are given sprigs of mint to chew as a cocktail of smells drift up from the ancient vats.
A member of our party buys a suede jacket. She haggles the price down from 3800 dirham (about $A500) to 2600 dirham (about $350).
Looking across from the leather shop balcony, row on row of TV reception dishes sprout like big white flowers from the roofs of each of the cramped homes.
There is no way we could find our way through the medina without a guide. Hakima tells us that, from time to time, locals get lost there.
Fez was founded in 808AD in what is known as Morocco's Idrisid dynasty, ruled over by Moulay Idriss, said to be a descendent of the Prophet Mohammed, and who came to the country from the Middle East to educate Moroccans in the finer points of Islam.
Today, Hakima tells us to keep our hands over our wallets and not to talk with those spruiking silver jewellery and scarves.
"They will follow you for kilometres," she says.
"Balak! Balak!"
We hug the walls again as teens pushing carts of oranges, still with their green stems, charge along the paving. Other young men are rushing along the passages as they balance trays of fresh, sweet-smelling loaves in their hands or on their heads.
Stretching about 30 metres along some of the walls, are strands of coloured silk. They are being woven into cloth for the traditional Moroccan over garment, the jalabiya.
On every twist and corner, cats look on absently or slowly lick their paws. Moroccans love cats, with some referring to folklore that a cat gave birth while sitting in Mohammed's cloak, giving great joy to the Prophet.
They're not so keen on dogs. It's not that they don't like them, but they have to carefully wash after handling them to be clean for the daily prayer times.
Many of the medina's walls at and near the mosques are cedar lined. Hakima tells us this allows blind people to tap their way to a prayer location.
At 4pm, the call to prayer bursts from loudspeakers throughout the centre. We are standing in the tiled courtyard of the Koranic School where for centuries students learned Islamic scriptures.
In 1960, the school stopped specialising in the Koran to become a general public school. Nonetheless, in this beautiful place of scholarship, the melodic prayer call sounds holy and sublime.
- AAP