Skip to content

Repository files navigation

๐Ÿ”— ScissorLink - Advanced URL Shortener

.NET React TypeScript Material-UI Entity Framework SQL Server

๐Ÿš€ 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


ScissorLink Dashboard Preview - Advanced URL Shortener

Try the live demo: ScissorLink live demo โ€” lnk.apponline.ir

โœจ Cut long URLs down to size with style and intelligence

๐ŸŽ‰ What's New in 2025

๐Ÿ”ฅ Major Architecture Overhaul - Click to expand

๐Ÿ—๏ธ Complete Platform Modernization

  • โœ… Namespace Evolution โ†’ Migrated from legacy akhr.ir to meaningful ScissorLink namespace
  • โœ… 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

๐Ÿš€ Performance & Developer Experience

  • โœ… .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

๐ŸŒŸ Why Choose ScissorLink?

๐Ÿš€ Lightning-Fast Performance

  • โšก Sub-100ms Redirects - Optimized for speed with intelligent caching
  • ๐Ÿ”— Custom Tokens - User-defined short codes or auto-generated secure tokens
  • ๐ŸŽฏ Smart Publish Control - Draft/live system for link management
  • ๐Ÿ“ฆ Bulk Operations - Handle thousands of links efficiently

๐Ÿ“Š Advanced Analytics Engine

  • ๐ŸŒ Global Tracking - Country detection via MaxMind GeoIP2 database
  • ๐Ÿ’ป Device Intelligence - Detailed OS, browser, and device identification
  • ๐Ÿ“ˆ Real-time Insights - Live click counts and visitor analytics
  • ๐Ÿ“… Time-Series Analytics - Historical patterns and trend analysis
  • ๐ŸŽฏ User Journey Mapping - Complete visitor flow tracking

๐ŸŽจ Beautiful Admin Experience

  • โš›๏ธ Modern React UI - TypeScript-based admin panel with Material-UI
  • ๐Ÿ”ง Complete CRUD - Intuitive link management interface
  • ๐Ÿงช Live Testing - Test links directly from admin panel
  • ๐Ÿ“‹ One-Click Sharing - Copy URLs to clipboard instantly
  • ๐Ÿ“ฑ Fully Responsive - Perfect on desktop, tablet, and mobile

๐Ÿ›ก๏ธ Enterprise-Grade Security

  • ๐Ÿ—๏ธ Entity Framework Core - Robust ORM with migrations
  • ๐Ÿ”’ Security First - SQL injection prevention, XSS protection
  • ๐ŸŒ CORS Ready - Configured for modern SPA development
  • โš ๏ธ Error Boundaries - Comprehensive error handling
  • ๐Ÿ” Input Validation - Multi-layer data sanitization

๐Ÿ› ๏ธ Technology Stack

๐ŸŽฏ Cutting-Edge Technologies

.NET 9

๐Ÿš€ Backend Powerhouse

  • ASP.NET Core WebAPI
  • Entity Framework Core 9.0
  • Microsoft.Data.SqlClient 5.2.1
  • MaxMind.GeoIP2 5.2.0
  • System.Text.Json
React 18

โš›๏ธ Frontend Excellence

  • React 18 + Concurrent Features
  • TypeScript 4.9
  • Material-UI 5.15
  • Axios 1.6
  • React Router 6
SQL Server

๐Ÿ—„๏ธ Database & Storage

  • SQL Server 2016+
  • Entity Framework Migrations
  • Advanced Indexing
  • Connection Pooling

๐Ÿ† Why This Stack?

Chosen for performance, scalability, and developer experience

๐Ÿ“‹ Prerequisites

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

๐Ÿš€ Quick Start

โšก Get Started in 30 Seconds

One command to rule them all

๐ŸŽฏ Option 1: Instant Development (Recommended)

๐ŸชŸ 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

Option 2: Manual Setup

1. Database Setup

Run the Script.sql in your SQL Server database to create the required tables:

  • ShortLink - Main URL data with enhanced schema
  • ShortLinkDetail - Analytics and visitor tracking

2. Backend Configuration

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;"
  }
}

3. Start Backend API

cd src
dotnet restore
dotnet run

API will be available at http://localhost:5000

4. Start Frontend Admin Interface

cd client
npm install
npm start

Admin interface will be available at http://localhost:3000

๐Ÿ—๏ธ Project Architecture

Namespace Structure

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

Backend Structure

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

