A high-performance, enterprise-grade URL shortening service built for speed, security, and global scalability. Powered by Cloudflare's edge network for lightning-fast redirects worldwide.
Live Demo: https://shorty.killcod3.com
Redirect Domain: https://go-shorty.killcod3.com
Note: Demo version retains shortened URLs for 7 days
Shorty uses a streamlined two-service architecture optimized for performance and cost:
- Next.js Application - Frontend and API endpoints for URL creation
- Cloudflare Worker - Ultra-fast edge redirects only
This design minimizes Cloudflare Worker costs while maximizing redirect performance through edge caching.
Shorty is designed for organizations that demand:
- Sub-50ms redirects globally through Cloudflare's 200+ edge locations
- Enterprise-grade security with reCAPTCHA protection and URL validation
- Zero downtime with distributed edge architecture
- Cost-optimized infrastructure with minimal worker usage
- Clean, professional interface suitable for internal tools and customer-facing applications
Performance First
- Dedicated edge workers for redirects only
- Intelligent caching with 1-hour edge cache
- Sub-50ms response times worldwide
- Optimized worker bundle (< 2KB)
Security & Reliability
- reCAPTCHA v2 spam protection
- URL validation and sanitization
- Automatic TTL management (7 days)
- HTTPS enforcement with security headers
Developer Experience
- Modern TypeScript stack throughout
- RESTful API built into Next.js
- Responsive web interface
- Environment-based configuration
- Frontend & API: Next.js 15, TypeScript, Tailwind CSS, React
- Edge Redirects: Cloudflare Workers (JavaScript)
- Database: Cloudflare Workers KV
- Security: reCAPTCHA v2, URL validation, HTTPS enforcement
- Hosting: Vercel (Next.js) + Cloudflare Workers
Enterprise Applications
- Marketing campaign tracking
- Internal tool link management
- Customer communication optimization
- API endpoint abstraction
High-Volume Services
- Social media platforms
- Email marketing services
- Documentation systems
- Mobile application deep linking
Development Teams
- Staging environment management
- Feature flag distribution
- A/B testing infrastructure
- Development workflow optimization
# Clone the repository
git clone https://github.com/killcod3/shorty.git
cd shorty
# Frontend setup (includes API routes)
cd frontend
npm install
npm run dev
# Worker setup (separate terminal)
cd ../worker
wrangler devFrontend (.env.local):
# reCAPTCHA Configuration
NEXT_PUBLIC_RECAPTCHA_SITE_KEY=your_recaptcha_site_key
RECAPTCHA_SECRET_KEY=your_recaptcha_secret_key
# Cloudflare API Configuration
CLOUDFLARE_ACCOUNT_ID=your_account_id
CLOUDFLARE_API_TOKEN=your_api_token
CLOUDFLARE_KV_NAMESPACE_ID=your_kv_namespace_id
# Application URLs
DOMAIN=https://worker-redirect-domain.comWorker (wrangler.toml):
name = "shorty-worker"
compatibility_date = "2024-05-10"
main = "index.js"
[[kv_namespaces]]
binding = "LINKS_KV"
id = "your_kv_namespace_id"
[env.production]
vars = { HOME_URL = "https://link-to-nextjs-app.com" }POST /api/shorten
Content-Type: application/json
{
"url": "https://example.com/very-long-url",
"recaptchaToken": "recaptcha_response_token"
}{
"shortUrl": "https://go-shorty.url.com/abc123",
"originalUrl": "https://example.com/very-long-url",
"expiresIn": "7 days"
}GET /api/healthcd frontend
vercel --prodcd worker
wrangler deploy --env productionshorty/
├── frontend/ # Next.js app with API routes
│ ├── src/app/api/ # API endpoints
│ ├── src/app/ # Pages and components
│ └── ...
├── worker/ # Cloudflare Worker for redirects
│ ├── index.js # Worker script
│ └── wrangler.toml # Worker configuration
└── README.md
# Test frontend and API
cd frontend
npm run testWe welcome contributions from the community. Please read our contributing guidelines and submit pull requests for any improvements.
This project is open source and available under the MIT License.
For enterprise support, custom deployments, or feature requests, please open an issue on GitHub or contact the development team.
Built for performance, optimized for cost, ready for production at any scale.