The President has the power to fire the FBI Director for any reason. EXCEPT when it’s obstruction of justice. Was this obstruction of justice? If Trump knew of collusion with the Russians within his camp (or worse, participated in it directly), and if he knew or suspected that the trail of investigation would come to him, he would probably want to stop the investigation any way he could. In that case, firing Comey (with a view to installing a puppet who would put a stop to the investigation) would indeed be obstruction of justice, as would any interference with the investigation.
And is that what happened? We won’t know if there was any collusion or who knew what until the investigations are finished.
However, Comey did say he was pressured by Trump to drop the Flynn investigation. If Comey is telling the truth, that is obstruction of justice. And if Trump fired Comey as retaliation for not dropping the investigation, that’s obstruction of justice as well.