Contributing
Source: github.com/SrejonKhan/sms-bridge. This site: srejonkhan.github.io/sms-bridge.
Pull requests
- Fork the repository and branch from
main. - Run
bun installat the repository root. For a change underdashboard/, runbun installin that directory as well. - Limit the change to one area: the library, the HTTP API, the worker, the dashboard, or the docs.
- Run
bun run checkbefore opening the pull request. Biome formats and lints the tree. Indentation is two spaces. Strings use double quotes. - Open the pull request against
main. Describe the change and the commands used to verify it.
Do not commit real credentials, data/*.db, or the local tool state under .puku/.
bun run docs serves this site locally. .github/workflows/docs.yml publishes it on push to main. .github/workflows/image.yml publishes ghcr.io/srejonkhan/sms-bridge on the same branch.
GitHub Pages has to be set to Settings → Pages → Build and deployment → Source: GitHub Actions before the docs workflow has a target.
Repository layout
src/
core/ domain types, ports, routing, retry, provider registry
adapters/
providers/ BulkSMSBd, GreenWeb, sandbox
infra/ SQLite, BullMQ, Redis, Prometheus
api/ Hono routes, controllers, profile authentication
worker/ BullMQ consumer
jobs/ balance sync
dashboard/ mounts the prebuilt React UI
client.ts SMSBridge
container.ts composition root
docs/ this siteDomain code depends on ports. SQLite, Redis, HTTP, and each SMS vendor are adapters. createContainer() constructs them. The library runs on Node.js 24, on Node.js 22 with --experimental-sqlite, and on Bun. The scripts in this repository are started with Bun.
A local checkout reads provider credentials from the environment variables documented in Self-hosting, and from ./configs.yaml when that file exists. Copy configs.example.yaml to configs.yaml. A value written as ${NAME} is replaced with the environment variable NAME.
Add a built-in provider
Add a provider in this repository when the self-hosted server has to deliver through that vendor with no application code. A provider that only one application should know about stays in that application. See Custom providers.
- Implement
IProviderGateway(send(ctx)andcheckBalance()) insrc/adapters/providers/. - Add a
casefor the type string inProviderGatewayFactory. - Extend the provider
typeenum insrc/infra/db/schema.tswhen the server stores that type. - Document the environment variables on the Self-hosting page, and the YAML fields in
configs.example.yaml.
Routing, retries, and the dashboard call the port. They do not call the vendor.
Dashboard
The UI is a Vite and React application in dashboard/. bun run dev at the repository root serves dashboard/dist at /portal. While changing the UI, run the Vite dev server in dashboard/ so that it proxies API requests. Publish a UI change with bun run build:dashboard, so that dashboard/dist matches the source.