The saw kerf (missing wood after the saw cuts) should take care of it with almost no size reduction if you rout the side that will open so that only a small amount of the front is completely flat.
You shouldn't need to rout the top/bottom, and do NOT rout the hinge side or you won't have anywhere to mount the hinge.
You may need to trim the flat side next to the hinge slightly if the hinge is exceptionally wide, but the saw kerf should be enough.
Basically, you want the profile on the side that opens to look like this: