It's usually cheaper to repair what you have rather than buy new.
It's also environmentally preferable as you are buying a lot less "stuff" and paying more on labour.
The parts that are fitted will be better quality than found on a cheap bike.
Usable new bikes start a bit over 400 to get reliable bearings and working parts, and a degree of corrosion resistance.
If repairing, service components like cables, brake blocks, chains and sprockets are best bought new, most other parts can be found second hand.