Skip to content

myrashid56/whatsapp-dashboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WhatsApp Cloud API SaaS Platform

A comprehensive SaaS platform for WhatsApp Business Cloud API integration with advanced messaging automation and AI features.

Features

  • WhatsApp Cloud API Integration: Complete integration with Meta's official WhatsApp Business API
  • Multi-role Dashboard: Separate admin and client interfaces
  • Message Templates: Manage and send templated messages
  • Contact Management: Organize and manage customer contacts
  • Broadcasting: Send bulk messages to multiple contacts
  • AI Automation: OpenAI-powered message enhancement and automation
  • Real-time Chat: WebSocket-based live messaging
  • Subscription Management: Multi-tier subscription system
  • Domain Configuration: Custom domain support with verification

Technology Stack

  • Frontend: React 18, TypeScript, Tailwind CSS, shadcn/ui
  • Backend: Node.js, Express, TypeScript
  • Database: PostgreSQL with Drizzle ORM
  • Authentication: JWT-based with role-based access control
  • Real-time: WebSocket support for live updates
  • Build Tools: Vite (frontend), esbuild (backend)

Quick Start (Development)

  1. Clone and install dependencies:

    npm install
  2. Set up environment:

    cp .env.example .env
    # Edit .env with your configuration
  3. Set up database:

    npm run db:push
  4. Start development server:

    npm run dev

Production Deployment

Ubuntu VM Deployment

See DEPLOYMENT.md for complete Ubuntu deployment instructions.

Quick Deploy Script

  1. Run the deployment script:

    chmod +x deploy.sh
    ./deploy.sh
  2. Upload application files and configure:

    cd /opt/whatsapp-saas
    npm install
    npm run build
    npm run db:push
    pm2 start ecosystem.config.js

Environment Variables

Variable Description Required
DATABASE_URL PostgreSQL connection string
JWT_SECRET JWT signing secret
WHATSAPP_ACCESS_TOKEN WhatsApp API access token
WHATSAPP_PHONE_NUMBER_ID WhatsApp phone number ID
WHATSAPP_BUSINESS_ACCOUNT_ID WhatsApp business account ID
OPENAI_API_KEY OpenAI API key for AI features
NODE_ENV Environment (development/production)
PORT Server port (default: 5000)
APP_URL Application base URL

API Endpoints

Authentication

  • POST /api/auth/login - User login
  • POST /api/auth/register - User registration
  • GET /api/auth/me - Get current user
  • POST /api/auth/logout - User logout

WhatsApp

  • GET /api/whatsapp/status - Check connection status
  • POST /api/whatsapp/configure - Configure WhatsApp API
  • POST /api/whatsapp/send - Send message
  • POST /api/whatsapp/webhook - Webhook endpoint

Templates

  • GET /api/templates - List templates
  • POST /api/templates - Create template
  • PUT /api/templates/:id - Update template
  • DELETE /api/templates/:id - Delete template

Contacts

  • GET /api/contacts - List contacts
  • POST /api/contacts - Create contact
  • PUT /api/contacts/:id - Update contact
  • DELETE /api/contacts/:id - Delete contact

Messages

  • GET /api/messages - List messages
  • POST /api/messages/send - Send message
  • GET /api/messages/recent - Recent messages

Broadcasts

  • GET /api/broadcasts - List broadcasts
  • POST /api/broadcasts - Create broadcast
  • GET /api/broadcasts/recent - Recent broadcasts

Project Structure

├── client/                 # React frontend
│   ├── src/
│   │   ├── components/    # React components
│   │   ├── pages/         # Page components
│   │   ├── lib/           # Utility functions
│   │   └── main.tsx       # App entry point
│   └── index.html
├── server/                # Node.js backend
│   ├── routes.ts         # API routes
│   ├── auth.ts           # Authentication logic
│   ├── storage.ts        # Data storage interface
│   ├── db.ts             # Database connection
│   └── index.ts          # Server entry point
├── shared/               # Shared types and schemas
│   └── schema.ts         # Database schemas
├── package.json
├── vite.config.ts        # Frontend build config
├── drizzle.config.ts     # Database config
└── ecosystem.config.js   # PM2 config

Scripts

  • npm run dev - Start development server
  • npm run build - Build for production
  • npm run start - Start production server
  • npm run db:push - Push database schema
  • npm run check - Type check

Security Features

  • JWT-based authentication
  • Role-based access control (admin/client)
  • Input validation with Zod
  • SQL injection protection
  • CORS configuration
  • Environment variable validation

WhatsApp API Setup

  1. Create a Meta Developer account at developers.facebook.com
  2. Create a new app and add WhatsApp product
  3. Get your access token and phone number ID
  4. Configure webhook URL (your-domain.com/api/whatsapp/webhook)
  5. Add required environment variables

License

MIT License - see LICENSE file for details

Support

For issues and questions:

  1. Check the deployment guide in DEPLOYMENT.md
  2. Review application logs
  3. Verify environment configuration
  4. Ensure all required services are running

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages