I’ve been thinking about a larger project using QR codes. I’m still not 100% on how that will look and what it’ll do, but I do know that I want a service in my ecosystem that can return me a QR code. So I’m gonna build it!
to recap my design principles for projects:
- No permanent infrastructure, all server less where possible (which is why I lean heavily into Lambda etc)
- Always free components (again Lambda…), or free tier where possible.
- Should scale easily if I need it to (hence server less / lambda etc)
My work pattern currently is design in the evening, build in the morning when I’m fresh. This works a lot better than bashing away at technical stuff late at night.
The first step in the design process tonight is to work through the design with old mate ChatGPT. We’ve had a productive Q & A session and have settled on this design for our MVP:
AI Generated:
# 🧱 QR Code Service MVP – Architecture Summary
## 🎯 Purpose
Public-facing service to generate QR codes and manage short URL redirects.
Internally known as **Qween**, but all public API routes and responses are **brand-neutral or app-branded**.
---
## 🌐 API Layer – AWS API Gateway
| Method | Path | Description | Auth |
|--------|---------------------|-------------------------------|-------------|
| POST | `/generate` | Generates a QR + short URL | `x-api-key` |
| GET | `/{short_id}` | Redirects to original URL | Public |
> ✅ No `/qween` or internal terms in public routes
---
## ⚙️ Processing – AWS Lambda
### 1. `generate.py`
- Validates `type=url` input
- Creates short ID (`abc123`)
- Generates QR code that points to `https://yourdomain.com/abc123`
- Encodes as base64
- Saves to Supabase
- Returns:
```json
{
"short_url": "https://yourdomain.com/abc123",
"qr_base64": "data:image/png;base64,..."
}
2. redirect.py
- Resolves
{short_id}to original URL - Returns
302 Location: original_urlor 404
🗄️ Supabase Database – qr_codes
CREATE TABLE qr_codes (
id TEXT PRIMARY KEY,
type TEXT NOT NULL,
payload JSONB NOT NULL,
created_at TIMESTAMP WITH TIME ZONE DEFAULT now(),
status TEXT DEFAULT 'active',
scan_count INTEGER DEFAULT 0
);
🔐 Authentication
- POST requires
x-api-key - Stubbed for OAuth2 upgrade later
- GET remains public for scannability
🌐 Public-Facing Experience
| Feature | Public View |
|---|---|
| QR Encoded URL | https://yourdomain.com/abc123 |
| API POST URL | https://api.yourdomain.com/generate |
| Branding in Payload | None — neutral by default |
Based on that, I'll get him to help with some of the database creation work and create me a prompt to take to Gemini for the coding of the lambda function tomorrow.
I'm looking forward to building this tomorrow morning.
also - this post should be the first that Tina publishes on her own via AWS Event Bridge Schedule 🤞🏼