Gym per Day π️♂️ | Integrating Authentication π, Forgot Password Page π, Login Page π & Sign Up Page π
Here in this session, we will learn about authentication as first step and as in last session we discussed about idea behind the app, and landing page of the appππ️♂️
Before proceeding further make sure you have watched previous session ▶️πΊ
Here in this we designed Home page, Login Page, Forgot password page, Sign up page - the code for pages is explained by developer in the videos π πππ
Here since we will be using firebase as our authentication here, let us create an account for the sameπ₯π
Creating Firebase App π₯
Create a firebase account - Firebase console π
Now click on create a new firebase project ➕
You can turn off Google Analytics as it is not recommended for demo app π«π
click on Add app ➕π±
select web π
Register your app
make sure to save config file as we are going to use it in our code for authentication πΎπ
Creating Firebase Authentication π
Now click on Build π️
click on Authentication > Get started π
since for this setup, we will go on basic email/password authentication π§π
and now post enabling authentication, we need database to store credentials , let us use firebase database for saving user credentials π️
Creating Firebase Database π️
Build > Firestore Database > Create Database π️
click on standard edition ⭐
select location π
select test mode or production mode for this as rules can be updated later as well ⚙️
Now our Database and authentication is ready ✅
And now since our DB setup is ready, Download our code from here - Gym per day Day2
Deploying and Integrating Firebase Authentication for App π
Download VS code and now in VS code π»
command
git clone https://github.com/sagarkakkalasworld/Gym-per-day-Day2.git
And also make sure nodejs and npm are install in your local π§©
And now install firebase and react router dom
command:
npm install firebase
npm install react-router-dom
Now in the code, find firebase.js file in src folder π
Now update the config file with details which we got while configuring app, in case, you missed, Go to firebase console π
Click on Apps> settings icon ⚙️
and scroll down to find details ⬇️
And copy paste the code in firebase.js π
and now let us build this app on our localπ ️
command:
npm run build
and now to deploy it on localπ
command
npm run dev
And now access localhost at port shownπ
and landing pageπ
Testing Authentication π§ͺ
let us test authentication, click on sign upπ
Now if you see, firebase console - users are created π₯✅
but it fails to store credentials as Db has only read access, let us now update rules of database ⚠️
Now since we allowed both read and write, let us try sign up again
post sign up, you will be able to observer our DB is now getting updated with user information
and if i try to create account with same user again
since as of now,we have added both user types to same app, two roles are given here Gym owner and Gym user
and post login, it takes you back to home page as post login pages are not designed yet
and let us try "Forgot password" now
And now to check the mail, check in Junk or spamπ©π«π¬



































Comments
Post a Comment