Skip to content

swethas274/Clickjacking_Login_Page

Repository files navigation

Project Setup Guide

EDUCATIONAL PURPOSE ONLY

Firebase Authentication Setup Guide


Firebase Authentication & Deployment Guide


🛠️ Complete Setup Steps

1. Clone Repository & Initialize

# Clone your project
git clone https://github.com/your-username/your-repo.git
cd your-repo

# Initialize Git (if new project)
git init
git add .
git commit -m "Initial commit"

# Install dependencies
npm install

2. Firebase Setup

# Install Firebase CLI
npm install -g firebase-tools

# Login and initialize
firebase login
firebase init

? Select features: 
  ◯ Authentication
  ◯ Firestore
  ◯ Hosting
  ◯ Functions (space to select)

? Select project: Choose existing or create new
? Configure Firestore rules? Yes
? Configure Hosting? Yes (set public dir to "public" or "dist")

3. Configure Authentication

Go to Firebase Console Enable providers: Authentication → Sign-in method → Email/Password & Google

Add authorized domains:

localhost
127.0.0.1
your-site.netlify.app

4. Get API Keys

// Copy from Firebase Console → Project Settings → Web App
const firebaseConfig = {
  apiKey: "AIzaSyA...",
  authDomain: "your-project.firebaseapp.com",
  projectId: "your-project",
  storageBucket: "your-project.appspot.com",
  messagingSenderId: "123456789",
  appId: "1:123456789:web:abc123def456"
};

5. Run Locally

# Start development server
npm run dev

# Or with Firebase emulator
firebase emulators:start

6. Deploy to Production

# Build project (if using framework)
npm run build

# Commit changes
git add .
git commit -m "Ready for deployment"

# Deploy to Firebase
firebase deploy --only hosting,firestore

# Push to GitHub
git push origin main

🚨 Troubleshooting Guide

image

rules:

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read, write: if request.auth != null;
    }
  }
}

Git Issues

# If Firebase files are ignored:
git add -f firebase.json .firebaserc

# Reset local changes:
git stash
git pull origin main

✅ Verification Checklist Firebase CLI installed (firebase --version)

API keys added to frontend code

Tested login flow locally

Firestore rules deployed

Domain authorized in Firebase Console

About

educational purposes only

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published