中文 | English
🔗 Simple, Secure, and Powerful URL Shortening Service
AL01 Link is a modern URL shortener built with Next.js 16, Prisma, and SQLite. It supports password protection, domain management, access analytics, and more.
- 🔗 Smart Short Link Generation - Auto-generate or customize paths with batch management support
- 🛡️ Security Protection - Password protection, domain whitelist, and secondary confirmation
- ⚡ Multiple Redirect Modes - Direct redirect, intermediate page, manual confirmation, temporary redirect
- 📊 Analytics & Insights - Access statistics, logs, and trend analysis
- 🎨 Modern UI - Responsive design, bilingual (EN/ZH), and dark mode
- Node.js 18.0+
- Bun 1.0+ (recommended) or npm/yarn
1. Clone the repository
# GitHub (Global)
git clone https://github.com/al01cn/Link.git
# Gitee (China)
git clone https://gitee.com/al01/Link.git
# GitCode (China)
git clone https://gitcode.com/al01cn/Link.git
cd Link2. Install dependencies
bun install3. Environment configuration
cp .env.example .env.local
# Edit .env.local to configure the database and application URL4. Initialize the database
bun run setup5. Start the service
# Development mode
bun run dev
# Production mode
bun run build && bun run startVisit http://localhost:3000 to get started.
- Username:
Loooong - Password:
Loooong123
⚠️ You will be required to change the default password after your first login.
Click the button below to deploy AL01 Link to Vercel with one click:
[](https://vercel.com/new/clone?repository-url=https://github.com/al01cn/Link&env=DATABASE_PROVIDER,DATABASE_URL,ENCRYPTION_KEY&envDescription=Database configuration and application secrets&envLink=https://gh.llkk.cc/https://github.com/al01cn/Link/blob/main/.env.example)
Required environment variables:
DATABASE_PROVIDER- Database type (postgresqlormysql)DATABASE_URL- Database connection stringENCRYPTION_KEY- Encryption key for passwords
💡 Tip: We recommend using free PostgreSQL databases from Supabase or Neon. The system automatically selects the correct Prisma schema based on
DATABASE_PROVIDER.
Click the button below to deploy with Netlify. You will be prompted to configure the required environment variables automatically:
Required environment variables:
DATABASE_PROVIDER- Database type (postgresqlormysql)DATABASE_URL- Database connection stringNEXT_PUBLIC_BASE_URL- Application base URL (optional; auto-detected if empty)ENCRYPTION_KEY- Encryption key
💡 Tip: Netlify will automatically prompt for required environment variables based on
netlify.toml.
⚠️ Important: When deploying to stateless Serverless platforms (such as Vercel, Netlify, or Railway), SQLite must be replaced with another database, as Serverless environments do not support persistent file storage.
# Build for Serverless
bun run build:sls
# Start
bun run start# Build production package
bun run build:prod
# Upload the build artifact to your server
# Install dependencies
pnpm install --production
# or
bun install --production
# Start the service
bun run start1. PostgreSQL (Recommended)
DATABASE_PROVIDER="postgresql"
DATABASE_URL="postgresql://username:password@host:5432/database"2. MySQL
DATABASE_PROVIDER="mysql"
DATABASE_URL="mysql://username:password@host:3306/database"3. Cloud Database Services
- Supabase - Free PostgreSQL hosting
- PlanetScale - Serverless MySQL
- Neon - Modern PostgreSQL platform
- Railway - Cloud platform with multiple database options
-
Update environment variables
DATABASE_PROVIDER="postgresql" # or "mysql" DATABASE_URL="postgresql://username:password@host:5432/database"
-
Regenerate Prisma Client
bun run prisma generate
-
Apply database migrations
bun run prisma db push
🎯 Automation Advantage: The system automatically selects the correct Prisma schema based on
DATABASE_PROVIDER, with no manual configuration required.
📖 Detailed Guide: See DATABASE_MIGRATION.md for full migration instructions and FAQs.
# Using Docker Compose
docker-compose up -d
# Initialize the database
docker-compose exec app bun run setup📝 Note: Docker deployment supports SQLite because containers provide persistent storage.
# Required
DATABASE_PROVIDER="sqlite" # sqlite | postgresql | mysql
DATABASE_URL="file:./dev.db" # SQLite (local development)
NEXT_PUBLIC_BASE_URL="http://localhost:3000" # Application URL
ENCRYPTION_KEY="your-secret-key" # Encryption key
# Optional
NEXT_PUBLIC_TURNSTILE_SITE_KEY="your-site-key" # Cloudflare Turnstile
TURNSTILE_SECRET_KEY="your-secret-key"- Framework: Next.js 16
- Database: Prisma + SQLite / PostgreSQL / MySQL
- Styling: Tailwind CSS
- Icons: Lucide React
- Runtime: Bun
- Language: TypeScript
Issues and Pull Requests are welcome!
- 🐛 Bug Reports: GitHub Issues
- 💬 Discussions: GitHub Discussions
- 🇨🇳 China Mirrors: Gitee | GitCode
- Next.js
- Prisma
- Tailwind CSS
- Lucide React
- Bun
Licensed under the MIT License.
| Platform | Link | Description |
|---|---|---|
| GitHub | al01cn/Link | Global, latest features |
| Gitee | al01/Link | China mirror |
| GitCode | al01cn/Link | China mirror (backup) |
AL01 Link — Shorten long URLs, make sharing easier ✨
Thank you for your support — Your support motivates the development and maintenance of AL01 Link.