Photosynthesis is the process by which plants, algae, and bacteria use sunlight, water and carbon dioxide to produce oxygen and energy in the form of glucose. It occurs in the chloroplasts, which contain chlorophyll. The chloroplast is made up of an envelope, stroma, thylakoids and grana. Photosynthesis has two phases - the light dependent reaction where light is absorbed to produce ATP and NADPH using chlorophyll, and the light independent Calvin cycle where CO2 is fixed into carbohydrates using the ATP and NADPH produced in the light reaction. Factors like light, CO2, temperature and minerals can affect the rate of photosynthesis.