Deploy OpenShortURL
Open-source URL shortener with analytics, custom slugs, QR codes & API
frontend
supra126/open-short-url
Just deployed
Postgres
railwayapp-templates/postgres-ssl:17
Just deployed
/var/lib/postgresql/data
Redis
redis:8.2.2
Just deployed
/data
backend
supra126/open-short-url
Just deployed
Deploy and Host OpenShortURL on Railway
OpenShortURL is a modern, self-hosted URL shortener with advanced analytics and security features. Built with NestJS and Next.js, it provides custom slugs, password protection, UTM tracking, two-factor authentication, comprehensive click analytics, and QR code generation for your shortened links.
About Hosting OpenShortURL
Deploying OpenShortURL on Railway provides a complete URL shortening solution with minimal configuration. The platform includes a NestJS backend API, Next.js frontend dashboard, PostgreSQL database, and Redis for caching. It features Cloudflare Turnstile bot protection, JWT-based authentication with httpOnly cookies, and real-time analytics including geolocation tracking, device detection, browser analysis, and referrer statistics. The entire stack deploys automatically with Railway's infrastructure.
Common Use Cases
- Track marketing campaign performance with UTM parameters and detailed click analytics
- Create branded short links with custom slugs for social media and content sharing
- Secure internal link sharing with password protection and two-factor authentication
Dependencies for OpenShortURL Hosting
- PostgreSQL database for storing URLs, users, and analytics data
- Redis for caching, session management, and rate limiting
- Node.js 18+ runtime environment
- Cloudflare Turnstile (optional) for bot protection
Deployment Dependencies
- OpenShortURL GitHub Repository
- NestJS Framework Documentation
- Next.js Framework Documentation
- Prisma ORM Documentation
Implementation Details
Required Environment Variables:
DATABASE_URL=postgresql://user:password@host:5432/database
REDIS_HOST=redis.railway.internal
REDIS_PORT=6379
REDIS_PASSWORD=your-redis-password
JWT_SECRET=your-jwt-secret-key
JWT_EXPIRES_IN=7d
FRONTEND_URL=https://your-domain.com
BACKEND_PORT=4101
Optional Cloudflare Turnstile:
TURNSTILE_SECRET_KEY=your-turnstile-secret
NEXT_PUBLIC_TURNSTILE_SITE_KEY=your-turnstile-site-key
Post-Deployment:
npx prisma migrate deploy
Why Deploy OpenShortURL on Railway?
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
By deploying OpenShortURL on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.
Template Content