Frontend Structure

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

๐Ÿ”Œ API Documentation

Admin API Endpoints (/api/admin)

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 -

URL Redirection API

Method Endpoint Description
GET /{token} Redirect to original URL and track analytics

Data Models

ShortLinkRequestDto

{
  title?: string;        // Optional friendly name
  token?: string;        // Custom token (auto-generated if empty)
  originLink: string;    // Target URL (required)
  isPublish: boolean;    // Publish status
}

ShortLinkResponseDto

{
  id: number;
  title?: string;
  token: string;
  originLink: string;
  isPublish: boolean;
  createAdminDate: string;
  editAdminDate?: string;
  clickCount: number;
  recentClicks: ShortLinkDetailDto[];
}

๐Ÿ“Š Admin Interface Features

URL Management

  • ๐Ÿ“‹ 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

Analytics Dashboard

  • ๐Ÿ“ˆ 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

User Experience

  • ๐ŸŽจ 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

๐Ÿš€ Deployment

Production Build

Backend

cd src
dotnet publish -c Release -o ../publish

Frontend

cd client
npm run build
# Files will be in client/build/ directory

Docker Deployment

# Example Dockerfile for backend
FROM mcr.microsoft.com/dotnet/aspnet:9.0
WORKDIR /app
COPY publish/ .
EXPOSE 80
ENTRYPOINT ["dotnet", "ScissorLink.dll"]

Environment Variables

# Backend
ASPNETCORE_ENVIRONMENT=Production
ConnectionStrings__dbScissorLink=<production-connection-string>

# Frontend
REACT_APP_API_URL=https://your-api-domain.com/api

๐Ÿ”’ Security Features

Input Validation

  • 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

Security Headers

  • 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

๐Ÿ“ˆ Performance Optimizations

Backend Performance

  • 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

Frontend Performance

  • 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

๐Ÿงช Development & Testing

Development Workflow

# 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

Database Migrations

# Add new migration
dotnet ef migrations add NewFeatureName

# Update database
dotnet ef database update

# Generate SQL script
dotnet ef migrations script

๐Ÿ”ฎ Roadmap & Future Vision

๐Ÿš€ What's Coming Next

Building the future of URL shortening

๐ŸŽฏ Next Release

Q2 2025

๐Ÿ” Authentication System
User registration & role-based access

๐Ÿ“Š Advanced Analytics
Charts, graphs & export functionality

๐Ÿ”„ Bulk Operations
Import/export CSV functionality

โฐ Link Expiration
Time-based link expiration

๐Ÿš€ Medium Term

Q3-Q4 2025

๐Ÿท๏ธ Link Categories
Organizational tags & folders

๐Ÿ”— Custom Domains
Branded short URLs

๐Ÿ“ฑ QR Code Generation
Automatic QR codes for mobile

๐Ÿ”’ Password Protection
Optional password-protected links

๐ŸŒŸ Long Term

2026 & Beyond

๐Ÿ“ง Email Integration
Automated reports & notifications

๐Ÿ”Œ API Extensions
Webhook support & integrations

๐ŸŒ Multi-Language
Full internationalization

โ˜๏ธ Cloud Storage
Alternative storage backends

๐Ÿ’ก Have ideas? Open an issue or start a discussion

๐Ÿค Contributing

We welcome contributions! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit changes: git commit -m 'Add amazing feature'
  4. Push to branch: git push origin feature/amazing-feature
  5. Open a Pull Request

Development Guidelines

  • 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

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • 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

๐Ÿ“ž Support

  • 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

๐Ÿ’– Built with Love & Cutting-Edge Tech

Made with Love .NET 9 React 18 TypeScript

โญ Star us on GitHub โ€ข ๐Ÿด Fork โ€ข ๐Ÿ› Report Issues โ€ข ๐Ÿ’ก Suggest Features

GitHub stars GitHub forks GitHub issues


๐Ÿ”— ScissorLink - Cutting long URLs down to size since 2025

Where every click tells a story, and every link has a purpose

๐Ÿ“ž Need Help?

๐Ÿ’ฌ Discussions โ€ข ๐Ÿ› Issues โ€ข ๐Ÿ“ง Email โ€ข ๐Ÿ“– Documentation

About

ScissorLink is an advanced open-source URL shortener built with .NET 9 & React. Fast redirects, analytics, custom links, and a modern admin dashboard.

Topics

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages