Skip to content

A URL Shortener Service built with Java, Spring Boot, and Redis

Notifications You must be signed in to change notification settings

java-salehian/URLShortener

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

URL Shortener

A Java Service built with Spring Boot, and Redis.

common

IDConverter.java
A Singleton class responsible for:
1. Generating ID
2. Using ID to create unique URL ID
3. Using unique URL ID to retrieve original ID


URLValidator.java
A Singleton class responsible for validating URL's validity

controller

URLController.java
A Spring Boot Controller responsible for:
1. Serving an endpoint to shorten URL
2. Redirect shortened URL to the original URL

repository

URLRepository
A Java class responsible for abstracting Redis(database) read/write logic

service

URLConverterService.java
A Java class used to abstract URL Shortening and URL Retrieval process
URLShortenerApplication.java
The entry point for the Spring application

To run:

1. Start up Redis' Server
redis-server
  1. Build the project
gradle build
  1. Run the project
gradle run

By default the Server will run on localhost:8080/shortener
To test, send POST Request to localhost:8080/shortener with a body of type application/json with body
{
  'url' : '<INSERT URL>'
}

About

A URL Shortener Service built with Java, Spring Boot, and Redis

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%