of course The mosque in Madina had social, political, and judicial functions, as well as housing prophet's family. The religious functions were mixed with alternative daily-functions. Rules on prayers seem to have not been shaped at the first period, since the prescriptions of the Quran, came gradually in the early periods of Islam. Apart from the mosques of Mecca and Madina, one finds some few indications that there were other mosques in the time of Mohammed.
Mosques soon grew into becoming more complex, and uniform, in their shape. A Minbar, the pulpit, from where the Friday prayer is held, was placed next to the Mihrab. Within few years after the death of Prophet Mohammed, mosques became such important symbols, that when Muslim conquerors established themselves somewhere, a mosque was put up first, and then the military camp was built around it. This was inspired by the Madina example, but in some principal cities, Muslims constructed their mosque in the place that was the center of other religions.
https://www.ou.edu/student/oumsa/msa/medine2.jpg
The shape of mosques came in many cases from a mixture of the architecture of conquered territories, and of the original patterns. The addition of minarets, the towers from where the callings are made, were absent in the early mosques. It was inspired by religious buildings of other religions, where one believes that it was the churches of Syria, that were most important. The implementation of minarets, were both for embellishment of the mosques, and for the functionality of the mosques, as calling for prayer, Adhan, from ground level, did not carry more than a few blocks. However, for some time after the introduction of the minaret, the Adhan was still performed with the Muezzin walking the streets, while inviting for prayer. The first minaret came probably in 703, almost 100 years after the Madina mosque. But there are written material suggesting that minarets were erected as early as 665 AD.
]