Could I cast a range spell as a melee attack?


I’m wanting to make a sorcerer that throws a little flare in his spell attacks. I was wondering if I could use a range spell attack as a melee attack like casting firebolt but punching with it instead of throwing it…