Hi.
If you prefer, you don't need to build hardware but just use the dirty cheap 16€ chinese EBike motor controller that is firmware programmable - microcontroller STM8. It also has UART cable/interface that can be used to be controlled by and Arduino. See here the project page/firmware sources: http://opensourceebikefirmware.bitbucket.io/