In short Christ, a hell of a lot of work to replace your small lead acid battery on your bike with a nihm
re: coulomb counter, that is pretty straight forward, just monitor the volts and current going into and leaving the battery, plus some fudge for "leakage" and internal resistance and integrate over time.