Skip to content

A high-performance, enterprise-grade Spring Boot application designed for scalable URL shortening. This project implements a Microservices architecture pattern, utilizing Redis for high-speed caching and rate limiting, RabbitMQ for asynchronous decoupling of the email service, and Docker for containerized deployment.

Notifications You must be signed in to change notification settings

vishalgit101/UrlShortener-RedisCaching-EmailMicroService-RabbitMQ-Backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 UrlShortener - Microservices Backend & Email System

A high-performance, enterprise-grade Spring Boot application designed for scalable URL shortening. This project implements a Microservices architecture pattern, utilizing Redis for high-speed caching and rate limiting, RabbitMQ for asynchronous decoupling of the email service, and Docker for containerized deployment.

The application is fully hosted on Render with a CI/CD pipeline integrated via Docker Hub.


📺 Project Demonstrations Videos

Explore the application in action through these video walkthroughs:


📂 Postman Collection & Testing

The repository includes a comprehensive Postman collection to facilitate immediate testing of all API endpoints.

Location: postman/UrlShortener.postman_collection.json

How to use the collection:

  1. Navigate to the postman folder in the root directory.
  2. Open Postman and click on Import.
  3. Drag and drop the UrlShortener.postman_collection.json file.

☁️ Live Deployment & DevOps

The application utilizes a cloud-native approach. The source code is built into a Docker image and deployed to Render.

Render Deployment Logs Docker Repository
Render Logs Docker Repos

📖 API Documentation (Swagger UI)

Interactive documentation is available for the live environment. This allows for real-time testing of endpoints without local setup.

🔗 Live Link: Swagger UI Dashboard

📑 Table of Contents

  1. Project Overview
  2. Visual Walkthrough
  3. Architecture & Design
  4. Project Structure
  5. Environment Configuration
  6. Getting Started
  7. Troubleshooting

💻 Visual Walkthrough

1. Live Deployment & DevOps

The application utilizes a cloud-native approach. The source code is built into a Docker image, pushed to Docker Hub, and deployed automatically to Render.

Render Deployment Logs Docker Hub Repository
Successful build and deploy logs from the cloud hosting provider. Container images stored and versioned in Docker Hub.
Render Logs Docker Repos

2. API Documentation (Swagger UI)

Interactive documentation is available via Swagger/OpenAPI 3.0. This allows frontend developers and QA engineers to understand the contract without diving into the code.

Authentication & Admin Controllers: Secure endpoints for user registration, login (JWT), and administrator-level user management.

Auth Controller Admin & User Management
Auth API Admin API

URL Management & DTOs: The core business logic handles URL creation, expiration, and redirection. Strictly typed Data Transfer Objects (DTOs) ensure data integrity.

URL Management Endpoints Request DTO Models
Auth API DTOs

3. Database & Schema Design

The backend is powered by a relational database (MySQL/PostgreSQL) designed to handle relationships between Users, URLs, and Click Analytics.

Database Visualization Live Users Table
Visual representation of the data tables. Snapshot of the live database verifying user persistence.
DB Visual Users DB

4. Functional Testing (Postman)

Comprehensive testing was conducted locally to ensure reliability before deployment.

User Onboarding & Email Flow (RabbitMQ): This flow demonstrates the asynchronous nature of the application. The main service sends a message to the RabbitMQ queue, which the Email Service consumes to send a verification code.

Step 1: Email Token Received Step 2: Account Verified Step 3: Duplicate Check
Token Verified Exists

Handling asynchronous email messages. ! ! RabbitMQ Queues:

RabbitMQ Queues RabbitMQ Cloud Shorten Url
RabbitMQ Queues RabbitMQ Cloud Shorten Url

Performance & Analytics: Redis is used to cache frequently accessed URLs and limit request rates from specific IP addresses to prevent abuse.

QR Code Generation Redis Caching Logs Analytics & IP Tracking
QR Code Redis Logs Analytics

🛠 Project Architecture

The solution uses a Layered Architecture to separate concerns:

  • Controller Layer: Handles incoming REST requests.
  • Service Layer: Contains business logic (Shortening algorithm, Caching strategy).
  • Repository Layer: Direct database interaction using JPA.
  • Async Layer: RabbitMQ Producer/Consumer for email tasks.
  • Caching Layer: Redis Caching and Redis Rate limiting to prevent abusse.

Key Technologies:

  • Backend: Java 21, Spring Boot 3.x
  • Database: MySQL / PostgreSQL
  • Caching: Redis Caching and Rate Limiting
  • Message Broker: RabbitMQ with Email Microservice
  • Containerization: Docker
  • Tools: Lombok, Swagger UI, Maven

About

A high-performance, enterprise-grade Spring Boot application designed for scalable URL shortening. This project implements a Microservices architecture pattern, utilizing Redis for high-speed caching and rate limiting, RabbitMQ for asynchronous decoupling of the email service, and Docker for containerized deployment.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published