Need help with wiring my line following robot

I am trying to make a simple line following robot but I came across a small difficulty.


I am following this tutorial and I am not sure how I can connect the 5 volt and gnd wires to so many devices at once.

this is my current setup. i slapped the 4x AA battery holder on the underside of the chasis since I couldn't find space for it. I was worried about it tipping over but I noticed the center of mass is a little right of the wheels. I need to connect the 5v wire from the l298n to the arduino in the back as well as the IR sensors in the front (haven't installed them yet) and that's not even mentioning gnd.

i soldered this sorry thing together and it will just barely work, the wires are stretched like mf. I am 100% sure there is a better way to do this. I dont have the space to install a breadboard on the chasis so I was wandering if I should use one of those soldering board thingies (I don't have one rn tho). can anyone give me any suggestions about how I can wire the gnd wires?

You can physically wire as many wires to one signal. Going from one to the other. The best way is to use a piece of strip board with one track power and the other track ground. Then you can wire all your signals to this one piece of strip wire. It also gives you the opportunity to wire surface mount components to the underside for better decoupling.

Like this:-

You can wire signals in a star system or as a chain. The star system is best:-

Also see this post:-

I go from board to board with 4 wires for I2C being sure the last board has the pull up resistors.

Posting an annotated schematic would help, the picture does not match what you are saying.

I think your 4-way splitter is perfect for the grounds (see star wiring, post #2).

Kits usually come with the correct size, number and pin-type wires. But, Amazon (or other) offers wire assortments of varying length and M-F, M-M, F-F pins.