Skip to content

WinterSolid/URL-Shortener

Repository files navigation

URL Shortener

A backend URL shortener built with Spring Boot, PostgreSQL, Redis, and Docker.


Project Overview

Allows users to:

  • Convert long URLs into short codes
  • Redirect short URLs to original destinations
  • Track number of clicks per URL
  • Persist data in a relational database
  • Prepare for caching with Redis

Tech Stack

  • Java 17
  • Spring Boot
  • Spring Web (REST API)
  • Spring Data JPA
  • PostgreSQL
  • Redis
  • Docker
  • Maven

Architecture

The project follows a layered architecture:

  • Controller Layer

    • Handles HTTP requests and responses
    • Maps API endpoints
  • Service Layer

    • Contains business logic
    • Handles URL generation and click tracking
  • Repository Layer

    • Interfaces with PostgreSQL using Spring Data JPA
  • Entity Layer

    • Represents database tables
  • DTO Layer

    • Handles request and response objects

Process

  • Request { "url": "https://example.com" }

-Response { "originalUrl": "https://example.com", "shortCode": "abc123", "shortUrl": "http://localhost:8080/abc123" }


About

RESTful URL shortener service built with Spring Boot, using PostgreSQL for persistence, Redis for caching readiness, and Docker for local development.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Languages