|
| 1 | +# HTTP SMS |
| 2 | + |
| 3 | +[](https://github.com/NdoleStudio/httpsms/actions/workflows/ci.yml) |
| 4 | +[](https://codecov.io/gh/NdoleStudio/httpsms) |
| 5 | +[](https://scrutinizer-ci.com/g/NdoleStudio/httpsms/?branch=main) |
| 6 | +[](https://github.com/NdoleStudio/httpsms/graphs/contributors) |
| 7 | +[](https://github.com/NdoleStudio/httpsms/blob/master/LICENSE) |
| 8 | + |
| 9 | +[HTTP SMS](https://httpsms.com) is a service that lets you use your android phone as an SMS Gateway to send and receive SMS messages. |
| 10 | +You make a request to the API which it triggers your android phone to send an SMS. |
| 11 | + |
| 12 | +## Why? |
| 13 | + |
| 14 | +I'm originally from Cameroon and I wanted an automated way to send and receive SMS messages using an API. |
| 15 | +Unfortunately many countries don't support the ability to buy virtual phone numbers, and I could not find a good ready-made |
| 16 | +solution that could help me send/receive SMS messages using a mobile phone using an intuitive http API. |
| 17 | + |
| 18 | +## Technology |
| 19 | + |
| 20 | +### Web |
| 21 | + |
| 22 | +The web interface https://httpsms.com is built using [Nuxt](https://nuxtjs.org/) and [Vuetify](https://vuetifyjs.com/en/). |
| 23 | +It is hosted as a single page application on firebase. The source code is in the [./web](../web) directory |
| 24 | + |
| 25 | +### API |
| 26 | + |
| 27 | +The API https://api.httpsms.com is built using [Fiber](https://gofiber.io/), Go and [CockroachDB](https://www.cockroachlabs.com/) for the database. |
| 28 | +It rus as a serverless application on Google Cloud Run. The API documentation can be found here https://api.httpsms.com/index.html |
| 29 | + |
| 30 | +```go |
| 31 | +// Sending an SMS Message using Go |
| 32 | +client := htpsms.New(htpsms.WithAPIKey(/* API Key from https://httpsms.com/settings*/)) |
| 33 | +client.Messages.Send(context.Background(), &httpsms.MessageSendParams{ |
| 34 | + Content: "This is a sample text message", |
| 35 | + From: "+18005550199", |
| 36 | + To: "+18005550100", |
| 37 | +}) |
| 38 | +``` |
| 39 | + |
| 40 | +### Android App |
| 41 | + |
| 42 | +[The Android App](https://github.com/NdoleStudio/httpsms/releases/download/v0.0.1/HttpSms.apk) is a native application |
| 43 | +built using Kotlin with material design principles. This app must be installed on an android phone before you can start |
| 44 | +sending and receiving SMS messages. |
| 45 | + |
| 46 | +## Features |
| 47 | + |
| 48 | +### Back Pressure |
| 49 | + |
| 50 | +In-order not to abuse the SMS API on android, you can send a rate limit e.g 3 messages per minute. Such that even if you |
| 51 | +call the API to send messages to 100 people, It will only send the messages at a rate of 3 messages per minute. |
| 52 | + |
| 53 | +## API Clients |
| 54 | + |
| 55 | +- Go: https://github.com/NdoleStudio/httpsms-go |
| 56 | + |
| 57 | +## Flows |
| 58 | + |
| 59 | +### Sending an SMS Message |
| 60 | + |
| 61 | +```mermaid |
| 62 | +sequenceDiagram |
| 63 | +User->>+Http Sms API: Call /v1/messages/send API |
| 64 | +Http Sms API-->>+Google Cloud Task: Schedule notification about new message |
| 65 | +Http Sms API-->>-User: Respond with 202 (Accepted) |
| 66 | +Google Cloud Task-->>+Http Sms API: [Async] Send notfication request |
| 67 | +Http Sms API-->>-Android App: Send push notification about new message |
| 68 | +Android App-->>Http Sms API: [Async] Fetch message |
| 69 | +Android App-->>Android App: Send Message using Andoid SMS API |
| 70 | +Android App-->>Http Sms API: [Async] Send result of sending SMS |
| 71 | +Android App-->>Http Sms API: [Async] Send Delivery Report |
| 72 | +``` |
| 73 | + |
| 74 | +## License |
| 75 | + |
| 76 | +This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details |
0 commit comments