This project is a secure user registration form developed with Nodejs and Express. It captures user details, including username, email, and password, and securely stores them in a database after hashing the password with bcrypt. Environment variables, like database credentials, are managed with dotenv for secure configuration. Using EJS for templating, the app renders dynamic HTML pages, and nodemon provides a smooth development experience by automatically updating the server on file changes. This project is a solid foundation for learning server-side development, data security, and user authentication.
npm init
npm install expressnpm install ejsnpm install mongoosenpm install -D nodemon
mkdir modelsmkdir viewsmkdir controllersmkdir dbmkdir routes
cd routestouch web.js
touch app.js
cd modelUser.js
-
cd viewsindex.ejslogin.ejsregistration.ejs
-
cd partialsfooter.ejsheader.ejsnavbar.ejs
step 8: Navigate inside constrollers folder and create a files which will contain our constrollers files:
cd controllersuserController.js
npm install
npm run devornpm start
(http://localhost:3000/orhttp://localhost:8000/)