A serverless URL shortener built on Cloudflare Workers using only the Cloudflare Free Tier, with CI/CD powered by GitHub Actions.
This project demonstrates how to design, deploy, and operate a production-style edge application with automated builds, tests, and deployments.
- Build and deploy a real-world application on Cloudflare Workers
- Handle HTTP requests at the edge with low latency
- Understand edge routing and redirects
- Automatically deploy on every push to the
mainbranch - Use GitHub Actions for continuous integration and deployment
- Inject secrets securely using GitHub repository secrets
- Store URL data in Cloudflare D1 (SQL-based database)
- Operate entirely within free quotas
- Avoid vendor lock-in or paid-only features
- Validate inputs (URL and short code)
- Handle errors and edge cases gracefully
- Support optional features like:
- Click tracking
- Expiring short URLs
- Infrastructure as Code mindset
- Environment-based deployments (dev / prod)
- Rollback-safe deployments using Git-based workflows
- Protect admin endpoints using token-based authentication
- Store secrets securely (no hardcoded keys)
- Prepare the system for basic rate-limiting
- Clean repository structure
- Clear documentation and goals
- Demonstrates:
- Serverless architecture
- CI/CD pipelines
- Cloud-native backend design
Client
β
Cloudflare Worker (Edge)
β
Cloudflare D1 (URL storage)
- β URL shortening and redirection
- β Edge-based redirect logic
- β Click tracking
- β Expiry support (optional)
- π Admin API for managing links
- π Analytics endpoint (future)
- π§ͺ Unit tests in CI
- Cloudflare Workers
- Cloudflare D1
- GitHub Actions
- Wrangler CLI
- TypeScript / JavaScript
- Code pushed to GitHub
- GitHub Actions runs tests
- Worker is deployed using Wrangler
- Cloudflare Edge updates instantly
This project only uses services available in the Cloudflare Free tier:
- β Workers
- β D1
- β Cron (optional)
- β DNS & CDN
No paid or enterprise features required.
rhshourav