Speed, direction control of dc motor for simple linear slide mechanism project

I am doing a project regarding speed, direction control of a dc motor on Arduino and make a linear slide model with it. Now, I have narrowed down to using a dc motor with l298n bridge and using Arduino PWM to control the speed and direction with the H bridge driver.

The other thing I want to do is displaying rpm of the motor shaft on the serial in Arduino ide. I am not able to figure out the same.

Also, I have thought of potentiometers and pwm but then incremental rotary encoders have the same function as well.

So, would I need all these components?

Start with a potentiometer for speed control - it will be much simpler than an encoder.

Get a simple program working that makes the motor stop and start and run at different speeds before you try to add features.

If you want to identify the RPM of the motor you will need something to detect the revolutions. For a small DC motor I use a QRE1113 reflective optical sensor that detects a blob of white paint on a small black disk fifed to the motor shaft.