Skip to content

mcagriacikgoz/ReadyNet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 Readynet created by Çağrı Açıkgöz

Production-Ready URL Shortener Microservice

Node.js PostgreSQL Redis Docker

Readynet, a high-performance URL shortening service developed using modern backend architecture principles (Worker Pattern, Caching, Containerization). It is not just a URL shortener, but a concept project focused on asynchronous task management and scalability.


🧱 Architecture & Flow

ClientAPIRedis (Cache + Queue)WorkerPostgreSQL

The project adopts an Event-driven approach to reduce the load on the API:

  • API (Express): Writes the URL creation process to PostgreSQL and caches redirects in Redis.
  • Redis: Serves as both a Cache for fast routing and a Message Queue for click data.
  • Worker: Consumes click events in the queue asynchronously and processes them in PostgreSQL.

✨ Features

  • 🚀 High Performance: Millisecond-level routing with Redis caching.
  • ⚙️ Asynchronous Processing: Click statistics are processed in the background without overloading the API.
  • 🛡️ Resilience: Uninterrupted operation with Docker restart policies and health checks.
  • 📦 Modern DevOps: Optimized image sizes with a multi-stage Docker build structure.

🚀 Run Locally

Prerequisites

  • Docker & Docker Compose must be installed.

Installation

To get the project up and running with all its dependencies (Database, Cache, API, Worker):

docker compose up --build -d
Method Endpoint Description
GET /health The service checks the health status.
POST /shorten Creates a new short link.
GET /r/:code It redirects to the original URL.
GET /stats/:code Bağlantının tıklama istatistiklerini alır.

Request Body (POST /shorten): { "url": "https://example.com" }

📂 Project Structure

Readynet/
├── api/             # Express API service logic & Dockerfile
├── worker/          # Background worker service logic & Dockerfile
├── docker-compose.yml
└── README.md

🎯 Why This Project?

This project was developed to demonstrate the following backend patterns in practice:

Microservice Separation: Decoupling workloads.

Caching Strategies: Reducing database costs.

Message Queuing: Managing background tasks.

👤 Author

Çağrı Açıkgöz My LinkedIn Profile

📸 Demo

Health Check

Health

Docker Services Running

Docker

Click Statistics

Stats

Short URL

Short URL

About

Production-ready URL shortener built with Node.js, PostgreSQL, Redis and async worker architecture using Docker.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors