Skip to main content
Case Study · In-house Product

A SaaS platform that handles real money, built and run by us.

Codelia SMS is a business messaging platform we designed, built and operate ourselves. Businesses send campaigns from a web portal, a public API or their AI assistant. Billing, EU invoicing and fraud protection are built in.

Client
Codelia Studios (in-house)
Product
Multi-tenant SaaS
Scope
Portal · API · AI agents · Billing
Stack
Next.js · Hono · AWS
THE BRIEF

The parts of SaaS that are easy to get wrong.

Most SaaS products run into the same hard problems. They take customers' money. They offer an API that other teams build on. Many organisations share one system. And now, AI agents act on customers' behalf.

We built Codelia SMS to solve all four in one product, in production, under our own name. Businesses use it to send appointment reminders, offers and alerts by text message.

Every message has a cost, so every bug is a billing bug. That set the bar for the whole platform.

Real customers. Real money. A platform we answer for ourselves.

What every SaaS needs
4

of the hardest SaaS problems, solved in one platform

Payments & Billing
Prepaid balances · Invoices · EU VAT
Multi-tenancy
Organisations · Permissions · Audit trail
Public API
Idempotency · Signed webhooks · Docs
AI Agents
MCP · Scoped access · Confirm before sending

Codelia SMS handles all four in production.

WHAT WE BUILT

One platform. Three ways in.

Customers use the web portal, call the API from their own software, or ask an AI assistant. All three run through the same pricing, permissions and balance, so they always agree.

01
For business teams
Compose & Price
01 / 04
Compose screen with an English and a Greek version, a live preview and the estimated cost
A recurring campaign that sends every Monday at 9:00 AM, Nicosia time
A sent campaign with all 18 messages delivered, its timeline and the amount charged
Billing screen with euro balance, automatic top-up, saved card and a transaction ledger

Campaigns Portal

A Next.js portal for contacts, smart lists and campaigns. Customers see the exact cost before they send, schedule or repeat campaigns, and track every delivery. Billing, invoices and a full transaction ledger sit alongside.

02
For developers & AI assistants
API Docs
01 / 02
Codelia SMS developer docs explaining how to send messages from your own code
Docs page for connecting AI assistants to Codelia SMS over MCP

API, Docs & AI Assistants

A public REST API with an OpenAPI spec, a docs site and signed webhooks. An MCP server gives Claude, ChatGPT and other assistants 22 tools to manage contacts and send campaigns, limited to what the customer allows. Zapier, Make and n8n connect without code.

PLATFORM SERVICES

Behind the screens: the services that move messages and money.

REST API & MCP Server

One Hono API on AWS Lambda serves the portal, customers' code and AI assistants. Internal routes never appear in the public spec.

Batch Workers

Large campaigns run from an SQS queue. Each worker hands off before its time limit, so a send of any size finishes.

Scheduled Jobs

EventBridge runs scheduled sends, payment reconciliation and monthly summaries. Every job is safe to run twice.

Billing & Invoicing

Stripe payments, prepaid credit and automatic top-up. Every payment gets a PDF invoice with the right VAT treatment.

Signed Webhooks

Every event is signed and versioned. Failed deliveries retry automatically, and customers can replay any recent one.

Staff Console

Our team approves sender names, manages rates and adjusts credit. Every staff action is audited.

UNDER THE HOOD

How it's put together.

A Turborepo monorepo, deployed with SST to AWS in the EU. One CloudFront router serves every app. One Hono API serves every client. Postgres is the single source of truth for every message, contact and euro.

WHO SENDS
Business Teams
Campaigns portal
Developers
REST API & webhooks
AI Assistants
MCP server
Automations
Zapier · Make · n8n
EDGE
CloudFront Router
One distribution, every hostname
FRONTEND
Marketing Site
Next.js
Customer Portal
Next.js
Docs
Next.js · API reference
Staff Console
Next.js
BACKEND
Auth
better-auth · OAuth & OIDC
REST API + MCP
Hono on Lambda · pricing, ledger, sends
Workers
SQS · EventBridge
DATA & STORAGE
PostgreSQL
RDS · Drizzle ORM
S3
Invoices · Imports · Exports
PARTNERS
Stripe
Card payments
Carrier Network
SMS delivery
Languages
TypeScript
Frontend
Next.js
React
Tailwind
Backend
Hono
Node.js
PostgreSQL
Drizzle ORM
Cloud
AWS
EventBridge
CloudFront CDN
Tooling
Turborepo
ENGINEERING DECISIONS

