A modern browser-based phone application built with Next.js, featuring SIP integration, real-time communication, user authentication, and administrative capabilities.
- 📞 Browser-based SIP phone functionality
- 💬 Real-time chat messaging
- 👥 Contact management
- 🔐 User authentication and authorization
- ⚙️ Admin panel for user and server management
- 🎨 Modern UI with Tailwind CSS
- 🔒 Secure communication
Before you begin, ensure you have the following installed:
- Node.js (v20 or higher)
- npm or yarn
- MongoDB instance
- SSL certificates (for HTTPS development)
-
Clone the repository
git clone https://github.com/3cns/WebPhone.git cd WebPhone -
Install dependencies
npm install # or yarn install -
Environment Setup Create a
.env.localfile in the root directory with the following variables:MONGODB_URI=your_mongodb_connection_string JWT_SECRET=your_jwt_secret NEXTAUTH_SECRET=your_nextauth_secret NEXTAUTH_URL=https://localhost:3000
-
SSL Certificate Setup Place your SSL certificates in the
certsdirectory:certs/localhost.keycerts/localhost.crt
-
Start the development server
npm run dev # or yarn devThe application will be available at
https://localhost:3000The WebSocket server will be available atwss://localhost:3001
/src/app- Next.js application routes and API endpoints/src/components- React components organized by feature/src/hooks- Custom React hooks including SIP provider/src/lib- Utility functions and database actions/src/models- MongoDB models and schemas/src/types- TypeScript type definitions/src/utils- Helper functions and utilities
- Sign up and sign in functionality
- JWT-based authentication
- Protected routes and API endpoints
- SIP.js integration for WebRTC calls
- Real-time audio communication
- Call history and status display
- Dial pad with number input
- Contact management
- User management
- Server configuration
- System monitoring
- Access control
- Real-time messaging
- Message history
- Contact-based conversations
- Message status tracking
- Secure WebSocket server for real-time updates
- Message handling and routing
- Client authentication
- Automatic reconnection
npm run dev- Start development server with HTTPS and WebSocket servernpm run build- Build the production applicationnpm run start- Start the production servernpm run lint- Run ESLint for code quality
- Frontend: Next.js, React, TailwindCSS
- Backend: Next.js API Routes
- Database: MongoDB with Mongoose
- Authentication: NextAuth.js
- VoIP: SIP.js
- UI Components: Headless UI, Heroicons
The application can be deployed to various platforms:
-
Vercel (Recommended)
- Connect your repository to Vercel
- Configure environment variables
- Deploy automatically with git push
-
Self-hosted
- Build the application:
npm run build - Start the server:
npm run start - Use process manager (PM2) for production
- Build the application: