This is a comprehensive learning platform with course management, messaging integration (WhatsApp and Telegram), and user management capabilities. The platform allows educators to create courses, communicate with learners via messaging platforms, and track user progress and analytics.
- Frontend: React, TypeScript, Tailwind CSS with Shadcn/UI components
- Backend: Supabase (Auth, Database, Edge Functions)
- Messaging: WhatsApp Business API (via WATI), Telegram Bot API
- State Management: React Query for server state
- Routing: React Router
The platform uses a Supabase PostgreSQL database with the following main tables:
courses: Stores course informationcourse_days: Course content organized by dayscourse_paragraphs: Text content for each daywhatsapp_metadata: WhatsApp user conversation datatelegram_metadata: Telegram user conversation datauser_roles: User permission managementprofiles: User profile informationanalytics: Usage and engagement metrics
- Node.js and npm installed
- Supabase account with project set up
- WhatsApp Business API access via WATI
- Telegram Bot (created via BotFather)
- Clone the repository
- Install dependencies with
npm install - Set up environment variables in your Supabase project:
TELEGRAM_BOT_TOKEN: Your Telegram bot tokenWHATSAPP_API_KEY: Your WhatsApp Business API key
- Run the development server with
npm run dev
- Login/Signup: Access the login page at
/login - Admin Access: By default, new users are assigned the 'learner' role. To get admin access:
- Navigate to the Users page
- Click the "Make me an Admin" button (development environment only)
- View Courses: Navigate to the Courses page to see all available courses
- Create a Course:
- Click "Add Course" button
- Fill in the course details (name, description, category, language, price)
- Add content organized by days and paragraphs
- Click "Save Course" to save as draft
- Edit a Course:
- Click on the edit icon for any course in the list
- Make changes to content and details
- Use the WhatsApp preview to see how content will appear in WhatsApp
- Course Actions:
- View: Preview the course as a student would see it
- Duplicate: Create a copy of the course
- Archive: Hide the course without deleting it
- Delete: Permanently remove the course (requires confirmation)
- Configure WhatsApp:
- Navigate to the WhatsApp page
- The WhatsApp Business API connection status is displayed
- View and manage message templates
- Test WhatsApp Messages:
- Use the Message Tester tab
- Enter a recipient phone number
- Select a template
- Fill in template parameters
- Send test messages to users
- View WhatsApp Analytics:
- Check message statistics and user engagement
- Configure Telegram Bot:
- Navigate to the Telegram page
- Enter your bot token and username
- Set the webhook URL
- Manage Message Templates:
- Create and edit templates for automated messages
- Test Bot Messages:
- Use the Bot Tester to send sample messages
- View Users: Navigate to the Users page to see all platform users
- Add a New User:
- Click "Add User"
- Enter email and assign role (admin, instructor, learner)
- An invitation will be sent to their email
- Manage Users:
- Edit user details and roles
- Activate/deactivate user accounts
- Delete users if necessary
- Access Chat History: Navigate to the Chat History page
- View Conversations:
- Filter by platform (WhatsApp, Telegram, or All)
- Search for specific conversations
- Respond to Messages:
- Click on any conversation to open the chat window
- Send responses directly from the platform
The Analytics page provides insights on:
- User engagement
- Course completions
- Message statistics
- Platform usage trends
- The WhatsApp API service is fully integrated and working.
- Course content can be delivered to students via WhatsApp templates.
- All message data is stored in the Supabase database in the
whatsapp_metadatatable. - The integration uses a secure Edge Function to communicate with the WATI API.
- The Telegram Bot API is integrated.
- Users can receive course content and interact with the bot.
- Conversations are stored in the
telegram_metadatatable in Supabase. - The implementation uses Edge Functions to securely handle webhook events.