A modern, feature-rich messaging application built with Next.js, integrating with TextNow API for SMS, MMS, and AI-powered voice messaging.
Features β’ Preview β’ Installation β’ Usage β’ API Reference β’ Contributing
- SMS Messaging - Send and receive text messages in real-time
- MMS Support - Share images and videos seamlessly
- Voice Messages - Record and send audio messages
- AI Voice Messages - Generate AI-powered voice messages using Google Gemini 2.5 Flash Preview TTS
- 30+ preset voices to choose from
- Customizable accent, mood, and tone
- Natural-sounding speech synthesis
- Modern Dark Theme - Beautiful black and electric blue UI
- Mobile-First Design - Optimized for all device sizes
- Real-Time Updates - Instant message delivery and synchronization
- Conversation Management - Organize and manage multiple conversations
- Search Functionality - Quickly find conversations
- Secure User Accounts - SQLite-based user management
- Encrypted Credentials - Safe storage of TextNow API credentials
- Session Management - Persistent login sessions
- Media Proxy - Secure authenticated media loading
- Contact Management - Edit and customize contact names
- User Settings - Manage API keys and preferences
- Error Handling - Robust error handling and user feedback
| Landing Page View | Sign Up Page |
|---|---|
![]() |
![]() |
| Conversational Interface |
|---|
![]() |
| Start New Convo | User Settings | AI Voice Messaging |
|---|---|---|
![]() |
![]() |
![]() |
- Node.js 18+ and npm/yarn
- TextNow Account with API credentials
- Google Gemini API Key (optional, for AI voice messages)
git clone https://github.com/zodyking/PyTextNow-Demo-App.git
cd PyTextNow-Demo-Appnpm installnpm run devThe app will be available at http://localhost:3000
- Log in to TextNow in your browser
- Open Developer Tools (F12)
- Navigate to Application β Cookies β
https://www.textnow.com - Copy the following cookie values:
connect.sid- Session ID cookie_csrf- CSRF token cookie
- Note your TextNow username
- Sign Up: Create a new account with your TextNow credentials
- Login: Access your dashboard with your credentials
- Configure AI Voice (Optional): Add your Google Gemini API key in User Settings for AI voice message generation
- SMS: Type your message and click send
- MMS: Click the attachment icon and select an image or video
- Voice Message: Click the microphone icon and record your message
- AI Voice Message: Click the AI voice icon, type your message, select voice/accent/mood/tone, and send
PyTextNow-Demo-App/
βββ app/
β βββ api/ # API routes
β β βββ conversations/ # Conversation management
β β βββ messages/ # Message fetching
β β βββ send-sms/ # SMS sending
β β βββ send-mms/ # MMS sending
β β βββ send-voice/ # Voice message sending
β β βββ gemini-tts/ # AI voice generation
β β βββ media-proxy/ # Authenticated media proxy
β β βββ users/ # User management
β βββ dashboard/ # Main dashboard
β βββ login/ # Login page
β βββ signup/ # Signup page
β βββ layout.tsx # Root layout
βββ components/ # React components
β βββ ConversationList.tsx # Conversation sidebar
β βββ MessageView.tsx # Message display
β βββ SendMessageForm.tsx # Message input form
β βββ UserSettings.tsx # User settings modal
β βββ ContactNameEditor.tsx # Contact name editor
βββ lib/
β βββ db.ts # SQLite database setup
βββ types/
β βββ index.ts # TypeScript type definitions
βββ scripts/
βββ clear-db.js # Database cleanup utility
| Endpoint | Method | Description |
|---|---|---|
/api/users/signup |
POST | Create a new user account |
/api/users/login |
POST | Authenticate user |
/api/users/get |
POST | Get user information |
/api/users/update |
POST | Update user settings |
/api/conversations |
POST | Fetch all conversations |
/api/messages |
POST | Get messages for a conversation |
/api/send-sms |
POST | Send SMS message |
/api/send-mms |
POST | Send MMS message (image/video) |
/api/send-voice |
POST | Send voice message |
/api/gemini-tts |
POST | Generate AI voice message |
/api/media-proxy |
GET | Proxy authenticated media requests |
This app integrates with the TextNow API following the specifications from PyTextNow_API issue #75.
MMS Flow:
- Get upload URL:
GET /api/v3/attachment_url?message_type=2 - Upload file:
PUT {pre-signed-url}with raw file data - Send message:
POST /api/v3/send_attachmentwith attachment URL
Voice Message Flow:
- Get upload URL:
GET /api/v3/attachment_url?message_type=3 - Upload audio:
PUT {pre-signed-url}with audio data - Send message:
POST /api/v3/send_attachmentwith attachment URL
- Next.js 15 - React framework with App Router and Turbopack
- TypeScript - Type-safe JavaScript
- React 18 - UI library
- Tailwind CSS - Utility-first CSS framework
- HeroUI - Modern UI component library
- Better-SQLite3 - Fast SQLite database
- Google Gemini API - AI voice generation
- TextNow API - Messaging backend
- This is a demo application for educational purposes
- Credentials are stored in SQLite database (local development)
- For production use, implement:
- JWT token-based authentication
- Encrypted credential storage
- Environment variables for sensitive data
- HTTPS-only communication
- Rate limiting and request validation
- Proper session management
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License.
- PyTextNow_API - TextNow API reference
- TextNow - Messaging platform
- Google Gemini - AI voice generation
Made with β€οΈ using Next.js and TypeScript
β Star this repo if you find it helpful!




