No description
  • TypeScript 57%
  • C# 30.2%
  • CSS 11.3%
  • Dockerfile 1%
  • JavaScript 0.5%
Find a file
2026-03-01 16:32:59 +05:30
.github/workflows add efcore migrations & docker setup 2026-02-28 16:59:54 +05:30
aqua update: frontend api call 2026-03-01 14:10:11 +05:30
Ruby update: redirect controller 2026-02-28 21:08:32 +05:30
Ruby.Tests add: redis 2026-02-28 18:01:01 +05:30
.gitignore init 2026-02-26 21:56:29 +05:30
arch.png add: readme & license 2026-03-01 16:32:59 +05:30
docker-compose.yml update: docker compose nginx and certbot 2026-03-01 11:52:14 +05:30
Dockerfile add efcore migrations & docker setup 2026-02-28 16:59:54 +05:30
LICENSE add: readme & license 2026-03-01 16:32:59 +05:30
nginx.conf update: redirect for https 2026-03-01 14:05:27 +05:30
README.md add: readme & license 2026-03-01 16:32:59 +05:30
UrlShortner.sln add: unit tests 2026-02-27 20:59:43 +05:30

Shorty

a url shorter written in c# and typescript.

Architecture

Architecture Overview

Ruby (Backend API)

Ruby is the core engine built with .NET 9 following Clean (Onion) Architecture principles. It handles the lifecycle of URL transformation and redirection.

Architecture Layers

  • Ruby.Core: Domain entities and core logic.
  • Ruby.Application: Use cases, DTOs, and service interfaces.
  • Ruby.Infrastructure: Persistence (EF Core), Caching (Redis), and Repository implementations.
  • Ruby.Api: ASP.NET Core controllers.

Aqua (Frontend)

Aqua is the modern client-side application.

Tech Stack

  • Next.js 16
  • Bun
  • Tailwind CSS + Radix UI
  • GSAP

Nginx (Reverse Proxy)

The gateway layer that secures and routes all traffic.

Responsibilities

  • SSL Termination: Handles HTTPS via Certbot and Let's Encrypt.
  • Routing: Proxies traffic to the internal Docker network.
    • api.lightchan.online -> Ruby API
    • go.lightchan.online -> Shortcode Redirection
  • Security: Hardened TLS configuration (TLS 1.2/1.3).

Prerequisites

Install:

  • Docker & Docker Compose
  • .NET 9 SDK
  • Bun Runtime

Infrastructure Setup (Docker)

The backend stack is fully orchestrated via Docker Compose.

1. Environment Configuration

Create a .env file in the root directory:

POSTGRES_USER=your_user
POSTGRES_PASSWORD=your_password
POSTGRES_DB=ruby_db
DB_CONNECTION=Host=ruby-postgres;Database=ruby_db;Username=your_user;Password=your_password
REDIS_HOST=ruby-redis:6379

2. Launch Stack

docker-compose up -d

This will spin up:

  • ruby-api: The .NET backend.
  • ruby-postgres: The PostgreSQL 16 database.
  • ruby-redis: The Redis 7 cache.
  • ruby-nginx: The reverse proxy.

Development Guide

Running Ruby (Backend)

1. Navigate to Ruby

cd Ruby/Ruby.Api

2. Restore and Run

dotnet restore
dotnet run

The API will be available at http://localhost:5000 (or the port specified in launchSettings.json).


Running Aqua (Frontend)

1. Navigate to Aqua

cd aqua

2. Install Dependencies

bun install

3. Start Development Server

bun dev

The frontend will be available at http://localhost:3000.


Hosting Note

all of the backend is hosted on azure vps.