Deploy Short Link Tracker
URL shortening ,QR code generator,Analytics,Tracking
Redis
Just deployed
/data
Just deployed
/var/lib/postgresql/data
short-link-tracker
Just deployed
Deploy and Host Short Link Tracker on Railway
Short Link Tracker is a modern URL shortening platform built with Next.js 15 that provides link management, click tracking, analytics dashboards, QR code generation, CSV exports, and customizable branding. Designed for individuals, businesses, and marketing teams, it makes it easy to create, manage, and analyze shortened links from a secure web-based administration panel.
About Hosting Short Link Tracker
Railway makes deploying Short Link Tracker simple by automatically building the application and provisioning the required services. This template requires both PostgreSQL and Redis, which Railway can provide as managed services. PostgreSQL stores links, click analytics, settings, and authentication data, while Redis accelerates frequently accessed data and analytics. Railway also manages HTTPS, deployments, networking, and environment variables, allowing you to focus on managing your short links instead of infrastructure. Once deployed, the application includes an administrator dashboard for creating links, viewing analytics, exporting reports, and customizing branding.
Common Use Cases
- Create branded short URLs with analytics and QR codes.
- Track marketing campaigns, referral traffic, and click performance.
- Manage internal or public URL shortening services with an administrative dashboard.
Dependencies for Short Link Tracker Hosting
| Dependency | Required | Purpose |
|---|---|---|
| PostgreSQL | Yes | Stores links, analytics, settings, and authentication data. |
| Redis | Yes | Caches frequently accessed data and improves application performance. |
Deployment Dependencies
| Resource | Link |
|---|---|
| GitHub Repository | https://github.com/bilalnawaz072/short-link-tracker |
| Next.js | https://nextjs.org |
| Prisma ORM | https://www.prisma.io |
| PostgreSQL | https://www.postgresql.org |
| Redis | https://redis.io |
| MaxMind GeoLite2 | https://www.maxmind.com/en/geolite2/signup |
Implementation Details
Docker
Railway automatically builds the application from the repository.
No Docker configuration is required.
Public Networking
| Setting | Value |
|---|---|
| Proxy Type | HTTP Proxy |
| Target Port | 8080 |
Environment Variables
Configure the following Railway Variables before deployment.
| Variable | Required | Description |
|---|---|---|
DATABASE_URL | Yes | PostgreSQL connection string. Use the Railway PostgreSQL reference variable. |
REDIS_URL | Yes | Redis connection string. Use the Railway Redis reference variable. |
ADMIN_PASSWORD | Yes | Administrator login password. |
JWT_SECRET | Yes | Secret used to sign authentication tokens. |
MAXMIND_LICENSE_KEY | No | Enables visitor country detection using MaxMind GeoLite2. |
NODE_ENV | Yes | Application environment. |
PORT | Yes | Internal application port. |
BASE_URL | Yes | Public Railway URL used for generated short links. |
Raw Editor example:
DATABASE_URL=${{Postgres.DATABASE_URL}}
REDIS_URL=${{Redis.REDIS_URL}}
ADMIN_PASSWORD=${{secret(32)}}
JWT_SECRET=${{secret(32)}}
MAXMIND_LICENSE_KEY=
NODE_ENV=production
PORT=8080
BASE_URL=https://${{RAILWAY_PUBLIC_DOMAIN}}
Database
This template requires both PostgreSQL and Redis.
PostgreSQL
- Add a PostgreSQL service to your Railway project.
- Reference its connection string:
DATABASE_URL=${{Postgres.DATABASE_URL}}
Redis
- Add a Redis service to your Railway project.
- Reference its connection string:
REDIS_URL=${{Redis.REDIS_URL}}
Build & Start
Before the application starts, configure the following Pre-Deploy Command in Railway:
npx prisma generate && npx prisma db push
Railway automatically builds and starts the application after the database schema has been synchronized.
Persistent Storage
No Railway Volume is required.
Application data is stored in PostgreSQL, while Redis provides caching.
Accessing the Application
After deployment:
- Open your Railway service.
- Navigate to Settings → Networking.
- Click Generate Domain.
- Open your generated Railway URL.
The main application will be available at:
https://
The administrator dashboard is available at:
https:///admin
First Login
Sign in using the administrator password configured in Railway:
Username: (Not required)
Password: ADMIN_PASSWORD
The password is the value you configured for the ADMIN_PASSWORD environment variable.
Using Short Link Tracker
After logging in:
- Create a new shortened URL.
- Optionally configure:
- Custom short code
- Title
- Tags
- Expiration date
- Click limit
- Generate a QR code.
- Share the generated short URL.
- Monitor analytics from the dashboard.
- Export click analytics as CSV when needed.
Optional GeoIP Analytics
To display visitor country information:
- Create a free MaxMind account.
- Generate a GeoLite2 License Key.
- Configure:
MAXMIND_LICENSE_KEY=your_license_key
If omitted, the application functions normally, but visitor country information will display as Unknown.
Features
- URL shortening
- Custom short codes
- Click analytics
- QR code generation
- CSV export
- Administrator dashboard
- JWT authentication
- Redis caching
- PostgreSQL storage
- Custom 404 page
- Device and referral analytics
- Optional GeoIP country tracking
Why Deploy Short Link Tracker 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 Short Link Tracker 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
Redis
redis:8.2.1short-link-tracker
bilalnawaz072/short-link-trackerMAXMIND_LICENSE_KEY
Optional Enables visitor country detection using MaxMind GeoLite2.
