LinkyUz is a URL shortening service that allows users to generate short, branded links, QR codes, and barcodes. It supports:
- URL Shortening (generating short links from long URLs)
- Branded Links (custom short URLs with brand names)
- QR Code Generation (converting URLs into QR codes)
- Barcode Generation (converting URLs into barcodes)
- Visit Logging (tracking link visits)
The application is built using .NET 6+, ASP.NET Core, Entity Framework Core, and MongoDB for storing branded links.
| Component | Technology/Tool |
|---|---|
| Backend | ASP.NET Core 6+ |
| Database | PostgreSQL (EF Core) |
| NoSQL Storage | MongoDB (for branded links) |
| URL Shortening | Custom algorithm (5-character codes) |
| QR Code | QRCoder library |
| Barcode | ZXing library |
| Task Scheduling | Hangfire (for background jobs) |
| AutoMapper | Object-to-object mapping |
| Logging | Built-in ASP.NET Core logging |
┌───────────────────────────────────────────────────────────────────────────────┐
│ Client (Browser) │
└───────────────────────────────────┬───────────────────────────────────────────┘
│
▼
┌───────────────────────────────────────────────────────────────────────────────┐
│ API Gateway (ASP.NET Core) │
│ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ URL Shorten │ │ Brand Links │ │ QR Code │ │ Barcode │ │
│ │ (EF Core) │ │ (MongoDB) │ │ Generator │ │ Generator │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘ │
│ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ Hangfire │ │ AutoMapper │ │ Logging │ │ CORS │ │
│ │ (Background │ │ (DTO ↔ Model)│ │ (Serilog) │ │ (Policy) │ │
│ │ Jobs) │ └─────────────┘ └─────────────┘ └─────────────┘ │
│ │
└───────────────────────────────────────────────────────────────────────────────┘
│
▼
┌───────────────────────────────────────────────────────────────────────────────┐
│ Databases │
│ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ PostgreSQL │ │ MongoDB │ │ Visit Logs │ │
│ │ (EF Core) │ │ (Brand Links)│ │ (EF Core) │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
└───────────────────────────────────────────────────────────────────────────────┘
https://localhost:5001/api
| Method | Endpoint | Description | Request Body (JSON) |
|---|---|---|---|
POST |
/LinkyUz/ShortenUrl |
Shorten a long URL | { "Url": "https://example.com" } |
GET |
/LinkyUz/Redirect/{code} |
Redirect to original URL | { code: string } |
| Method | Endpoint | Description | Request Body (JSON) |
|---|---|---|---|
POST |
/BrandUrl/CrateBrandLink |
Create a branded short link | { "Url": "https://example.com", "BrandName": "mybrand" } |
GET |
/BrandUrl/{brand} |
Redirect to original URL via brand | { brand: string } |
| Method | Endpoint | Description | Query Parameters |
|---|---|---|---|
GET |
/LinkyUz/LinkToQRCode |
Generate QR code for a URL | ?text=https://example.com |
| Method | Endpoint | Description | Query Parameters |
|---|---|---|---|
GET |
/LinkyUz/GenerateBarcode |
Generate barcode for a URL | ?url=https://example.com |
- .NET 6+ SDK (Download)
- PostgreSQL (Download)
- MongoDB (Download)
- Visual Studio 2022 (or VS Code with C# extensions)
git clone https://github.com/ELTNOrg/LinkyUz.git
cd LinkyUz- PostgreSQL:
- Create a database named
shortener. - Update
appsettings.jsonwith your PostgreSQL credentials:"ConnectionStrings": { "Database": "User ID=postgres;Password=7655;Server=localhost;Port=5432;Database=shortener;" }
- Create a database named
- MongoDB:
- Ensure MongoDB is running locally (
mongodb://localhost:27017). - Update
appsettings.json:"MongoDatabase": { "ConnectionString": "mongodb://localhost:27017", "DatabaseName": "linky", "CollectionName": "brandlinks" }
- Ensure MongoDB is running locally (
dotnet ef migrations add InitialMigration
dotnet ef database updatedotnet run- The API will start at
https://localhost:5001(orhttp://localhost:5000for HTTP). - Swagger UI will be available at
/swagger.