ז. דעו לכם, כי הסכמנו החסיד נר"ו ואני עבדו, ועבדיכם מהחברים, לעמוד על נפשינו ליל שבועות ולנדד שינה מעינינו ותהלה לאל כן עלה בידינו כי לא הפסקנו רגע, רק אשר תשמעו ותחי נפשכם. וזהו הסדר שתקנתי וסדרתי בלילה ההוא.... ובעת שהתחלנו ללמוד המשנה, ולמדנו שתי מסכתות, זיכנו בוראנו ונשמע את קול המדבר בפי החסיד נר"ו, קול גדול בחיתוך אותיות, וכל השכנים היו שומעים ולא מבינים. והיה הנעימות רב והק ול הולך וחזק, ונפלנו על פנינו, ולא היה רוח באיש לישא עיניו ופניו לראות מרוב המורא. והדיבור ההוא מדבר עמנו, והתחיל ואמר, שמעו ידידי המהדרים מן המהדרים, ידידי אהובי. שלום לכם, אשריכם ואשרי יולדתכם, אשריכם בעולם הזה, אשריכם בעולם הבא, אשר שמתם על נפשכם לעטרני בלילה הזה, אשר זה כמה שנים נפלה עטרת ראשי ואין מנחם ל... והנני המשנה האחת המייסרת את האדם, באתי לדבר אליכם,
Know, that we agreed, the pious one (R’ Yosef Caro), and I his servant, to stand on our souls on the night of Shavuot and to rid sleep from our eyes. Thank G-d we were successful. We didn’t stop for a moment. This is the order we learned that night. When we began learning the Mishna, and we learned two tractates, our Creator gave us the merit and we heard the voice of the speaker from the mouth of the pious one, a great voice with the pronunciation of letters, all of the neighbours heard and didn’t understand. It was very enjoyable and the voice got increasingly stronger, and we fell on our faces. No man had the spirit to lift his eyes and face because of the great awe. That voice began speaking to us and said: “Listen my beloved, the great beautifiers, my beloved. Peace unto you, you are praiseworthy and your bearers are praiseworthy in this world, and the next world- that you exerted your souls to crown me on this day, that for so many years, the crown of my head had fallen and none could comfort me…And I the Mishna that rebukes man have come to speak to you…
בלילה ההוא של חג שבועות, ידוד השינה מכל מי שרוצה לדבק בקדושה, ויעסוק בתורה כל הלילה ...וסדר הלימוד של זה הלילה, כבר נתפרסם ונודע לרבים על ידי הקונטרסין שנתפשטו. והמנהג הזה נתפשט בכל ארץ ישראל ובכל המלכות, אין נ קי, כולם כאחד מגדולים ועד קטנים, וכן קיימו וקבלו עליהם ועל זרעיהם
On that night of Shavuot, sleep should be blotted out from all who want to cleave to holiness, and he should engage in Torah study all night. The order of learning for the night has already been publicized and is know to the public through the pamphlets…This custom has spread throughout Israel and the [Ottoman] Empire without exception. Everyone, young to old and so they have accepted on themselves and on their offspring
A Brief History of Tikkun Leil Shavuot, Rabbi Dr. Andrew Schein