The hard parts, solved properly.

01

Money without rounding errors

SMS rates are fractions of a cent, and floating-point maths drifts. So every amount is stored as a whole number of micros: millionths of a euro. A €0.0075 rate is exactly 7,500.

Prices are rounded once, when they're quoted, and the quote is final. Customers pay exactly what they saw before sending.

Building a product that charges customers? We design the ledger first. Money bugs are the most expensive kind.
02

No double charges when requests retry

If a customer's code times out and retries, a naive API charges twice and sends twice.

Every endpoint that changes data accepts an idempotency key, following the same rules as Stripe. The database enforces it, so it holds across every server. It shipped with the first version of the API, so no integration ever had to change to get it.

A retried request returns the original result. Customers' integrations can retry safely.
03

Campaigns of any size, on serverless

Serverless functions have time limits. Large campaigns go onto a queue, and each worker hands off to the next one before its time runs out.

The timeouts are staggered so no batch is processed twice. Opt-outs are checked again at every hand-off, so someone who unsubscribes mid-campaign is never texted or charged.

Serverless keeps hosting costs low. We design around its limits so growth doesn't break it.
04

AI agents that ask before they spend

Customers connect Claude, ChatGPT or another assistant over MCP and choose exactly what it's allowed to do.

An assistant can't send anything on its first call. It gets a quote with the recipients and the cost, shows it to the person, and sends only once they confirm.

"Remind tomorrow's appointments at 9." The assistant replies with a quote. Nothing goes out until the customer says yes.
05

Fraud protection that never blocks sending

SMS pumping is the most common fraud against SMS platforms. Attackers push traffic to premium numbers they control, and the platform pays the bill.

Our guard combines trust tiers, rate limits and destination risk scoring. Staff can let trusted customers through, and every exception is audited. If the guard itself fails, sending carries on.

We build abuse protection in from the start, so a successful launch doesn't become an expensive one.
BY THE NUMBERS

Built to the micro.

3
Ways to send: portal, API, AI assistant
22
LLM tools for platform interaction
10⁻⁶ €
Ledger precision, in integer micros
6
Next.js apps behind one CloudFront router
HIGHLIGHTS

The details that build trust.

Costs shown before sending. The editor flags any character that would double a message's price and offers a fix.

Private by default. Asking for an organisation you don't belong to returns "not found", so the API never confirms it exists.

Scheduled sends priced on the day. No money is held in advance, and opt-outs are checked again before sending.

Self-healing recurring campaigns. They refresh their lists on every run and pause themselves after three failures.

Fine-grained permissions. An accountant can see billing and invoices without being able to send anything.

EU invoicing built in. VAT or reverse charge on every invoice, and automatic credit notes for refunds.

Webhooks developers can trust. Signed, versioned, and safe to deduplicate across retries.

A customer-facing activity log. Teams can see who changed what, from revoked API keys to edited lists.

Hosted in the EU. With point-in-time recovery and backups copied to a second EU region.

WANT TO BUILD SOMETHING LIKE THIS?

We run what we build.

Codelia SMS isn't a demo. It takes real payments, sends real messages and serves real customers, and we operate it ourselves.

That's the standard we bring to client work: billing that reconciles to the cent, APIs other teams can build on, AI features with guardrails, and infrastructure that stays cheap to run.

If you're planning a SaaS platform, a customer portal, a public API or an AI integration, we'd love to hear about it.

Tell us about
your project

Let's Talk!

We're excited to hear about your project! Whether it's a new website, mobile app, e-commerce or any other custom solution, we're here to bring your vision to life. Click the button below to get started and let us know how we can help you achieve your goals.