๐ A powerful, enterprise-grade URL shortener built with .NET 9 and modern web technologies
Transform long URLs into powerful, trackable short links with comprehensive analytics and beautiful admin interface
๐ฏ Quick Start โข ๐ Features โข ๐ ๏ธ Tech Stack โข ๐ Documentation โข ๐ Deploy
Try the live demo: ScissorLink live demo โ lnk.apponline.ir
โจ Cut long URLs down to size with style and intelligence
๐ฅ Major Architecture Overhaul - Click to expand
- โ
Namespace Evolution โ Migrated from legacy
akhr.irto meaningfulScissorLinknamespace - โ ORM Revolution โ Completely replaced Dapper with Entity Framework Core for enhanced maintainability
- โ React Transformation โ Brand new Material-UI admin panel for comprehensive link management
- โ Full-Stack Harmony โ Seamless API integration between .NET backend and React frontend
- โ Design Excellence โ Google Material Design standards throughout the admin interface
- โ Mobile-First โ Responsive design with modern UI/UX patterns
- โ .NET 9 Upgrade โ Latest LTS version with 40% improved performance
- โ Clean Architecture โ Dependency injection and SOLID principles implementation
- โ Advanced Analytics โ Enhanced click tracking with detailed visitor insights
- โ Smart Testing โ Domain-agnostic test buttons for any deployment environment
- โ Error Excellence โ Modern middleware with detailed logging and user-friendly messages
|
|
| Requirement | Version | Download Link |
|---|---|---|
| ๐ง .NET SDK | 9.0+ | Download .NET |
| ๐ฆ Node.js | 18.0+ | Download Node.js |
| ๐๏ธ SQL Server | 2016+ | Download SQL Server |
| ๐ป IDE | VS Code / VS 2022 | VS Code | Visual Studio |
All tools are free and cross-platform compatible
๐ช Windows Users - Click here
# ๐ One-click startup (Run as Administrator if needed)
./start-dev.batโก PowerShell Users - Click here
# ๐ฅ PowerShell magic
# Set execution policy if needed: Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
./start-dev.ps1๐ This automatically starts:
| Service | URL | Purpose |
|---|---|---|
| ๐ง Backend API | http://localhost:5000 |
Core URL shortening engine |
| โ๏ธ Admin Dashboard | http://localhost:3000 |
Beautiful React management UI |
Run the Script.sql in your SQL Server database to create the required tables:
ShortLink- Main URL data with enhanced schemaShortLinkDetail- Analytics and visitor tracking
Edit the connection string in src/appsettings.json:
{
"ConnectionStrings": {
"dbScissorLink": "Server=localhost;Database=dbScissorLink;User Id=myUser;Password=MyPass;Encrypt=false;TrustServerCertificate=true;Connection Timeout=30;"
}
}cd src
dotnet restore
dotnet runAPI will be available at http://localhost:5000
cd client
npm install
npm startAdmin interface will be available at http://localhost:3000
ScissorLink/
โโโ ScissorLink.Controllers/ # API controllers and endpoints
โโโ ScissorLink.Services/ # Business logic and caching
โโโ ScissorLink.Repos/ # Data access with Entity Framework
โโโ ScissorLink.Models/ # Entity Framework models
โโโ ScissorLink.DTOs/ # Data Transfer Objects for API
โโโ ScissorLink.Data/ # DbContext and database configuration
โโโ ScissorLink.Common/ # Shared utilities and middleware
โโโ ScissorLink.UserAgent/ # Browser and OS detection
src/
โโโ Controllers/
โ โโโ AdminController.cs # Admin API endpoints (CRUD)
โ โโโ ProcessController.cs # URL redirection and analytics
โ โโโ ErrorController.cs # Error handling
โโโ Data/
โ โโโ ScissorLinkDbContext.cs # Entity Framework DbContext
โโโ DTOs/ # API Data Transfer Objects
โ โโโ ShortLinkRequestDto.cs
โ โโโ ShortLinkResponseDto.cs
โ โโโ ShortLinkDetailDto.cs
โโโ Models/ # Entity Framework Models
โ โโโ DtoShortLink.cs
โ โโโ DtoShortLinkDetail.cs
โ โโโ DtoResult.cs
โโโ Services/ # Business Logic
โ โโโ ProcessService.cs
โ โโโ Interface/
โ โโโ IProcessService.cs
โโโ Repos/ # Data Access Layer
โ โโโ ProcessRepo.cs
โ โโโ BaseRepo.cs
โ โโโ Interface/
โ โโโ IProcessRepo.cs
โโโ Common/ # Shared Components
โ โโโ ErrorHandlingMiddleware.cs
โโโ UserAgent/ # Device Detection
โ โโโ UserAgent.cs
โ โโโ ClientBrowser.cs
โ โโโ ClientOS.cs
โ โโโ MatchExpression.cs
โโโ wwwroot/ # Static Files
โโโ GeoLite2-Country.mmdb
client/
โโโ public/
โ โโโ index.html # Main HTML template
โโโ src/
โ โโโ components/
โ โ โโโ AddShortLinkDialog.tsx # Add new link dialog
โ โ โโโ ShortLinksList.tsx # Links list with actions
โ โโโ pages/
โ โ โโโ ShortLinksPage.tsx # Main admin page
โ โโโ services/
โ โ โโโ apiService.ts # API communication layer
โ โโโ types/
โ โ โโโ api.ts # TypeScript type definitions
โ โโโ App.tsx # Main React component
โ โโโ index.tsx # Application entry point
โโโ package.json
| Method | Endpoint | Description | Request Body |
|---|---|---|---|
GET |
/shortlinks |
Get all short links | - |
GET |
/shortlinks/{id} |
Get specific short link | - |
POST |
/shortlinks |
Create new short link | ShortLinkRequestDto |
PUT |
/shortlinks/{id} |
Update short link | ShortLinkRequestDto |
DELETE |
/shortlinks/{id} |
Delete short link | - |
POST |
/shortlinks/{id}/toggle-publish |
Toggle publish status | - |
| Method | Endpoint | Description |
|---|---|---|
GET |
/{token} |
Redirect to original URL and track analytics |
{
title?: string; // Optional friendly name
token?: string; // Custom token (auto-generated if empty)
originLink: string; // Target URL (required)
isPublish: boolean; // Publish status
}{
id: number;
title?: string;
token: string;
originLink: string;
isPublish: boolean;
createAdminDate: string;
editAdminDate?: string;
clickCount: number;
recentClicks: ShortLinkDetailDto[];
}- ๐ List View - Paginated display with search and filtering
- โ Add New - Modal dialog with real-time validation
- โ๏ธ Edit Links - In-place editing with conflict resolution
- ๐๏ธ Delete - Confirmation dialogs with cascade handling
- ๐๏ธ Publish Toggle - One-click status changes
- ๐ Click Metrics - Real-time click counts and trends
- ๐ Geographic Data - Visitor country distribution
- ๐ป Device Stats - OS and browser analytics
- ๐ Time Analysis - Visit patterns and peak hours
- ๐จ Material Design - Consistent Google Material Design
- ๐ฑ Responsive Layout - Mobile-first responsive design
- โก Fast Loading - Optimized bundle sizes and lazy loading
- ๐ Real-time Updates - Live data without page refreshes
- ๐ Copy to Clipboard - One-click URL sharing
- ๐ Dynamic Testing - Domain-agnostic test buttons
cd src
dotnet publish -c Release -o ../publishcd client
npm run build
# Files will be in client/build/ directory# Example Dockerfile for backend
FROM mcr.microsoft.com/dotnet/aspnet:9.0
WORKDIR /app
COPY publish/ .
EXPOSE 80
ENTRYPOINT ["dotnet", "ScissorLink.dll"]# Backend
ASPNETCORE_ENVIRONMENT=Production
ConnectionStrings__dbScissorLink=<production-connection-string>
# Frontend
REACT_APP_API_URL=https://your-api-domain.com/api- DTO Validation - Model validation with annotations
- URL Validation - Proper URL format checking
- Token Sanitization - Safe character validation
- SQL Injection Prevention - Parameterized queries with EF Core
- CORS Policy - Configurable cross-origin requests
- HTTPS Enforcement - SSL/TLS for production
- Error Masking - Safe error messages for users
- Rate Limiting Ready - Infrastructure for request throttling
- Memory Caching - 10-minute cache for frequently accessed links
- Connection Pooling - Optimized database connections
- Async Operations - Non-blocking I/O throughout
- EF Core Optimization - Selective loading and compiled queries
- Code Splitting - Lazy loading for optimal bundle sizes
- Component Memoization - React.memo for expensive renders
- Virtual Scrolling - Efficient large list rendering
- Service Worker Ready - PWA capabilities
# Start development environment
./start-dev.ps1 # or start-dev.bat
# Run backend tests
cd src
dotnet test
# Run frontend tests
cd client
npm test
# Build for production
cd src && dotnet publish -c Release
cd client && npm run build# Add new migration
dotnet ef migrations add NewFeatureName
# Update database
dotnet ef database update
# Generate SQL script
dotnet ef migrations script|
Q2 2025 ๐ Authentication System ๐ Advanced Analytics ๐ Bulk Operations โฐ Link Expiration |
Q3-Q4 2025 ๐ท๏ธ Link Categories ๐ Custom Domains ๐ฑ QR Code Generation ๐ Password Protection |
2026 & Beyond ๐ง Email Integration ๐ API Extensions ๐ Multi-Language โ๏ธ Cloud Storage |
๐ก Have ideas? Open an issue or start a discussion
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open a Pull Request
- Follow C# coding conventions and .NET best practices
- Use TypeScript for all frontend code
- Write unit tests for new features
- Update documentation for API changes
- Ensure responsive design for UI changes
This project is licensed under the MIT License - see the LICENSE file for details.
- MaxMind - GeoIP2 database for geolocation services
- Material-UI Team - Excellent React component library
- Microsoft - .NET platform and Entity Framework
- React Team - Amazing frontend framework
- Community Contributors - All the developers who contributed
- Documentation: Check this README and code comments
- Issues: Use GitHub Issues for bug reports and feature requests
- Discussions: Use GitHub Discussions for questions and ideas
๐ ScissorLink - Cutting long URLs down to size since 2025
Where every click tells a story, and every link has a purpose
๐ฌ Discussions โข ๐ Issues โข ๐ง Email โข ๐ Documentation