Skip to content

Contributing ​

Source: github.com/SrejonKhan/sms-bridge. This site: srejonkhan.github.io/sms-bridge.

Pull requests ​

  1. Fork the repository and branch from main.
  2. Run bun install at the repository root. For a change under dashboard/, run bun install in that directory as well.
  3. Limit the change to one area: the library, the HTTP API, the worker, the dashboard, or the docs.
  4. Run bun run check before opening the pull request. Biome formats and lints the tree. Indentation is two spaces. Strings use double quotes.
  5. 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 ​

text
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 site

Domain 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.

  1. Implement IProviderGateway (send(ctx) and checkBalance()) in src/adapters/providers/.
  2. Add a case for the type string in ProviderGatewayFactory.
  3. Extend the provider type enum in src/infra/db/schema.ts when the server stores that type.
  4. 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.