Skip to content

Leadfusionhq/leadfusion

Repository files navigation

πŸš€ LeadFusion - Lead Management Platform

Version Next.js React TypeScript Tailwind License

A modern frontend application for lead management, built with Next.js 16, React 19, and TypeScript

πŸ“Œ Note: This is the frontend application that consumes APIs from the LeadFusion Node.js Backend

Features β€’ Tech Stack β€’ Getting Started β€’ Project Structure β€’ API Documentation


Features

Lead Management

  • Lead Tracking - Comprehensive lead lifecycle management
  • Campaign Integration - Associate leads with marketing campaigns
  • CSV Import - Bulk lead import functionality
  • Lead Status Workflow - Track payment status, return status, and lead progression
  • Real-time Updates - Socket.io integration for live lead updates

Dual Dashboard System

User Dashboard

  • Personal Dashboard - View your leads, campaigns, and billing info
  • Campaign Management - Create and manage your marketing campaigns
  • Billing Control - Track spending and manage payments
  • Settings - Personal profile and preferences
  • FAQ & Support - In-app help and feedback system
  • Live Chat - Real-time communication support

Admin Dashboard

  • User Management - Full user administration with verification controls
  • Lead Analytics - Comprehensive lead tracking and reporting
  • Campaign Oversight - Monitor and manage all campaigns
  • Location Management - Geographic targeting and coverage
  • Activity Logs - Full audit trail of system activities
  • System Settings - Platform-wide configuration

Enterprise-Grade Authentication

  • JWT-based Authentication - Secure token management
  • Remember Me - Extended 30-day sessions
  • Role-based Access Control - Admin/User permission levels
  • Email Verification - Secure account activation
  • Password Recovery - Forgot password flow with secure reset
  • Session Monitoring - Cross-tab session synchronization
  • Redis Caching - Optimized auth token caching

Billing & Payments

  • Real-time Balance Tracking - Current account balance display
  • Payment Processing - Secure payment integration
  • Transaction History - Full payment audit trail
  • Pay Now Feature - Single-click lead payment

Location Features

  • Google Maps Integration - Interactive map-based location picking
  • Geographic Targeting - State and zip code coverage
  • Leaflet Maps - Alternative mapping solution

Real-time Communication

  • Socket.io Integration - Live updates and notifications
  • In-app Chat - User-to-admin communication
  • Notification System - Real-time alerts

Tech Stack

Frontend

Technology Version Purpose
Next.js 16.x React Framework
React 19.x UI Library
TypeScript 5.x Type Safety
Tailwind CSS 4.x Styling
Redux Toolkit 2.x State Management
MUI (Material-UI) 7.x UI Components
Formik + Yup Latest Form Management
Recharts 3.x Data Visualization
Socket.io Client 4.x Real-time Communication

Getting Started

Prerequisites

  • Node.js 18+ (see .nvmrc)
  • npm or pnpm
  • LeadFusion Backend API running (see leadfusion-api)

Installation

  1. Clone the repository

    git clone https://github.com/leadfusionhq/leadfusion.git
    cd leadfusion
  2. Install dependencies

    npm install
    # or
    pnpm install
  3. Set up environment variables

    cp .env.example .env

    Configure the following in .env:

    NEXT_PUBLIC_BASE_URL=http://localhost:3000
    NEXT_PUBLIC_BACKEND_API_URL=http://localhost:8080
    NEXT_PUBLIC_GOOGLE_MAPS_API_KEY=your_google_maps_api_key
    
  4. Run the development server

    npm run dev
    # or
    pnpm dev
  5. Open your browser

    Navigate to http://localhost:3000

Docker Development

# Using Docker Compose
docker-compose up -d

# Or build manually
docker build -f Dockerfile.dev -t leadfusion-dev .
docker run -p 3000:3000 leadfusion-dev

πŸ“ Project Structure

leadfusion/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/                    # Next.js App Router
β”‚   β”‚   β”œβ”€β”€ api/                # API Routes
β”‚   β”‚   β”‚   β”œβ”€β”€ auth/           # Authentication endpoints
β”‚   β”‚   β”‚   └── admin/          # Admin-only endpoints
β”‚   β”‚   β”œβ”€β”€ admin/              # Admin pages
β”‚   β”‚   β”œβ”€β”€ dashboard/          # User dashboard pages
β”‚   β”‚   β”œβ”€β”€ login/              # Auth pages
β”‚   β”‚   β”œβ”€β”€ register/
β”‚   β”‚   └── ...
β”‚   β”‚
β”‚   β”œβ”€β”€ components/             # React Components
β”‚   β”‚   β”œβ”€β”€ admin-dashboard/    # Admin UI components
β”‚   β”‚   β”‚   β”œβ”€β”€ campaigns/
β”‚   β”‚   β”‚   β”œβ”€β”€ leads/
β”‚   β”‚   β”‚   β”œβ”€β”€ user-management/
β”‚   β”‚   β”‚   └── ...
β”‚   β”‚   β”œβ”€β”€ user-dashboard/     # User UI components
β”‚   β”‚   β”‚   β”œβ”€β”€ campaigns/
β”‚   β”‚   β”‚   β”œβ”€β”€ leads/
β”‚   β”‚   β”‚   β”œβ”€β”€ billing-control/
β”‚   β”‚   β”‚   └── ...
β”‚   β”‚   β”œβ”€β”€ auth/               # Auth components
β”‚   β”‚   β”œβ”€β”€ common/             # Shared components
β”‚   β”‚   β”œβ”€β”€ Layout/             # Layout components
β”‚   β”‚   └── ...
β”‚   β”‚
β”‚   β”œβ”€β”€ redux/                  # Redux state management
β”‚   β”‚   β”œβ”€β”€ auth/               # Auth slice & actions
β”‚   β”‚   └── store.ts
β”‚   β”‚
β”‚   β”œβ”€β”€ hooks/                  # Custom React hooks
β”‚   β”œβ”€β”€ context/                # React Context providers
β”‚   β”œβ”€β”€ services/               # Business logic services
β”‚   β”œβ”€β”€ utils/                  # Utility functions
β”‚   β”œβ”€β”€ types/                  # TypeScript definitions
β”‚   β”œβ”€β”€ middleware/             # API middleware
β”‚   β”œβ”€β”€ models/                 # MongoDB models
β”‚   └── mails/                  # Email templates
β”‚
β”œβ”€β”€ public/                     # Static assets
β”œβ”€β”€ docker-compose.yml          # Docker configuration
β”œβ”€β”€ Dockerfile                  # Production Dockerfile
β”œβ”€β”€ Dockerfile.dev              # Development Dockerfile
└── package.json

Available Scripts

# Development
npm run dev          # Start development server

# Production
npm run build        # Build for production
npm run start        # Start production server

# Code Quality
npm run lint         # Run ESLint

πŸ”§ Configuration

TypeScript Configuration

The project uses strict TypeScript configuration. See tsconfig.json for details.

ESLint Configuration

ESLint is configured via eslint.config.mjs with Next.js recommended rules.

Installing Type Definitions

When adding new dependencies, install types with:

npm i --save-dev @types/package-name

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.


Support

For support, please contact the development team or open an issue on GitHub.



Built with ❀️ by the LeadFusion Team | https://github.com/leadfusionhq/leadfusion