This project implements an AI-driven voice communication integration using the Twilio Programmable Voice API, Next.js, and PostgreSQL. It includes features such as real-time voice communication, transcription storage, sentiment analysis, and a dashboard to visualize interaction data.
- Real-time voice communication using Twilio Programmable Voice API
- Transcription of voice interactions stored in PostgreSQL
- JWT authentication for securing API endpoints
- Real-time speech sentiment analysis using Google Cloud Natural Language API
- Dashboard UI to visualize transcripts and interaction data
- Node.js (v14 or later)
- PostgreSQL database
- Twilio account with Programmable Voice API access
- Clone the repository:
git clone [https://github.com/your-username/voice-communication-integration.git](https://github.com/your-username/voice-communication-integration.git)
- Install dependencies:
npm install
# or
yarn install
# or
pnpm install
# or
bun install
- Set up environment variables:
Create a
.env.local
file in the root directory and add the following variables:
DATABASE_URL=""
AUTH_SECRET=""
GOOGLE_CLIENT_ID=""
GOOGLE_CLIENT_SECRET=""
TWILIO_ACCOUNT_SID=""
TWILIO_AUTH_TOKEN=""
NEXTAUTH_URL=""
EMAIL_ADDRESS="" # I made use of Google third party apps to send emails using nodemailer
APP_PASSWORD=""
TWILIO_PHONE_NUMBER=""
- Set up the database:
npx prisma generate
npx prisma db push
# or
bunx prisma generate
bunx prisma db push
- Run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
- Sign up or log in to the application.
- Navigate to the dashboard to view transcripts and sentiment analysis.
- To make a voice call, use the Twilio API to initiate a call to your application's voice endpoint.
/api/auth/*
: Authentication endpoints (handled by NextAuth.js)/api/twilio/voice
: Handles incoming voice calls/api/twilio/initiate-call
: Handles outgoing calls (Not properly working yet)/api/transcripts
: Fetches stored transcripts/api/transcription-callback
: Handles the transcription of recorded calls and stores the transcript in the database
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License.