This is the GitHub code from a Youtube video I created Simple Passport Local Authentication w/ React & Node.js the link for this video can be found here: https://www.youtube.com/watch?v=IUw_TgRhTBE
Make sure you modify the database connection string so you plug in YOUR database. If you dont know how to do this, watch the video as I go over that in it.