SMS tools is an startpoint for suite of application for manage sms from pc with android phone
- Install dependencies
npm install
- Configure environment variables
- Create a
.env
file at the root of the project - Add the following environment variables:
GATEWAY_URL=http://phoneIP:8080
USERNAME=SMS
PASSWORD=password_on_sms_gateway
BDD_URI_DEV=mongodb://localhost:27017/sms-tools-dev
BDD_URI_TEST=mongodb://localhost:27017/sms-tools-test
-
install
sms-gateway
on your phone: https://github.com/capcom6/android-sms-gateway -
Start the server
-
register your webHook
- register
sms:received
curl -X POST -u <username>:<password> \ -H "Content-Type: application/json" \ -d '{ "id": "received", "url": "https://<serverIP>/sms", "event": "sms:received" }' \ http://<phoneIp>/webhooks
- register
sms:sent
curl -X POST -u <username>:<password> \ -H "Content-Type: application/json" \ -d '{ "id": "sent", "url": "https://<serverIP>/sent", "event": "sms:sent" }' \ http://<phoneIp>/webhooks
- register
sms:delivered
curl -X POST -u <username>:<password> \ -H "Content-Type: application/json" \ -d '{ "id": "delivered", "url": "https://<serverIP>/delivered", "event": "sms:delivered" }' \ http://<phoneIp>/webhooks
- register
sms:failed
curl -X POST -u <username>:<password> \ -H "Content-Type: application/json" \ -d '{ "id": "failed", "url": "https://<serverIP>/failed", "event": "sms:failed" }' \ http://<phoneIp>/webhooks
- register
npm start
for save more data on user, create our own services data model, conventionaly create nameData.model.ts in your service folder
you canadd services with router, for this create a file routes.ts in your service folder this file must export a function with the router
import { Router } from 'express';
import login from './router/login';
const router = Router();
router.post('/hello', (req, res) => {
res.send('hello world');
});
export default router;
for acces to this route, the link is /{service_name}/hello
todo chained comand, warnign with node module on submodules