Skip to content

izuchukwu-eric/dev-phone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DevPhone

Free disposable phone numbers for developers. Like Yopmail, but for SMS.

Features

  • Select phone numbers from multiple countries (US, UK, Canada, Germany, etc.)
  • Receive SMS messages and OTPs in real-time
  • WebSocket-based live updates - no refresh needed
  • REST API for integration with CI/CD pipelines
  • Clean, ad-free developer experience
  • OTP extraction with one-click copy

Tech Stack

  • Backend: Node.js, Express, TypeScript, Prisma, Socket.io
  • Frontend: React, TypeScript, Vite, Tailwind CSS, TanStack Query
  • Database: PostgreSQL, Redis
  • SMS Provider: Twilio
  • Deployment: Docker, Docker Compose

Quick Start

Prerequisites

  • Node.js 20+
  • Docker and Docker Compose
  • Twilio account (for real SMS)

1. Clone and Install

cd devphone

# Install backend dependencies
cd backend && npm install

# Install frontend dependencies
cd ../frontend && npm install

2. Set Up Environment

# Copy environment files
cp backend/.env.example backend/.env

Edit backend/.env with your Twilio credentials:

TWILIO_ACCOUNT_SID=ACxxxxxx
TWILIO_AUTH_TOKEN=xxxxxx

3. Start Database Services

docker-compose up -d postgres redis

4. Initialize Database

cd backend

# Generate Prisma client
npx prisma generate

# Run migrations
npx prisma migrate dev --name init

# Seed sample data
npx prisma db seed

5. Start Development Servers

Terminal 1 - Backend:

cd backend && npm run dev

Terminal 2 - Frontend:

cd frontend && npm run dev

6. Open the App

Visit http://localhost:5173

API Endpoints

Method Endpoint Description
GET /api/v1/countries List available countries
GET /api/v1/numbers/:countryCode Get numbers for a country
GET /api/v1/numbers/:numberId/messages Get messages for a number
POST /webhooks/sms Twilio SMS webhook

WebSocket Events

Client -> Server

  • watch_number - Subscribe to a phone number's messages
  • unwatch_number - Unsubscribe from messages

Server -> Client

  • new_message - New SMS received
  • message_received - Global message notification

Production Deployment

Using Docker Compose

# Set environment variables
export TWILIO_ACCOUNT_SID=ACxxxxxx
export TWILIO_AUTH_TOKEN=xxxxxx
export BASE_URL=https://your-domain.com
export FRONTEND_URL=https://your-domain.com

# Build and run
docker-compose up -d

Twilio Webhook Configuration

Configure your Twilio phone numbers to send webhooks to:

  • SMS URL: https://your-domain.com/webhooks/sms
  • Method: POST

Scripts

# Seed countries
npx ts-node scripts/seed-countries.ts

# Provision numbers from Twilio
npx ts-node scripts/provision-numbers.ts

# Clean up expired messages
npx ts-node scripts/cleanup-expired.ts

Project Structure

devphone/
├── backend/           # Node.js API server
│   ├── src/
│   │   ├── controllers/   # Route handlers
│   │   ├── services/      # Business logic
│   │   ├── routes/        # API routes
│   │   ├── middleware/    # Express middleware
│   │   └── websocket/     # Socket.io setup
│   └── prisma/        # Database schema
├── frontend/          # React application
│   └── src/
│       ├── components/    # UI components
│       ├── pages/         # Page components
│       ├── hooks/         # Custom hooks
│       └── services/      # API client
└── scripts/           # Utility scripts

License

MIT

About

Free disposable phone numbers for developers. Like Yopmail, but for SMS.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages