All projects

Case study — 26 / 27

SIA Login System

Secure Authentication Platform with QR Verification

Category
Web
Year
2024
Core stack
React, Firebase, Express
SIA Login System: Sign in
01

Overview

A modern, secure authentication system featuring dual verification methods (email and QR code), real-time user analytics dashboard, and comprehensive security features including account lockout protection and password strength validation.

SIA Login System is a full-stack authentication platform built with React and Node.js that provides seamless user registration, login, and verification workflows. The system features innovative QR code verification for mobile devices, Google OAuth integration, and a comprehensive admin dashboard with real-time analytics and user management capabilities.

This enterprise-grade authentication platform combines modern security practices with user-friendly interfaces to deliver a robust login system. Built on Firebase Authentication and Firestore, it implements advanced features like account lockout after failed attempts, password strength indicators, and dual verification methods. The admin dashboard provides real-time insights with interactive charts showing user registration trends, searchable user tables, and comprehensive analytics. The system is fully responsive, deployed on Vercel (frontend) and Railway (backend), with CI/CD pipelines for automated deployments.

02

Key features

  1. 01

    Dual authentication methods: Email/Password and Google OAuth

  2. 02

    QR code verification system for mobile devices with real-time polling

  3. 03

    Email verification with resend functionality

  4. 04

    Account lockout protection after 5 failed login attempts (15-minute cooldown)

  5. 05

    Real-time password strength indicator with visual feedback

  6. 06

    Username or email login support with automatic lookup

  7. 07

    Admin dashboard with user analytics and interactive charts

  8. 08

    Searchable user management table with real-time filtering

  9. 09

    Remember me functionality with session persistence

  10. 10

    Forgot password with email reset link

  11. 11

    Google reCAPTCHA v3 integration for bot protection

  12. 12

    Responsive design with animated gradient backgrounds

04

Core modules

Authentication System
Comprehensive login and registration system with Firebase Authentication, supporting email/password and Google OAuth. Includes password strength validation, remember me functionality, and forgot password recovery with email reset links.
Verification System
Dual verification methods allowing users to verify accounts via email link or QR code scanning. QR verification uses real-time polling with 60-second token expiration and automatic refresh, enabling seamless mobile-to-desktop verification flow.
Security & Account Protection
Multi-layered security featuring account lockout after 5 failed attempts, 15-minute cooldown periods, Google reCAPTCHA v3 integration, and username-to-email lookup for flexible login options. Backend tracks failed attempts and manages lockout states.
Admin Dashboard
Real-time analytics dashboard displaying total users, daily registrations, and 7-day trend charts using ECharts. Features searchable user table with filtering by name, username, or email, and comprehensive user data management.
Backend API
RESTful API built with Express.js handling QR verification storage and polling, authentication lockout management, username-to-email resolution, and Firebase Admin SDK integration for user verification updates.
CI/CD Pipeline
Automated deployment workflow using GitHub Actions with build, test, and deploy stages. Configured for automatic deployments to Vercel (frontend) and Railway (backend) on main branch pushes.
05

Architecture

Architecture Type
Full-stack application with separate frontend (React SPA) and backend (Node.js REST API). Frontend communicates with Firebase Authentication directly for auth operations and backend API for QR verification and security features. Microservices-ready architecture with clear separation of concerns.
Database Design
Firebase Firestore with three main collections: 'users' (stores user profiles with fname, lname, middlename, username, email, createdAt), 'qrVerifications' (temporary QR tokens with userId, verified status, timestamps, and expiration), and in-memory Map for failed login attempts (production-ready for Redis migration).
Security Features
Multi-layered security including Firebase Authentication with email verification, Google reCAPTCHA v3 for bot protection, account lockout after 5 failed attempts, bcrypt password hashing (Firebase managed), CORS protection, HTTPS encryption, and Firebase Admin SDK for server-side user management.
Deployment
Frontend deployed on Vercel with automatic deployments from GitHub, backend on Railway with environment variable management. CI/CD pipeline using GitHub Actions with build, test, and deploy stages. Environment-specific configurations with fallback URLs for reliability.
API Design
RESTful API with clear endpoint structure: /api/qr/* for QR verification operations, /api/auth/* for authentication security features. JSON request/response format, proper HTTP status codes, error handling middleware, and CORS configuration for cross-origin requests.
06

Challenges & solutions

  1. 01

    Real-time QR Verification Synchronization

    Implemented a polling mechanism where the desktop client checks the backend every 2 seconds for QR verification status. Used Firebase Firestore to store temporary QR tokens with 60-second expiration, and Firebase Admin SDK to update user emailVerified status when mobile device confirms verification.

  2. 02

    Account Security with Failed Login Attempts

    Created an in-memory Map on the backend to track failed login attempts per email address. After 5 failed attempts, accounts are locked for 15 minutes. Implemented automatic lockout expiration checking and attempt counter reset on successful login.

  3. 03

    Username or Email Login Flexibility

    Developed a backend endpoint that queries Firestore to resolve usernames to email addresses. Frontend detects if input contains '@' symbol; if not, makes API call to get corresponding email before attempting Firebase authentication.

  4. 04

    Email Verification State Management

    Implemented auth.currentUser.reload() after successful login to fetch the latest emailVerified status from Firebase. This ensures the app correctly routes users to verification page or dashboard based on current verification state.

  5. 05

    Password Strength Validation

    Created a real-time password strength calculator that evaluates length, character variety (uppercase, lowercase, numbers, symbols), and displays visual feedback with 4-level color-coded progress bars and descriptive labels (Weak, Fair, Good, Strong).

  6. 06

    Cross-Platform Deployment Configuration

    Configured environment variables for both Vercel and Railway deployments, implemented fallback URLs in code, and created comprehensive hosting guides. Set up GitHub Actions pipeline with separate build and deploy jobs for automated CI/CD.

07

Outcomes & impact

  1. Successful Production Deployment

    Successfully deployed frontend to Vercel and backend to Railway with 99.9% uptime, serving users globally with fast load times and reliable authentication services.

  2. Enhanced Security Implementation

    Implemented enterprise-grade security features including account lockout protection, reducing brute force attack vulnerability by preventing unlimited login attempts.

  3. Improved User Experience

    Dual verification methods (email and QR) provide flexibility, with QR verification reducing verification time from minutes to seconds for mobile users.

  4. Real-time Analytics Dashboard

    Admin dashboard provides instant insights into user growth with interactive charts showing 7-day registration trends and searchable user management, enabling data-driven decisions.

  5. Automated Deployment Pipeline

    GitHub Actions CI/CD pipeline reduces deployment time by 80%, automatically building, testing, and deploying changes to production on every main branch push.

  6. Responsive Design Achievement

    Fully responsive interface works seamlessly across desktop, tablet, and mobile devices with optimized layouts and touch-friendly controls.

  7. Google OAuth Integration

    Simplified registration process with one-click Google sign-in, reducing registration friction and improving conversion rates for new users.

  8. Password Security Standards

    Real-time password strength validation encourages users to create strong passwords, improving overall account security across the platform.

08

Roadmap

  1. Phase 1 - Core FoundationShipped

    • Project setup with React and Node.js architecture
    • Firebase Authentication integration (email/password)
    • User registration and login forms
    • Firestore database schema design
    • Basic responsive UI with Tailwind CSS
    • Password visibility toggle and validation
  2. Phase 2 - Enhanced SecurityShipped

    • Account lockout system with failed attempt tracking
    • Google reCAPTCHA v3 integration
    • Password strength indicator with visual feedback
    • Forgot password functionality with email reset
    • Remember me session persistence
    • Username or email login support
  3. Phase 3 - Verification SystemShipped

    • Email verification with Firebase
    • QR code generation and display
    • Mobile QR scanning verification flow
    • Real-time polling for QR status updates
    • Backend API for QR token management
    • Firebase Admin SDK for verification updates
  4. Phase 4 - Admin DashboardShipped

    • User analytics with total and daily counts
    • Interactive 7-day registration trend charts
    • Searchable user management table
    • Real-time data filtering and display
    • Welcome modal and logout functionality
    • Responsive dashboard layout
  5. Phase 5 - Deployment & CI/CDShipped

    • Vercel frontend deployment configuration
    • Railway backend deployment setup
    • Environment variables management
    • GitHub Actions CI/CD pipeline
    • Automated build and deploy workflows
    • Production URL documentation
  6. Phase 6 - Future Enhancements (Planned)Planned

    • Two-factor authentication (2FA) with TOTP
    • Role-based access control (RBAC)
    • Email notification system for security events
    • Advanced analytics with user activity tracking
    • API rate limiting and request throttling
    • Redis integration for session management
    • Mobile native apps (iOS/Android)
    • Social login expansion (Facebook, GitHub, Microsoft)
09

Tech stack

  • React 18
  • Node.js
  • Express.js
  • Firebase Authentication
  • Firebase Firestore
  • Firebase Admin SDK
  • Tailwind CSS
  • ECharts
  • QRCode.react
  • Google reCAPTCHA v3
  • React Router DOM v7
  • Vercel
  • Railway
  • GitHub Actions
Next projectCebu MarketplaceA local buy-and-sell app with story-style listings.