{"id":50931491,"url":"https://github.com/triangletrade2022-lgtm/net2app_blast","last_synced_at":"2026-06-17T05:00:31.044Z","repository":{"id":365111339,"uuid":"1269634622","full_name":"triangletrade2022-lgtm/net2app_blast","owner":"triangletrade2022-lgtm","description":"Enterprise SMS Gateway Platform - SMPP/HTTP API, real-time DLR, dynamic routing, client \u0026 supplier management, invoicing, and built-in monitoring dashboard","archived":false,"fork":false,"pushed_at":"2026-06-15T22:30:13.000Z","size":289,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-06-16T00:12:17.587Z","etag":null,"topics":["bulk-sms","dlr","enterprise","esmc","message-routing","messaging","nextjs","postgresql","python","react","smpp","smpp-gateway","sms-api","sms-delivery","sms-gateway","sms-platform","smsc","telecom","typescript"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/triangletrade2022-lgtm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":"SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-15T00:27:47.000Z","updated_at":"2026-06-15T22:30:18.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/triangletrade2022-lgtm/net2app_blast","commit_stats":null,"previous_names":["triangletrade2022-lgtm/net2app_blast"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/triangletrade2022-lgtm/net2app_blast","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/triangletrade2022-lgtm%2Fnet2app_blast","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/triangletrade2022-lgtm%2Fnet2app_blast/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/triangletrade2022-lgtm%2Fnet2app_blast/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/triangletrade2022-lgtm%2Fnet2app_blast/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/triangletrade2022-lgtm","download_url":"https://codeload.github.com/triangletrade2022-lgtm/net2app_blast/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/triangletrade2022-lgtm%2Fnet2app_blast/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34434496,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-17T02:00:05.408Z","response_time":127,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bulk-sms","dlr","enterprise","esmc","message-routing","messaging","nextjs","postgresql","python","react","smpp","smpp-gateway","sms-api","sms-delivery","sms-gateway","sms-platform","smsc","telecom","typescript"],"created_at":"2026-06-17T05:00:25.538Z","updated_at":"2026-06-17T05:00:31.027Z","avatar_url":"https://github.com/triangletrade2022-lgtm.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Net2App Blast — Enterprise SMS Gateway Platform\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/TypeScript-5.9-3178C6?logo=typescript\u0026logoColor=white\" alt=\"TypeScript\"/\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Next.js-16-000000?logo=next.js\u0026logoColor=white\" alt=\"Next.js\"/\u003e\n  \u003cimg src=\"https://img.shields.io/badge/React-19-61DAFB?logo=react\u0026logoColor=black\" alt=\"React\"/\u003e\n  \u003cimg src=\"https://img.shields.io/badge/PostgreSQL-16-336791?logo=postgresql\u0026logoColor=white\" alt=\"PostgreSQL\"/\u003e\n  \u003cimg src=\"https://img.shields.io/badge/node-%3E%3D22-339933?logo=node.js\u0026logoColor=white\" alt=\"Node.js\"/\u003e\n  \u003cimg src=\"https://img.shields.io/badge/license-MIT-green\" alt=\"License\"/\u003e\n  \u003cimg src=\"https://img.shields.io/badge/SMPP-v5.0%2Fv3.4%2Fv3.3-8B5CF6?logo=datadog\u0026logoColor=white\" alt=\"SMPP\"/\u003e\n\u003c/p\u003e\n\nAn enterprise-grade SMS gateway platform with SMPP/HTTP API support, real-time DLR tracking, dynamic routing, client \u0026 supplier management, invoicing, and a built-in monitoring dashboard.\n\n## Architecture Overview\n\n```\n┌─────────────┐     SMPP/HTTP      ┌──────────────────┐\n│   ESME      │◄──────────────────►│  Net2App Blast   │\n│  Clients    │     (port 2775)    │                  │\n│ (SMPP Apps) │                    │  ┌────────────┐  │\n└─────────────┘                    │  │  ESMC      │  │\n                                   │  │ (smppy)    │  │\n┌─────────────┐                    │  └────────────┘  │\n│   Web App   │◄──── HTTP ───────►│  ┌────────────┐  │\n│  Dashboard  │    (port 3000)    │  │Next.js API │  │\n│  (React/TS) │                    │  │ (REST)     │  │\n└─────────────┘                    │  └────────────┘  │\n                                   │  ┌────────────┐  │\n┌─────────────┐                    │  │  SMSC      │  │\n│   SMSC      │◄──── SMPP ───────►│  │ Manager    │  │\n│  Suppliers  │    (dynamic)      │  └────────────┘  │\n│ (Upstream)  │                    │  ┌────────────┐  │\n└─────────────┘                    │  │PostgreSQL  │  │\n                                   │  │  (DB)      │  │\n                                   │  └────────────┘  │\n                                   └──────────────────┘\n```\n\n## Features\n\n### Core\n- **SMPP ESMC Server** — Accepts SMPP client connections (bind_transceiver/transmitter/receiver) on port 2775\n- **SMSC Supplier Manager** — Dynamic multi-supplier connections with auto-reconnect and keepalive\n- **HTTP API** — RESTful SMS sending API for non-SMPP clients\n- **Message Routing** — Configurable route→trunk→supplier chains with priority and weight-based routing\n\n### Management\n- **Client Management** — SMPP \u0026 HTTP clients with IP whitelisting, TPS limits, and balance tracking\n- **Supplier Management** — SMPP \u0026 HTTP API suppliers with rate configuration and priority ordering\n- **Route Management** — MCC-MNC based routing with fallback chains\n- **Rate Management** — Per-client and per-supplier rates with currency support\n- **Balance \u0026 Credit** — Top-up, credit limits, and automated balance deduction\n\n### Monitoring\n- **SMSC Connection Monitor** — Real-time status page at `/smpp/status` with auto-refresh (5s)\n- **Supplier Connection Status** — Live bound/unbound indicators per SMSC supplier\n- **ESME Session List** — Active client connections with system ID and remote address\n- **Dashboard** — Live SMS volume, DLR rates, hourly stats, and recent activity\n- **SMS Logs** — Searchable message logs with send/deliver results, costs, and profit analysis\n\n### Operations\n- **Invoice Generation** — Per-client/supplier invoicing with MCC-MNC breakdown and PDF export\n- **Reporting** — Daily, by-client, by-supplier, and profit analysis reports with CSV export\n- **DLR Handling** — Real-time delivery receipts with force-DLR timeout and queuing\n- **Email Notifications** — SMTP-based invoice delivery and alerts\n\n## Quick Start\n\n### One-Line Install (Ubuntu 22.04/24.04)\n\n```bash\ngit clone https://github.com/triangletrade2022-lgtm/net2app_blast.git \u0026\u0026 cd net2app_blast \u0026\u0026 sudo bash install-net2app.sh\n```\n\nThis installs everything automatically: Node.js 22, PostgreSQL 16, Python SMPP gateway, PM2, and the full application with database schema and seed data.\n\n### Prerequisites\n- Ubuntu 22.04 or 24.04 LTS\n- Root access (sudo)\n- 2GB+ RAM, 20GB+ disk\n\n### What Gets Installed\n| Component | Version | Purpose |\n|-----------|---------|---------|\n| Node.js | 22.x | Application runtime |\n| PostgreSQL | 16 | Database |\n| PM2 | Latest | Process manager |\n| Python | 3.x | SMPP gateway (ESMC + SMSC) |\n| SMPP Libraries | smppy, smpp.pdu | SMPP v3.3/v3.4/v5.0 protocol support |\n\n### After Installation\n1. Open `http://YOUR_SERVER_IP:3000`\n2. Login: `superuser` / `Telco1988`\n3. Go to **Suppliers** → Configure your SMSC suppliers\n4. Go to **SMSC Status** (`/smpp/status`) → Verify supplier connections\n5. Send a test SMS via **Test SMS** page\n\nSee [INSTALLATION-GUIDE.md](INSTALLATION-GUIDE.md) for detailed manual setup instructions.\n\n### Manual Setup\n\n```bash\n# 1. Install dependencies\nnpm install\n\n# 2. Create virtual environment for SMPP gateway\npython3 -m venv smpp_env\nsource smpp_env/bin/activate\npip install smppy smpp.pdu aiohttp psycopg2-binary\ndeactivate\n\n# 3. Configure environment\ncp .env.example .env  # or create manually:\n# DATABASE_URL=postgresql://net2app_user:password@127.0.0.1:5432/net2app_db\n# JWT_SECRET=your-secret-key\n# NODE_ENV=production\n\n# 4. Push database schema\nnpx drizzle-kit push --force\n\n# 5. Build and start\nnpm run build\npm2 start ecosystem.config.js\n```\n\n## API Endpoints\n\n### Authentication\n| Method | Path | Description |\n|--------|------|-------------|\n| POST | `/api/auth/login` | User login (returns JWT) |\n| GET | `/api/auth/me` | Get current user |\n\n### SMPP Gateway (Internal, port 9000)\n| Method | Path | Description |\n|--------|------|-------------|\n| GET | `/api/smpp/status` | Real-time SMSC + ESME connection status |\n| POST | `/api/smpp/send` | Send SMS via HTTP bridge |\n| POST | `/api/smpp/dlr` | Update delivery receipt |\n| POST | `/api/smpp/rebind` | Force-disconnect and reconnect a session |\n\n### Management API (port 3000)\n| Method | Path | Description |\n|--------|------|-------------|\n| GET/POST | `/api/clients` | List / Create clients |\n| GET/PUT/DELETE | `/api/clients/:id` | Get / Update / Delete client |\n| GET/POST | `/api/suppliers` | List / Create suppliers |\n| GET/PUT/DELETE | `/api/suppliers/:id` | Get / Update / Delete supplier |\n| GET/POST | `/api/routes` | List / Create routes |\n| GET/POST | `/api/rates/client` | Client rate management |\n| GET/POST | `/api/rates/supplier` | Supplier rate management |\n| GET/POST | `/api/invoices` | Invoice management |\n| POST | `/api/invoices/:id/pdf` | Download invoice as PDF |\n| POST | `/api/invoices/:id/email` | Email invoice |\n| GET | `/api/reports` | Analytics reports |\n| GET | `/api/dashboard` | Dashboard statistics |\n| GET | `/api/smpp/status` | Enriched SMSC+ESME status with DB sync |\n| GET/POST | `/api/smpp/sessions` | SMPP session history |\n| POST | `/api/smpp/rebind` | Rebind client/supplier session |\n\n## Project Structure\n\n```\nnet2app-platform/\n├── src/\n│   ├── app/\n│   │   ├── page.tsx              # Main SPA dashboard (React)\n│   │   ├── layout.tsx            # Root layout (dark theme)\n│   │   ├── globals.css           # Tailwind CSS + animations\n│   │   ├── smpp/status/\n│   │   │   └── page.tsx          # SMSC connection status page\n│   │   └── api/                  # Next.js API routes\n│   │       ├── auth/             # Authentication\n│   │       ├── clients/          # Client CRUD\n│   │       ├── suppliers/        # Supplier CRUD\n│   │       ├── routes/           # Route management\n│   │       ├── rates/            # Rate management\n│   │       ├── invoices/         # Invoice generation\n│   │       ├── reports/          # Analytics\n│   │       ├── dashboard/        # Dashboard stats\n│   │       ├── smpp/             # SMPP status, sessions, rebind\n│   │       ├── sms/              # Send, test, DLR\n│   │       ├── users/            # User management\n│   │       ├── balance/          # Balance operations\n│   │       └── health/           # Health check\n│   ├── db/\n│   │   ├── schema.ts             # Drizzle ORM schema\n│   │   └── index.ts              # Database connection\n│   └── lib/\n│       ├── auth.ts               # JWT auth helpers\n│       ├── helpers.ts            # Utility functions\n│       └── api-error.ts          # Error handler\n├── smpp_gateway/\n│   ├── smpp_server.py            # SMPP gateway (ESMC + SMSC + REST bridge)\n│   ├── start.sh                  # Gateway lifecycle script\n│   └── __init__.py\n├── scripts/\n│   ├── smsc-monitor.sh           # SMSC connection health monitor\n│   ├── health-check.sh           # Web server health check\n│   └── seed-user.mjs             # Database seeder\n├── drizzle/                      # Migration files\n├── install-net2app.sh            # Automated installer\n├── INSTALLATION-GUIDE.md         # Detailed installation docs\n├── ecosystem.config.js           # PM2 configuration\n├── next.config.ts                # Next.js config\n└── package.json\n```\n\n## Configuration\n\n### Environment Variables\n\nCopy the example file to get started:\n```bash\ncp .env.example .env\n```\n\nSee [`.env.example`](.env.example) for a full list with descriptions.\n\n| Variable | Description | Default |\n|----------|-------------|---------|\n| `DATABASE_URL` | PostgreSQL connection string | **Required** |\n| `JWT_SECRET` | JWT signing secret | **Required** |\n| `NODE_ENV` | Environment mode | `production` |\n| `PORT` | Next.js app port | `3000` |\n| `SMPP_ESMC_HOST` | ESMC server bind address | `0.0.0.0` |\n| `SMPP_ESMC_PORT` | ESMC server listen port | `2775` |\n| `SMPP_API_HOST` | REST API bridge host | `127.0.0.1` |\n| `SMPP_API_PORT` | REST API bridge port | `9000` |\n\n## Monitoring\n\n### SMSC Status Page\nAccess the real-time SMSC connection monitor at:\n```\nhttp://YOUR_SERVER:3000/smpp/status\n```\nFeatures:\n- Overall system health indicator (green/yellow/red)\n- Per-supplier connection status cards\n- ESME client session list\n- Auto-refresh every 5 seconds\n- Server info (ESMC host, port, API endpoint)\n\n### SMSC Monitor Script\nA cron-compatible script checks SMSC health every 5 minutes:\n```bash\n# Manual check\nbash scripts/smsc-monitor.sh\n\n# Add to crontab (every 5 minutes)\n*/5 * * * * /home/ubuntu/net2app-platform/scripts/smsc-monitor.sh\n```\n\nIf the SMSC is disconnected for 30+ minutes, alerts are logged.\nIf disconnected for 60+ minutes, the SMPP gateway is automatically restarted.\n\n## SMPP Gateway Details\n\n### ESMC Server (Port 2775)\n- **Protocol**: SMPP v5.0 / v3.4 / v3.3 (auto-detected, using smppy framework)\n- **Authentication**: Client credentials from `clients` table\n- **IP Whitelisting**: Manual (allowed_ips) or auto-whitelist on first connection\n- **Keepalive**: Enquire link every 30 seconds\n- **DLR**: Force-DLR with configurable timeout (instant, N seconds, or random 0-5s)\n\n### SMSC Supplier Manager\n- **Discovery**: Reads active SMPP suppliers from database every 10 seconds\n- **Connection**: Persistent TCP/TLS connections with auto-reconnect\n- **SMPP Version**: Auto-detects v5.0 → v3.4 → v3.3 for maximum compatibility\n- **Bind Fallback**: Tries transceiver first, falls back to transmitter\n- **Retry**: Exponential backoff (5s + 2s × attempt, max 30s)\n- **DLR Listening**: Each supplier has a dedicated listen loop\n- **Enquire Link**: Every ~15 seconds per supplier connection\n\n## Tech Stack\n\n- **Frontend**: React 19, Next.js 16, Tailwind CSS 4\n- **Backend**: Next.js API Routes, Drizzle ORM\n- **Database**: PostgreSQL 16\n- **SMPP**: Python (smppy, smpp.pdu), asyncio\n- **Process Management**: PM2\n- **Auth**: JWT (jsonwebtoken + bcryptjs)\n\n## Changelog\n\nSee [CHANGELOG.md](CHANGELOG.md) for release history and version details.\n\n## License\n\nSee [LICENSE](LICENSE) for details.\n\n## Support\n\nFor issues and feature requests, please open an issue on the GitHub repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftriangletrade2022-lgtm%2Fnet2app_blast","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftriangletrade2022-lgtm%2Fnet2app_blast","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftriangletrade2022-lgtm%2Fnet2app_blast/lists"}