Skip to content

Commit 7eaff58

Browse files
committed
Add README.md
1 parent 93c55b9 commit 7eaff58

75 files changed

Lines changed: 264 additions & 152 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# HTTP SMS
2+
3+
[![Build](https://github.com/NdoleStudio/httpsms/actions/workflows/ci.yml/badge.svg)](https://github.com/NdoleStudio/httpsms/actions/workflows/ci.yml)
4+
[![codecov](https://codecov.io/gh/NdoleStudio/httpsms/branch/main/graph/badge.svg)](https://codecov.io/gh/NdoleStudio/httpsms)
5+
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/NdoleStudio/httpsms/badges/quality-score.png?b=main)](https://scrutinizer-ci.com/g/NdoleStudio/httpsms/?branch=main)
6+
[![GitHub contributors](https://img.shields.io/github/contributors/NdoleStudio/httpsms)](https://github.com/NdoleStudio/httpsms/graphs/contributors)
7+
[![GitHub license](https://img.shields.io/github/license/NdoleStudio/httpsms?color=brightgreen)](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

api/README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# HTTP SMS API
2+
3+
[![Go Report Card](https://goreportcard.com/badge/github.com/NdoleStudio/httpsms)](https://goreportcard.com/report/github.com/NdoleStudio/httpsms)
4+
[![PkgGoDev](https://pkg.go.dev/badge/github.com/NdoleStudio/httpsms/api)](https://pkg.go.dev/github.com/NdoleStudio/httpsms/api)
5+
6+
API Docs: https://api.httpsms.com/index.html
7+
8+
## Building
9+
10+
To build and run the API on your computer, you can use the command below.
11+
12+
```bash
13+
# Build the API
14+
go go build -o main.exe;
15+
16+
# Run the API
17+
./main.exe
18+
```
19+
20+
## Testing
21+
22+
You can run the unit tests for this client from the root directory using the command below:
23+
24+
```bash
25+
go test -v
26+
```
27+
28+
## License
29+
30+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details

api/cmd/replay/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"fmt"
66
"log"
77

8-
"github.com/NdoleStudio/http-sms-manager/pkg/di"
8+
"github.com/NdoleStudio/httpsms/pkg/di"
99
"github.com/cheggaaa/pb/v3"
1010
"github.com/joho/godotenv"
1111
"github.com/palantir/stacktrace"

api/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module github.com/NdoleStudio/http-sms-manager
1+
module github.com/NdoleStudio/httpsms
22

33
go 1.18
44

api/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ package main
33
import (
44
"os"
55

6-
_ "github.com/NdoleStudio/http-sms-manager/docs"
7-
"github.com/NdoleStudio/http-sms-manager/pkg/di"
6+
_ "github.com/NdoleStudio/httpsms/docs"
7+
"github.com/NdoleStudio/httpsms/pkg/di"
88
)
99

1010
// @title HTTP SMS API

api/pkg/di/container.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,24 @@ import (
2424

2525
firebase "firebase.google.com/go"
2626
"firebase.google.com/go/auth"
27-
"github.com/NdoleStudio/http-sms-manager/pkg/middlewares"
27+
"github.com/NdoleStudio/httpsms/pkg/middlewares"
2828
"google.golang.org/api/option"
2929

3030
"github.com/gofiber/fiber/v2/middleware/cors"
3131

32-
"github.com/NdoleStudio/http-sms-manager/pkg/entities"
33-
"github.com/NdoleStudio/http-sms-manager/pkg/listeners"
34-
"github.com/NdoleStudio/http-sms-manager/pkg/repositories"
35-
"github.com/NdoleStudio/http-sms-manager/pkg/services"
32+
"github.com/NdoleStudio/httpsms/pkg/entities"
33+
"github.com/NdoleStudio/httpsms/pkg/listeners"
34+
"github.com/NdoleStudio/httpsms/pkg/repositories"
35+
"github.com/NdoleStudio/httpsms/pkg/services"
3636
"github.com/gofiber/fiber/v2"
3737
fiberLogger "github.com/gofiber/fiber/v2/middleware/logger"
3838
"github.com/gofiber/swagger"
3939
"github.com/palantir/stacktrace"
4040
"gorm.io/gorm"
4141

42-
"github.com/NdoleStudio/http-sms-manager/pkg/handlers"
43-
"github.com/NdoleStudio/http-sms-manager/pkg/telemetry"
44-
"github.com/NdoleStudio/http-sms-manager/pkg/validators"
42+
"github.com/NdoleStudio/httpsms/pkg/handlers"
43+
"github.com/NdoleStudio/httpsms/pkg/telemetry"
44+
"github.com/NdoleStudio/httpsms/pkg/validators"
4545
"gorm.io/driver/postgres"
4646
gormLogger "gorm.io/gorm/logger"
4747
)

api/pkg/events/message_api_sent_event.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package events
33
import (
44
"time"
55

6-
"github.com/NdoleStudio/http-sms-manager/pkg/entities"
6+
"github.com/NdoleStudio/httpsms/pkg/entities"
77

88
"github.com/google/uuid"
99
)

api/pkg/events/message_notification_scheduled_event.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package events
33
import (
44
"time"
55

6-
"github.com/NdoleStudio/http-sms-manager/pkg/entities"
6+
"github.com/NdoleStudio/httpsms/pkg/entities"
77

88
"github.com/google/uuid"
99
)

api/pkg/events/message_phone_delivered_event.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package events
33
import (
44
"time"
55

6-
"github.com/NdoleStudio/http-sms-manager/pkg/entities"
6+
"github.com/NdoleStudio/httpsms/pkg/entities"
77

88
"github.com/google/uuid"
99
)

api/pkg/events/message_phone_failed_event.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package events
33
import (
44
"time"
55

6-
"github.com/NdoleStudio/http-sms-manager/pkg/entities"
6+
"github.com/NdoleStudio/httpsms/pkg/entities"
77
"github.com/google/uuid"
88
)
99

0 commit comments

Comments
 (0)