httpsms-gateway / README.md
ML Intern deploy
Deploy httpSMS gateway to Hugging Face Spaces (Docker SDK): nginx :7860 -> Go API :8000, Nuxt SPA, Android APK, bootstrap-mode entrypoint
83a59ca
|
Raw History Blame
2.7 kB
---
title: httpSMS Bulk Android Gateway
emoji: 📱
colorFrom: blue
colorTo: indigo
sdk: docker
app_port: 7860
pinned: false
---
[![Built with ML Intern](https://huggingface.co/datasets/huggingface/badges/resolve/main/built-with-ml-intern-sm.svg)](https://hf.co/chat?mode=ml-intern)
# httpSMS Gateway — self-hosted on Hugging Face Spaces
Production-hardened, single-origin deployment of the open-source [httpSMS](https://github.com/NdoleStudio/httpsms) Android SMS gateway: Go Fiber REST API + Nuxt 3 web dashboard behind a non-root nginx reverse proxy on a Hugging Face Docker Space.
- **Live dashboard:** https://red-kit-httpsms-gateway.hf.space
- **REST API base URL:** https://red-kit-httpsms-gateway.hf.space/v1
- **Android APK (direct download):** https://red-kit-httpsms-gateway.hf.space/HttpSms.apk
## Bootstrap mode
If the `DATABASE_URL` / `REDIS_URL` Space secrets are **not** set, `entrypoint.sh` starts ephemeral in-container PostgreSQL and Redis so the gateway is live out of the box. Data resets on restart. Set the two secrets to switch to a managed database (Neon/Supabase/Upstash) — no rebuild needed.
## Architecture
- nginx (uid 1000, non-root) listens on `:7860`, proxies `/v1/*` and heartbeat/health routes to the Go Fiber API on `127.0.0.1:8000`, and serves the static Nuxt SPA plus the APK.
- State lives in external managed PostgreSQL and Redis (injected as Space secrets, never committed).
- `entrypoint.sh` starts the API for GORM auto-migration, idempotently seeds the internal CloudEvents queue system user (`ON CONFLICT DO UPDATE`), then supervises the API and runs nginx.
- WebSocket/SSE upgrade headers, `X-Real-IP`, `X-Forwarded-For`, `X-Forwarded-Proto: https` are set by nginx on API routes.
## Quick start — REST API
Get your API key from the web dashboard after login, then:
```bash
export HTTPSMS_API_KEY="<your api key from the dashboard>"
# Send a single SMS
curl -X POST https://red-kit-httpsms-gateway.hf.space/v1/messages/send \
-H "X-API-Key: ${HTTPSMS_API_KEY}" \
-H "Content-Type: application/json" \
-d '{"from": "+18005550199", "to": "+18005550100", "content": "Hello from httpSMS"}'
# Bulk-send to many recipients
curl -X POST https://red-kit-httpsms-gateway.hf.space/v1/messages/bulk-send \
-H "X-API-Key: ${HTTPSMS_API_KEY}" \
-H "Content-Type: application/json" \
-d '{"from": "+18005550199", "to": ["+18005550100", "+18005550101"], "content": "Hello from httpSMS"}'
```
Messages are delivered through the connected Android phone running the httpSMS app (install the APK above; its default server URL points at this Space).
Upstream source: https://github.com/NdoleStudio/httpsms · Docs: https://docs.httpsms.com