Many cities are located on the banks of rivers in fiction and history, for example London is on the banks of the Thames and Riverrun in Game of Thrones. The fact that they are on a river does not affect them in any way. The port however should be considered you may wish to have the port inside the walls of the city and use that in the story, enemy troops could sneak in and attack the city from within but if you want the city to remain free then I would have the port in a separate wall, think of it as a town outside the city.