I just put a fan in my bedroom last weekend. I used a fan bracket box right to the side of the joist. I think it may have been RACO or Appleton. The box is sunk below the bracket 1/2 inch so I just rested it on the drywall from above and drilled my pilot holes and ran the screws.

The only reason I used a deep bracket was because I needed a box to feed my new cans from, otherwise I prefer pancake. Most of the time a joist is within an acceptable distance to center to just hit a joist. Buzz a holesaw and done. 1/2" box flushes itself.