Skip to content

modousall/livepay.tech

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

🚀 LIVE TECH - WhatsApp Business SaaS Platform

Plateforme SaaS B2B pour digitaliser la relation client via WhatsApp Business

GitHub License Version


📊 Performance & Scalabilité

Métrique Valeur
Frontend Size 1.5 MB (394 KB gzipped)
Server Bundle 845 KB
Webhook Latency <1s
Cache Lookup O(1) avec Redis
Build Time <3s
Vendeurs Supportés >50 (Multi-WABA)

📚 Table of Contents


🎯 Quick Start

Prerequisites

  • Node.js v20+ (Download)
  • npm v10+
  • Supabase account (free tier works)
  • Meta Developer Account (WhatsApp Business API)

5-Minute Setup

# 1. Clone repository
git clone https://github.com/modousall/livetech.git
cd livetech

# 2. Install dependencies
npm install

# 3. Setup environment
cp .env.example .env
# Edit .env with your Supabase & WhatsApp credentials

# 4. Start development server
npm run dev

# 5. Open browser
# Visit: http://localhost:9002

✨ Features

💬 Conversations WhatsApp

  • Interface unifiée pour toutes les conversations clients
  • Historique complet des messages
  • Assignment aux agents
  • Escalade bot → agent humain

🤖 Bot Intelligent

  • Réponses automatiques par mots-clés
  • Scénarios de conversation configurables sans code
  • Triggers intelligents
  • Flux de conversation multi-étapes

📊 Statistiques Temps Réel

  • Temps de réponse moyens
  • Taux d'escalade bot/agent
  • Nombre de conversations actives
  • Performance des agents

👥 Gestion des Agents

  • Rôles: SUPER_ADMIN, CLIENT_ADMIN, AGENT
  • Assignment manuelle des conversations
  • Multi-tenant avec isolation des données
  • Audit logs pour toutes les actions

🔐 Security & Reliability

  • Multi-tenant architecture avec isolation
  • Row Level Security (RLS) Supabase
  • JWT authentication
  • Audit logging complet

🏗️ Architecture

Multi-WABA Architecture (v2.0)

LivePay Multi-WABA
├── Client Layer
│   ├── React Dashboard (vendeur)
│   ├── Settings (configure WABA)
│   └── Order Management
├── API Layer (Express)
│   ├── /api/webhooks/wasender/:vendorId
│   ├── /api/admin/vendors/:vendorId/*
│   └── /api/health
├── Service Layer
│   ├── WABAManager (Redis cache O(1))
│   ├── VendorWasenderService (per-vendor)
│   └── VendorWasenderWebhooks
├── Data Layer
│   ├── Firestore: waba_instances
│   └── Firestore: vendor_configs
└── External Services
    ├── Wasender (Multi-WABA gateway)
    └── Firebase (Hosting + Functions)

High-Level Overview

┌──────────────────────────────────────────────┐
│         🌐 WhatsApp Business API (Meta)      │
│                   ↑  ↓                       │
├──────────────────────────────────────────────┤
│                                              │
│  ┌──────────────┐       ┌──────────────┐   │
│  │   Frontend   │───────│   Backend    │   │
│  │  (Next.js)   │       │ (API Routes) │   │
│  └──────────────┘       └──────────────┘   │
│       ↑   ↓                    ↑   ↓        │
│       └──────────────┬─────────┘   │        │
│                      │             │        │
│                  ┌───▼───────────┐ │        │
│                  │   Supabase    │ │        │
│                  │  ├─ PostgreSQL│ │        │
│                  │  ├─ Realtime  │ │        │
│                  │  └─ Auth      │ │        │
│                  └───────────────┘ │        │
│                                    ↓        │
│              ┌──────────────────────────┐   │
│              │  Webhook WhatsApp        │   │
│              │  Bot Engine              │   │
│              └──────────────────────────┘   │
└──────────────────────────────────────────────┘

Multi-Tenant Data Model

tenants/                    # Organizations
  {id, name, type, status}

users/                      # User accounts
  {id, email, role, tenantId}

contacts/                   # WhatsApp contacts
  {id, phoneNumber, name, tenantId}

conversations/              # Conversation threads
  {id, contactId, tenantId, assignedTo, status}

messages/                   # Individual messages
  {id, conversationId, direction, content, type}

bot_scenarios/              # Bot configurations
  {id, tenantId, keywords, response, priority}

audit_logs/                 # Activity tracking
  {id, userId, action, resource, timestamp}

Tech Stack

Layer Technology
Frontend Next.js 14, React, TypeScript, Tailwind CSS
Backend Next.js API Routes
Database PostgreSQL (Supabase)
Auth Supabase Auth (JWT)
Real-time Supabase Realtime
UI shadcn/ui, Radix UI
Icons Lucide React

🔧 Setup & Installation

Environment Variables

# Copy template
cp .env.example .env

# Required variables:
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_service_key

WHATSAPP_API_URL=https://graph.facebook.com/v18.0
WHATSAPP_WEBHOOK_VERIFY_TOKEN=your_verify_token

NEXT_PUBLIC_APP_URL=http://localhost:3000

Supabase Setup

  1. Create a Supabase project at supabase.com
  2. Run the database migrations (SQL files in /supabase/migrations)
  3. Copy project URL and keys to .env

WhatsApp Business API Setup

  1. Create a Meta App at Meta for Developers
  2. Add WhatsApp product to your app
  3. Configure webhook URL: https://your-domain.com/api/webhook
  4. Get Phone Number ID and Access Token
  5. Save credentials in tenant settings

💻 Development

Available Commands

# Start development server
npm run dev

# Build for production
npm run build

# Start production server
npm start

# Type checking
npm run check

# Format code
npm run format

# Lint check
npm run lint

Code Style

This project uses ESLint and Prettier:

# Format & lint
npm run lint:fix

🚀 Deployment

Vercel (Recommended)

# 1. Push to GitHub
git push

# 2. Import project in Vercel
# 3. Add environment variables
# 4. Deploy

VPS Deployment

# Build
npm run build

# Start with PM2
npm install -g pm2
pm2 start npm --name "livetech" -- start

Production Checklist

  • Supabase credentials configured
  • WhatsApp webhook publicly accessible
  • SSL/HTTPS enabled
  • RLS policies verified
  • Audit logging enabled
  • Error monitoring (Sentry)

📖 Documentation

Document Purpose
docs/DEPLOYMENT.md Guide de déploiement complet
docs/API_WABA_ENDPOINTS.md API Multi-WABA endpoints
docs/API.md API générale reference
docs/MULTI_WABA_SETUP.md Architecture Multi-WABA
docs/FIRESTORE_SCHEMA.md Schéma Firestore
docs/FIRESTORE_UI_GUIDE.md Guide UI Firestore

🤝 Contributing

We welcome contributions! Please see .github/CONTRIBUTING.md

Quick PR Steps

  1. Fork the repository
  2. Create feature branch: git checkout -b feature/my-feature
  3. Commit: git commit -am 'feat: add my feature'
  4. Push: git push origin feature/my-feature
  5. Open Pull Request

📞 Support


📄 License

Proprietary - All rights reserved


🙏 Acknowledgments

Built for African businesses & public services. Powering customer relationships via WhatsApp across francophone Africa.

Website: https://livetech.africa Contact: contact@livepay.tech


Last updated: February 2026

About

No description, website, or topics provided.

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors