The city of Ghadames on the edge of the Saharan desert in Libya is maybe one of the finest examples of desert urbanism still in existence. Inhabited since the 4th millennia B.C., many of its 1300 houses have been continually inhabited, improved, expanded, for over 3000 years.
Founded around an oasis, it has seen many empires come and go. The Romans called it Cydamus, and built a permanent garrison. It is possible it was visited by emperor Septimius Severus (145-211, a native of the nearby city Leptis Magna) in 202.
From above it doesn't resemble a town as we know it, but it is divided into three distinct neighborhoods of 3000 houses, baths, mosques, square and markets, connected by overbuilt alleyways, 1,5-3m wide with openings (light wells) to allow air and daylight about every 15 meters.
The alleys are not straight for a purpose: they are broken and sharply curved to break the strong desert winds from entering. While the outside averages 41 °C (106 °F) on summer days, the alley stay cool at around 25 °C (77 °F). There are plenty of resting places everywhere.
The houses are built on granite foundations, walls are of adobe bricks, and ceilings of palm tree stumps with clay and brick to create a think roof strong enough to bear further floors or outdoor activities. All material is easily sourced in the immediate vicinity of the city.
Even the alley ways come in two floors. Through a clever use of ceiling openings, wall mounted mirrors, air and light can reach into even the deepest parts of the houses without overheating them. The cold nights means that even short ceilings of 2,5m are enough for comfort.
Kitchens are placed on the roofs, to minimize smoke inconveniences. Cleverly shaped high walls create a bit of privacy while protecting against blown sand and fierce winds, often used for children to play on, sleeping on summer nights, etc.