Login-form-validation is a simple website that can run locally on any platform. The user can register and then log in then land on the greeting page, it will store data on Postgresql locally to validate the registered users during the login process.
Postgresql for database, express for fetch, and post and node have been used to create this project.
The password can be updated with the registered email. Enter your registered email and then enter a new password after successfully updating the password it will redirect the user to the login page. Here, enter the email and the newly updated password and then the user can successfully log in.
Now to create a database to store registration and then for validation, we have to first create a database. After, successfully installing Postgresql made some changes:-
Change the password and enter your password which was entered while creating a server with username postgres.
Open the folder in vs code where you have cloned the project and follow the below steps to create a database:
For Linux
sudo -i -u postgres
Now create a database and name it 'loginform1'
createdb loginform
Now, switch to loginform1 database to create table
psql -d loginform1
Now copy the below lines to create a table to register users
CREATE TABLE users (id serial not null primary key, name varchar(255) not null, email varchar(255) not null unique, password varchar(255) not null);
run : SELECT * FROM users;
to check whether the table is created or not.
Now you can run the project on your Linux.
For Windows
run: psql -U postgres
then enter the password you have entered while creating a server with username postgres
Create database: CREATE DATABASE loginform1
switch to database: \c loginform1
then copy the same command for creating a table:
CREATE TABLE users (id serial not null primary key, name varchar(255) not null, email varchar(255) not null unique, password varchar(255) not null);
Execute npm start
in the vs code terminal to run the server.
Update.js file does not have any role in running all the files it is just to understand the update query. It can be run using node update.js in the terminal separately.