Proper dedicated ebike frame with motor in the middle or the diy swap the wheel approach
You're asking two distinct questions here.

1) DIY vs Store Bought.

Do a DIY if you're mechanically inclined and will enjoy the project as hobby time.
Do a DIY if you have some classic frame you love.
Do a DIY if you want an off-road only high powered beast of a bike.

There are certainly some very cheap kits going around on Amazon etc.  I would be very dubious of a deal where you appear to get an entire eBike conversion kit for hardly more than what would be the wholesale cost of just the raw battery cells if it were a name-brand battery!  (also remember to add all the tools you're going to need to the apparent cost if you don't already have a kitted bike shop.)

Buy it at a store (from an actual bike shop that also services that brand of motor)  if you just want a street legal bike to get around town.

2) mid-drive vs hub-drive holy war very high level generalizations (I own both don't flame me) (yes some of these are not actually about the drive methodology but what's commonly available in which form from stores vs online etc.  they're generalizations)

Mid-drive Pros


motor torque is going through your drive train so gearing can amplify it for demanding climbs
major retail brands have torque sensors in the crank, results in much more natural "bike that helps me out" feel when riding.
the major brands have large dealer networks that can service them


Mid-drive Cons


some designs may have more failure modes where you can't pedal home if the motor breaks
motor torque is going through your drive train, may wear out drive trains faster


Geared Hub-drive Pros


simpler and cheaper, if it does break just the motor is not $$$ to replace
anecdotally much less likely to break in the first place.  Don't know of actual data specifically for bikes. (The fundamental motor design is simple and well proven.  Some mid-drive designs are very complicated with lots of gearing)
Throttle is more readily available if legal and you care for it (although there are more mid-drive bikes with throttles lately.)


Geared Hub-drive Cons


less expensive models don't have torque sensors, only cadence
sensors.  Results in a bike that can feel "pushy" and less natural. 
I've ridden some that basically feel like an electric dirt bike that
happens to have pedals on it.  (Maybe that's your preference and this
isn't a Con :) )  
on-line only retailers may end up with you waiting
for weeks for service or needing to know how to thread your own
wheels to replace a motor.


Direct Hub-drive


No