The motor and gearbox used is a PM50-38 GB4. It was originally designed to power an electric golf buggy.
An overview of the control electronics is as follows. An arduino mini monitors the throttle inputs and sends a signal to a FF40HX speed controller which controls the flow of electricity to the motor. Low voltage protection of the lipo batteries is provided by a TP Packs LVC board.
Below is a close up of the control electronics.
This enclosure contains the arduino mini and the TP Packs LVC board along with ancillary electronics.
Freewheels mounted on the motor and bottom bracket allow for either pedal only, motor only or combined pedal and motor propulsion.
The finished bicycle.