Zacuto's testimony concerning the role of coffee in midnight vigils as practiced in the land of Israel (Rabbi Moses Zacuto on his travels in 1673)
Radbaz (David ben Solomon ibn (Abi) Zimra 15th Century)
A History of the World in 6 Glasses, Tom Standage
{א} ביום נ' לספירת העומר וכו' - ומאחרין להתפלל ערבית בכניסת שבועות בצאת הכוכבים כדי שיהיו ימי הספירה מ"ט יום תמימות. איתא בזוהר שחסידים הראשונים היו נעורים כל הלילה ועוסקים בתורה וכבר נהגו רוב הלומדים לעשות כן ואיתא בשו"ע האר"י ז"ל דע שכל מי שבלילה לא ישן כלל ועיקר והיה עוסק בתורה מובטח לו שישלים שנתו ולא יארע לו שום נזק. והטעם כתב מ"א ע"פ פשוטו שישראל היו ישנים כל הלילה והוצרך הקב"ה להעיר אותם לקבל התורה [כדאיתא במדרש] לכך אנו צריכין לתקן זה.
.....On the 50th day of Sefira.... Delay praying maariv because shavous starts at the emerging of the stars, and this is done in order to make sure the 49th day of the omer was yesterday. It comes to us from the Zohar that the Pious ones used to stay awake all night and concern themselves with Torah. It is already the custom of many (students) to do this (Stay up all night and learn). The Ari ZL brings down that One should know that anyone who doesn't sleep at all, and is engrossed in learning Torah, can be assured that his sleep will be made up and nothing wrong will occur to him. The reason (for this minhug) the Magen Avraham writes that because Israel Slept all night (the night of kabbalat haTorah) and Hashem need to awaken thenm in order to receive the torah (Brought through a Midrash) Therefore, we need to now stay up all night on shavout as a Tikkun.
יָשְׁנוּ לָהֶם יִשְׂרָאֵל כָּל אוֹתוֹ הַלַּיְלָה, לְפִי שֶׁשֵּׁנָה שֶׁל עֲצֶרֶת עֲרֵבָה, וְהַלַּיְלָה קְצָרָה... בָּא הַקָּדוֹשׁ בָּרוּךְ הוּא וּמְצָאָן יְשֵׁנִים, הִתְחִיל מַעֲמִיד עֲלֵיהֶם בַּקְלָאנִין, הֲדָא הוּא דִכְתִיב: וַיְהִי בַיּוֹם הַשְּׁלִישִׁי בִּהְיֹת הַבֹּקֶר וַיְהִי קֹלֹת וּבְרָקִים...
Israel slept all that night because sleep on Shavuot is sweet and the night is short…God came and found them asleep. He began to approach them with noises. That is what is written “And it was on the third day when it was morning and there were sounds and lightning” (Shemot 19:16)
From nothing...to isolated event... to kabbalists in Tzfat... to Europe with a Cappucino... to mainstream
דָּבָר אַחֵר, וַיִּתֵּן אֶל משֶׁה, אָמַר רַבִּי אַבָּהוּ כָּל אַרְבָּעִים יוֹם שֶׁעָשָׂה משֶׁה לְמַעְלָה, הָיָה לוֹמֵד תּוֹרָה וְשׁוֹכֵחַ, אָמַר לוֹ רִבּוֹן הָעוֹלָם יֵשׁ לִי אַרְבָּעִים יוֹם, וְאֵינִי יוֹדֵעַ דָּבָר, מֶה עָשָׂה הַקָּדוֹשׁ בָּרוּךְ הוּא מִשֶּׁהִשְׁלִים אַרְבָּעִים יוֹם נָתַן לוֹ הַקָּדוֹשׁ בָּרוּךְ הוּא אֶת הַתּוֹרָה מַתָּנָה, שֶׁנֶּאֱמַר: וַיִּתֵּן אֶל משֶׁה...
רַבִּי הָיָה יוֹשֵׁב וְדוֹרֵשׁ וְנִתְנַמְנֵם הַצִּבּוּר, בִּקֵּשׁ לְעוֹרְרָן, אָמַר יָלְדָה אִשָּׁה אַחַת בְּמִצְרַיִם שִׁשִּׁים רִבּוֹא בְּכֶרֶס אֶחָת, וְהָיָה שָׁם תַּלְמִיד אֶחָד וְרַבִּי יִשְׁמָעֵאל בְּרַבִּי יוֹסֵי שְׁמוֹ, אָמַר לֵיהּ מָאן הַוָּת כֵּן, אָמַר לֵיהּ זוֹ יוֹכֶבֶד שֶׁיָּלְדָה אֶת משֶׁה שֶׁשָּׁקוּל כְּנֶגֶד שִׁשִּׁים רִבּוֹא שֶׁל יִשְׂרָאֵל, הֲדָא הוּא דִכְתִיב (שמות טו, א): אָז יָשִׁיר משֶׁה וּבְנֵי יִשְׂרָאֵל, (במדבר א, נד): וַיַּעֲשׂוּ בְנֵי יִשְׂרָאֵל כְּכֹל אֲשֶׁר צִוָּה ה' אֶת משֶׁה, (דברים לד, י): וְלֹא קָם נָבִיא עוֹד בְּיִשְׂרָאֵל כְּמשֶׁה.
A. It is better not to stay up all night, because ravening Shacharit and not falling asleep is a law, and learning all night is merely a “good practice.”… One of Rabbi Yosef Shalom Eliyashiv’s (a great rabbi who lived in Jerusalem from 1910-2012) grandchildren once asked him: Why don’t you stay up all night on Shavuot like everyone else? He answered that he did a calculation and concluded that if he changed his bedtime, and woke up later than he normally did, he would end up learning less Torah by 15 minutes. For these 15 minutes, he decided to go to sleep at his normal time and not stay up all night.
Rabbi Yitzchak Zev Soloveitchik (known as the “Brisker Rav” who lived from 1853-1918) was surprised that so many people were careful to stay up all night on Shavuot, which is just a minhag (tradition), while on the night of the Pesach seder, when it is a mitzvah to stay up as long as you can talking about the story of leaving Egypt, people aren’t careful to do this! In Brisk, they treated the night of Shavuot like other nights.
-Rabbi Shlomo Aviner (a famous rabbi who lives in Israel)