The majority of the people that you ask this question to will say tempo (melody)... But that still might not be the best way for you. Just do which ever you find easiest or whichever allows you to write better songs. I personally also find the melody first. Sometimes I will put the melody to music that I've already written out, or I will come up with a melody in my head and then write the music to go along with it. This is the standard way to go about it... I believe.