npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ll-callmobile-backend

v1.0.2

Published

VoIP Mobile Communications Backend with Supabase, Drizzle ORM, and Dynamic Querying - Deployable as Cloudflare Worker

Readme

LL CallMobile Backend

A TypeScript-based backend package for VoIP Mobile Communications using Supabase and Drizzle ORM, deployable as a Cloudflare Worker.

Features

  • Database Management: PostgreSQL with Supabase using Drizzle ORM
  • API Layer: Hono-based REST API endpoints (Cloudflare Workers compatible)
  • Type Safety: Full TypeScript support with generated types
  • Transaction Support: ACID-compliant database operations
  • Error Handling: Comprehensive error handling with user-friendly messages
  • Cloudflare Workers: Ready for serverless deployment
  • Multiple Usage Patterns: Use as a package, API server, or Cloudflare Worker

Installation

npm install ll-callmobile-backend

Quick Start

1. Direct Service Usage

import { TestCaseService, createDb } from "ll-callmobile-backend";

// Initialize database connection
const db = createDb({
  DATABASE_URL: "your-supabase-connection-string",
  SUPABASE_URL: "your-supabase-url",
  SUPABASE_ANON_KEY: "your-supabase-anon-key",
});

// Create service instance
const testCaseService = new TestCaseService(db);

// Create a test case
const testCase = await testCaseService.createTestCase({
  name: "Test VoIP Call",
  description: "Testing voice quality",
  phoneNumber: "+1234567890",
  userId: "user123",
  code: "test-code-123",
});

console.log("Created test case:", testCase);

2. Cloudflare Worker Deployment

// wrangler.toml
[env.production];
name = "ll-callmobile-backend";
main = "node_modules/ll-callmobile-backend/dist/worker.js";
compatibility_date = "2024-01-01"[env.production.vars];
ENVIRONMENT = "production"[[env.production.secret]];
name = "DATABASE_URL"[[env.production.secret]];
name = "SUPABASE_URL"[[env.production.secret]];
name = "SUPABASE_ANON_KEY";

3. Express Server Usage

import express from "express";
import { testCasesApi } from "ll-callmobile-backend";

const app = express();
app.use("/api", testCasesApi);

app.listen(3000, () => {
  console.log("Server running on port 3000");
});

Database Schema

Tables

  • test_cases: Stores test case information

    • id (Primary Key)
    • description (Text)
    • code (Enum: CVT, CVT2, GPP)
    • created_on (Timestamp)
  • clients: Stores client information

    • id (Primary Key)
    • acs_identity_id (Text)
    • name (Text)
    • acs_token (Text)
  • vendors: Stores vendor information

    • id (Primary Key)
    • acs_identity_id (Text)
    • name (Text)
    • acs_token (Text)
  • jobs: Stores job information linking test cases, clients, and vendors

    • id (Primary Key)
    • client_id (Foreign Key to clients.id)
    • vendor_id (Foreign Key to vendors.id)
    • details (Text)
    • start_date (Timestamp)
    • end_date (Timestamp, nullable)

Setup

Prerequisites

  • Node.js 18+
  • Supabase account and project
  • PostgreSQL database access

Environment Variables

Set these environment variables for database connection:

  • DATABASE_URL: Supabase PostgreSQL connection string
  • SUPABASE_URL: Your Supabase project URL
  • SUPABASE_ANON_KEY: Your Supabase anonymous key

Database Setup

  1. Generate and run database migrations:
npm run db:generate
npm run db:migrate
  1. Build the package:
npm run build

API Endpoints

POST /api/testcases

Creates a new test case with associated client, vendor, and job.

Request Body:

{
  "description": "Test VoIP communication",
  "code": "CVT",
  "client": {
    "acsIdentityId": "client-identity-123",
    "name": "Test Client",
    "acsToken": "client-token-456"
  },
  "vendor": {
    "acsIdentityId": "vendor-identity-789",
    "name": "Test Vendor",
    "acsToken": "vendor-token-012"
  }
}

Response:

{
  "testCaseId": 1,
  "client": {
    "acsIdentityId": "client-identity-123",
    "acsToken": "client-token-456"
  },
  "vendor": {
    "acsIdentityId": "vendor-identity-789",
    "acsToken": "vendor-token-012"
  }
}

GET /api/testcases/:id

Retrieves a test case by ID.

Response:

{
  "id": 1,
  "description": "Test VoIP communication",
  "code": "CVT",
  "createdOn": "2024-01-15T10:30:00Z"
}

GET /api/testcases/:id/client-token

Retrieves a client's ACS token by test case ID.

Response:

{
  "acsToken": "client-token-456"
}

Development

For local development:

# Install dependencies
npm install

# Build the package
npm run build

# Run database migrations
npm run db:migrate

# Start development server
npm run dev

Deployment

Cloudflare Workers

# Deploy to Cloudflare Workers
npm run deploy

Set Secrets in Cloudflare

# Set database connection secrets
wrangler secret put DATABASE_URL
wrangler secret put SUPABASE_URL
wrangler secret put SUPABASE_ANON_KEY

Types

The package exports TypeScript types for all operations:

import type {
  CreateTestCaseRequest,
  CreateTestCaseResponse,
} from "ll-callmobile-backend";

Examples

See USAGE.md for comprehensive usage examples and patterns.

Support

For issues and questions, please visit our GitHub repository.