This project demonstrates how to implement authentication using Firebase in an Angular 19 application. It includes traditional email/password registration and login, as well as authentication via Google Sign-In.
- 🔑 Register using email and password
- 🔐 Login with existing email/password
- 📧 "Forgot Password" functionality to receive a password reset email
- 🌐 Sign in with Google
- LoginComponent — Handles the login form and Google sign-in
- RegisterComponent — Allows users to create an account
- DashboardComponent — Main dashboard after successful authentication
- VerifyEmailComponent — View shown after initiating the "Forgot Password" process
- AuthService — Centralized service that provides authentication functionality:
login()register()logout()forgotPassword()signInWithGoogle()
git clone <url-of-your-forked-repo>
cd <project-directory>
npm install- Go to Firebase Console
- Create a new Firebase project
- Navigate to Build > Authentication
- Click Get Started
- Under Sign-in providers, enable:
- Email/Password
- Go to Project Settings (gear icon near Project Overview)
- Register a new Web App and follow the setup steps
- Copy the
firebaseConfigobject provided - Paste it into your Angular project’s
app.config.tsfile (inside the designated comment)
Open the local cloned project in VS Code and launch the terminal and run the below ng command.
ng serveOpen your browser and navigate to http://localhost:4200/
- You’ll be presented with the Login Page
- Click the Register link to sign up using email/password
- After registration, your credentials will be saved in Firebase
- Login using the registered credentials
- On success, you'll be navigated to the Dashboard
- Try signing in with Google by clicking "Sign in with Google"
- On success, you’ll be authenticated and redirected to the dashboard
- You can view your sign-in info inside your Firebase console
- Make sure to configure Firebase correctly before running the app
- Firebase may require you to add authorized domains (like
localhost) to the authentication settings - Always keep sensitive data like API keys and config in environment-specific files or secure storage
This project is open-source and available under the MIT License.