A Go-based web service that allows users to search phone numbers, leave comments, and get information about phone numbers including their operators, regions, and user reviews.
- 📱 Phone number lookup and validation
- 💬 User comment system with moderation
- 🗺️ Dynamic sitemap generation
- 📊 Rating system for phone numbers
- 🖼️ Dynamic image generation for phone numbers
- 🔍 Latest searches and comments tracking
- 🤖 Google reCAPTCHA integration
- 📱 Phone number information including:
- Operator detection (Turkcell, Vodafone, Türk Telekom)
- Region/City detection
- Number type classification
- Written form of numbers in Turkish
- Framework: Echo
- Database: MongoDB
- Image Processing: gg
- Sitemap: go-sitemap-generator
- Scheduling: cron
- Pagination: mongo-go-pagination
GET /api/phoneNumber - Search phone number
POST /api/phoneNumber - Add comment
GET /api/image - Get phone number image
GET /api/latest - Get latest updates
GET /api/sitemap/* - Sitemap endpoints
GET /api/admin/phoneNumber/:number - Get phone number details
GET /api/admin/phoneNumber - List phone numbers (paginated)
GET /api/admin/phoneNumberUnchecked - List unchecked numbers
GET /api/admin/comment - Get comment by ID
POST /api/admin/comment - Update comment
POST /api/admin/quickComment - Quick update comment
DELETE /api/admin/comment - Delete comment
- Supports Turkish phone numbers (10 digits)
- Special handling for 444 numbers (7 digits)
- Operator detection for major Turkish carriers
- Regional information for landline numbers
- Three types of comments: RELIABLE, DANGEROUS, NEUTRAL
- Comment moderation system
- Aggregate rating calculation
- Latest comments tracking
- Dynamic image generation for phone numbers
- Color coding based on ratings (green, red, gray)
- Custom font rendering
- Automated sitemap generation
- IndexNow integration for faster indexing
- Structured data with AggregateRating
The following environment variables need to be set:
MONGODB_CONNECTION_STRING=mongodb://user:pass@host:port
MONGODB_DATABASE=database_name
CAPTCHA_SECRET=your_recaptcha_secret_key
PORT=8080 # Default: 8080
ENV=prod # Default: dev
LOG_LEVEL=info # Default: debug
SITE_BASE_URL=example.com # Default: localhost
SITE_MAP_BASE_URL=example.com # Default: localhost
.
├── config/ # Configuration and environment setup
├── database/ # MongoDB connection and operations
├── handlers/ # HTTP request handlers
├── models/ # Data models and DTOs
├── model_entity/ # Database entities
├── route/ # API route definitions
├── service/ # Business logic layer
│ ├── image_service/ # Image generation
│ ├── latest_bar/ # Latest updates tracking
│ └── sitemap/ # Sitemap generation
└── main.go # Application entry point
-
Set required environment variables as described above
-
Install dependencies:
go mod download
- Run the application:
go run main.go
go test ./...
go build -o app
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.