Skip to content

Repository files navigation

πŸ” Angular Firebase Auth

Angular Firebase AngularFire Completed

Repository GitHub Stars Last Commit


πŸ“‘ Table of Contents


🌐 Live Demo

πŸ”— https://alobuuls.github.io/angular-firebase-auth/


πŸ“– Description

Note

An Angular 16 application that implements a complete authentication workflow using Firebase Authentication and AngularFire.

The project demonstrates user registration, login, password recovery, email verification, protected areas, centralized Firebase error handling, loading states, and modern Angular development practices.


βš™οΈ System Requirements

Before running the project, make sure you have installed:

  • πŸ“¦ Node.js: v16.14.x – v18.x (recommended: v18.10.0 LTS)
  • πŸ“¦ npm: v8+
  • πŸ…°οΈ Angular CLI: v16.x
  • πŸ”₯ Firebase Project

Recommended using nvm

nvm install 18
nvm use 18

πŸ” Verify Installed Versions

Run the following commands in your terminal:

node -v
npm -v
ng version

πŸš€ Project Installation

1️⃣ Clone the repository

git clone git@github.com:alobuuls/angular-firebase-auth.git

cd angular-firebase-auth

2️⃣ Install dependencies

npm install

πŸ”₯ Firebase Configuration

Create or update:

src/app/environments/environments.ts

Add your Firebase configuration:

export const environment = {
  production: false,
  firebase: {
    apiKey: '',
    authDomain: '',
    projectId: '',
    storageBucket: '',
    messagingSenderId: '',
    appId: '',
  },
};

Enable the following provider:

  • Email / Password Authentication

From:

Firebase Console
β†’ Authentication
β†’ Sign-in method

▢️ Run the Project

Start the development server:

ng serve

Then open:

http://localhost:4200

🧠 Project Architecture

The application follows a component-based architecture with centralized Firebase error management and authentication workflows.

πŸ”₯ Authentication Components

Responsible for:

  • User registration
  • User login
  • Password recovery
  • Email verification
  • User interaction flows

βš™οΈ Firebase Error Service

Responsible for:

  • Firebase error translation
  • Error message centralization
  • User-friendly notifications

⏳ Shared Loading Component

Responsible for:

  • Loading state visualization
  • Reusable spinner implementation
  • User feedback during requests

🏠 Dashboard Component

Responsible for:

  • Authenticated user area
  • Protected content
  • Session management

✨ Features

  • πŸ”‘ User Login
  • πŸ“ User Registration
  • πŸ“§ Email Verification
  • πŸ”„ Password Recovery
  • πŸšͺ Logout Functionality
  • πŸ”₯ Firebase Authentication Integration
  • βš™οΈ Firebase Error Handling
  • ⏳ Loading States
  • πŸ“‹ Reactive Forms
  • βœ… Angular Form Validations
  • πŸ”” Toastr Notifications
  • πŸš€ AngularFire Integration

πŸ›  Technologies Used

Technology Purpose
Angular 16 Front-End Framework
TypeScript Application Logic
Firebase Authentication User Authentication
AngularFire Firebase Integration
Reactive Forms Form Management
Angular Router Navigation
ngx-toastr Notifications
RxJS Reactive Programming

πŸ“ Project Structure

angular-firebase-auth/

β”œβ”€β”€ src/
β”‚
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ login/
β”‚   β”‚   β”œβ”€β”€ register/
β”‚   β”‚   β”œβ”€β”€ password-recover/
β”‚   β”‚   β”œβ”€β”€ verify-email/
β”‚   β”‚   └── dashboard/
β”‚   β”‚
β”‚   β”œβ”€β”€ services/
β”‚   β”‚   └── firebase-code-error.service.ts
β”‚   β”‚
β”‚   β”œβ”€β”€ shared-loading/
β”‚   β”‚   β”œβ”€β”€ shared-loading.component.ts
β”‚   β”‚   └── shared-loading.component.html
β”‚   β”‚
β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   └── firebase-code-error.ts
β”‚   β”‚
β”‚   β”œβ”€β”€ environments/
β”‚   β”‚   β”œβ”€β”€ environments.ts
β”‚   β”‚   └── environments.prod.ts
β”‚   β”‚
β”‚   β”œβ”€β”€ app-routing.module.ts
β”‚   β”œβ”€β”€ app.component.ts
β”‚   └── app.module.ts
β”‚
β”œβ”€β”€ firebase.json
β”œβ”€β”€ angular.json
β”œβ”€β”€ package.json
└── README.md

πŸ”₯ Best Practices Implemented

  • Reactive Forms
  • Separation of Concerns
  • Centralized Error Handling
  • Reusable Components
  • Service-based Architecture
  • Environment Configuration
  • Loading State Management
  • Strong Typing with TypeScript
  • Modular Project Structure
  • Firebase Integration Best Practices

🎯 Project Goal

Practice and strengthen Angular authentication concepts through the implementation of a real-world Firebase Authentication workflow.

Key concepts covered:

  • Firebase Authentication
  • AngularFire
  • Reactive Forms
  • Password Recovery
  • Email Verification
  • Error Handling
  • Loading States
  • Notifications
  • TypeScript Best Practices
  • Front-End Architecture

πŸ“„ License

This project is intended for educational and portfolio purposes.

Created by Alondra Francisco.

About

Angular 16 authentication system with Firebase Auth, email verification, password recovery and protected routes.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages