I used to pull a lot of all-nighters in college. I found it very helpful to drink a lot of water. Like maybe a gallon or more. Caffeine is helpful to a degree, but it can also make you feel pretty jittery/fried/whatever.
The key is a good balance of caffeine, water, food, and interesting stuff to do. Take a break every now and then to go outside and breathe a few deep breaths of fresh air, and do some stretches while you’re out there.
And enjoy the sunrise.