From 17979b1aeb98763410dfb6d7a15c1411df2232aa Mon Sep 17 00:00:00 2001 From: Himanshu Kumar <97390553+agarwalhimanshugaya@users.noreply.github.com> Date: Wed, 24 Jul 2024 19:32:48 +0000 Subject: [PATCH 1/4] change learn.md --- LEARN.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/LEARN.md b/LEARN.md index 544c97a5..1e56200e 100644 --- a/LEARN.md +++ b/LEARN.md @@ -6,6 +6,24 @@ UniCollab is not just a platform; it's a community-driven ecosystem that empower ## Getting Started +### With docker +- For run the App write the following command +```bash +docker build -t your-image-name . +docker push your-image-name + +``` +- For Deploy the App Locally with kubernetes + +1. Add the image name in deployment.yaml + +2. write the following command to run the app +```bash + +kubectl apply -f deployment.yaml +kubectl apply -f service.yaml + +``` ### 1. Clone the Repository First, clone the UniCollab repository to your local machine: From 6f98b9ec5d27d6c2936e69b91afc56b72b455801 Mon Sep 17 00:00:00 2001 From: Ojas Arora <127867874+Ojas-Arora@users.noreply.github.com> Date: Thu, 25 Jul 2024 12:06:39 +0530 Subject: [PATCH 2/4] Adding Twitter Authentication --- src/Components/Firebase/Firebase.js | 27 +++++++++++++++++++++++++-- src/Components/Login.js | 25 +++++++++++++++++++------ 2 files changed, 44 insertions(+), 8 deletions(-) diff --git a/src/Components/Firebase/Firebase.js b/src/Components/Firebase/Firebase.js index 4b4a51fc..5b0e97ec 100644 --- a/src/Components/Firebase/Firebase.js +++ b/src/Components/Firebase/Firebase.js @@ -2,7 +2,16 @@ import { initializeApp } from "firebase/app"; import { getAnalytics } from "firebase/analytics"; import { getFirestore } from "firebase/firestore"; -import { getAuth, GoogleAuthProvider, GithubAuthProvider, FacebookAuthProvider, signInWithPopup, RecaptchaVerifier, signInWithPhoneNumber } from "firebase/auth"; +import { + getAuth, + GoogleAuthProvider, + GithubAuthProvider, + FacebookAuthProvider, + TwitterAuthProvider, // Import TwitterAuthProvider + signInWithPopup, + RecaptchaVerifier, + signInWithPhoneNumber +} from "firebase/auth"; // Your web app's Firebase configuration const firebaseConfig = { @@ -22,8 +31,22 @@ const db = getFirestore(firebaseApp); const googleProvider = new GoogleAuthProvider(); const githubProvider = new GithubAuthProvider(); const facebookProvider = new FacebookAuthProvider(); +const twitterProvider = new TwitterAuthProvider(); // Initialize TwitterAuthProvider const auth = getAuth(firebaseApp); -export { auth, signInWithPopup, githubProvider, googleProvider, facebookProvider, GithubAuthProvider, FacebookAuthProvider, RecaptchaVerifier, signInWithPhoneNumber }; +export { + auth, + signInWithPopup, + githubProvider, + googleProvider, + facebookProvider, + twitterProvider, // Export twitterProvider + GithubAuthProvider, + FacebookAuthProvider, + TwitterAuthProvider, // Export TwitterAuthProvider + RecaptchaVerifier, + signInWithPhoneNumber +}; + export { db, analytics, firebaseApp as app }; export default firebaseApp; diff --git a/src/Components/Login.js b/src/Components/Login.js index eca6a885..dd693de1 100644 --- a/src/Components/Login.js +++ b/src/Components/Login.js @@ -12,6 +12,7 @@ import { createUserWithEmailAndPassword, RecaptchaVerifier, signInWithPhoneNumber, + TwitterAuthProvider } from 'firebase/auth'; const LogIn = () => { @@ -60,6 +61,18 @@ const LogIn = () => { console.error('Facebook sign-in error:', error); } }; + const handleTwitterSignIn = async () => { + try { + const twitterProvider = new TwitterAuthProvider(); + const result = await signInWithPopup(auth, twitterProvider); + const user = result.user; + localStorage.setItem('user', JSON.stringify(user)); + console.log('Twitter sign-in success:', user); + navigate('/'); + } catch (error) { + console.error('Twitter sign-in error:', error); + } + }; const handleLogin = async (e) => { e.preventDefault(); @@ -257,9 +270,9 @@ const LogIn = () => {