Public
Like
App
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v5View latest version
A web application that tracks deleted messages from WhatsApp using the WhatsApp Business API.
- Receives WhatsApp messages via webhook
- Tracks when messages are deleted by senders
- Provides a web interface to view deleted messages
- Stores message history and deletion events
-
WhatsApp Business API Setup:
- Create a WhatsApp Business account
- Set up a webhook URL pointing to this app
- Configure the webhook to receive message events
- Get your access token and verify token
-
Environment Variables:
WHATSAPP_VERIFY_TOKEN: Token for webhook verificationWHATSAPP_ACCESS_TOKEN: Access token for WhatsApp APIWHATSAPP_PHONE_NUMBER_ID: Your WhatsApp Business phone number ID
-
Webhook Configuration:
- Webhook URL:
https://your-app-url.web.val.run/webhook - Verify Token: Use the same token as
WHATSAPP_VERIFY_TOKEN - Subscribe to:
messagesevents
- Webhook URL:
├── backend/
│ ├── database/
│ │ ├── migrations.ts # Database schema
│ │ └── queries.ts # Database operations
│ ├── routes/
│ │ ├── webhook.ts # WhatsApp webhook handler
│ │ └── api.ts # API routes for frontend
│ └── index.ts # Main server entry point
├── frontend/
│ ├── components/
│ │ ├── App.tsx # Main app component
│ │ ├── MessageList.tsx # Deleted messages list
│ │ └── MessageItem.tsx # Individual message display
│ ├── index.html # Main HTML template
│ └── index.tsx # Frontend entry point
└── shared/
└── types.ts # Shared TypeScript types
- WhatsApp sends webhook events when messages are received or deleted
- The app stores all incoming messages in the database
- When a deletion event is received, the message is marked as deleted
- Users can view deleted messages through the web interface
- The app maintains a history of all messages and their deletion status
GET /- Web interfacePOST /webhook- WhatsApp webhook endpointGET /webhook- Webhook verificationGET /api/deleted-messages- Get all deleted messagesGET /api/messages/:chatId- Get messages for a specific chat
This app requires proper WhatsApp Business API setup and webhook configuration to function correctly.