A real-time call recording and transcription system built with Voiceflow Twilio voice integration, Next.js, and Bun. This application automatically records incoming calls, transcribes them, and provides a dashboard to manage and review call recordings and transcripts.
- 🎥 Automatic call recording for incoming calls
- 🔊 Dual-channel recording support
- 📝 Real-time transcription with PII redaction (Twilio Voice Intelligence)
- 💻 Web-based dashboard for call management
- 🔄 Real-time updates via WebSocket
- Bun runtime installed
- Node.js (v18 or higher)
- A Twilio account with:
- Account SID
- Auth Token
- Voice Intelligence Service SID
- Clone the repository:
git clone [repository-url]
cd poc-twilio-call-recorder- Install dependencies:
cd dashboard
bun install- Configure environment variables:
- Copy the template file:
cp .env.local.template .env.local
- Update
.env.localwith your credentials:
TWILIO_ACCOUNT_SID=your_account_sid TWILIO_AUTH_TOKEN=your_auth_token TWILIO_SERVICE_SID=your_voice_intelligence_service_sid PUBLIC_URL=your_public_url BUN_SERVER=http://localhost:3902 NEXT_PUBLIC_BUN_SERVER=http://localhost:3902 DASHBOARD_PORT=3901 BUN_PORT=3902
- Start the Bun server:
cd dashboard
bun run server/index.ts- In a new terminal, start the Next.js dashboard:
cd dashboard
bun run devThe application will be available at:
- Dashboard: http://localhost:3901
- Bun Server: http://localhost:3902
As an alternative to running the services directly, you can use Docker Compose:
-
Make sure you have Docker and Docker Compose installed on your system
-
Configure environment variables as described in the Setup section
-
Start the services:
docker compose up -d- View logs (optional):
docker compose logs -f- Stop the services:
docker compose downThe application will be available at the same ports:
- Dashboard: http://localhost:3901
- Bun Server: http://localhost:3902
Note: The Docker setup includes a persistent volume for the database data.
- Set up your Twilio phone number
- Configure the webhook URL in your Twilio console:
- Voice Configuration -> A call comes in
- Set to:
[YOUR_PUBLIC_URL]/v1/twilio/webhooks/voice - Method: GET
The application consists of two main components:
-
Bun Server (Port 3902)
- Handles Twilio webhooks
- Manages call recording
- Processes transcriptions
- WebSocket server for real-time updates
-
Next.js Dashboard (Port 3901)
- User interface for call management
- Real-time call updates
- Search and filtering capabilities
- Call record deletion
The project uses:
- Bun as the runtime and package manager
- TypeScript for type safety
- Next.js for the frontend
- WebSocket for real-time communication
- Never commit
.env.localto version control - Keep your Twilio credentials secure
- Use HTTPS in production
- Implement proper authentication for the dashboard in production
ISC
Nicolas Arcay Bermejo | Voiceflow