mirror of
https://github.com/Farhan291/Shorty.git
synced 2026-03-09 20:32:51 +00:00
No description
- TypeScript 57%
- C# 30.2%
- CSS 11.3%
- Dockerfile 1%
- JavaScript 0.5%
| .github/workflows | ||
| aqua | ||
| Ruby | ||
| Ruby.Tests | ||
| .gitignore | ||
| arch.png | ||
| docker-compose.yml | ||
| Dockerfile | ||
| LICENSE | ||
| nginx.conf | ||
| README.md | ||
| UrlShortner.sln | ||
Shorty
a url shorter written in c# and typescript.
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 APIgo.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.
