Basic information on what to get and how to put it together
A motor can be used as a generator.
For my set-up, I use a 12 volt permanent fixed magnetic motor link.
Another option is to use a hub-motor used in electric bikes.
You will need some way to prop the rear tire of your bicycle off the ground. A bicycle training stand works great.
Three ways to spin the generator shaft:
#1 You can use a rubber-belt. Remove the rear tire and tube. The belt can be guided by the rim of the bicycle's rear wheel.
#2 You can attached a 'bushing' to the generator's shaft. Position it to be spun by having it rub the edge of the inflated bike wheel.
#3 Use a hub motor. This is the most efficient method. The down-side is the weight of the hub motor will be part of the bicycle.

Fuses are necessary to keep things safe. Always put a fuse or breaker switch on the positive lead wire.
You will need a 'charger regulator'; which levels the electricity and restricts the electricity from flowing back to the generator.
From the regulator you can use a 12 volt
deep cycle / marine battery to save the electricity you produce.
The generator is producing DC (Direct Current).
Your smaller battery powered devices use DC. Most larger appliances use AC 
(Alternating Current).
To power AC devices (like a sewing machine) y
ou will need a 'power inverter' to convert the DC to AC.
To connect the generator, fuses, the charger regulator, the battery, and the inverter you will need at least 12 feet of 10 gauge wire.

To give you an idea of how much electricity can be produced :
  My sewing machine (without the light on) is rated at 50 watts and consumes 1 amp every hour. My bicycle electric generator can make 1 amp every 10 minutes. That means for every 10 minutes of peddling, I can sew for 1 hour.
  I also hook my sewing machine up to a 50 watt solar panel. On a good day in Tucson, Arizona - I'll be lucky to get 4 1/2 amps from the sun for the entire day.  That's 4 1/2 hours of sewing per day with just the solar panel.
Click here to see the >>> Solar Sewing Rover

Use FUSES !!!!!  their small price and will save you hundreds of $$$
(always attach fuses to the +positive wire)

↓ Powering a sewing machine with a bicycle generator ↓