A simple URL shortener application built using Spring Boot (backend) and React (frontend). This project allows users to shorten long URLs and retrieve the original URL using a short alias.
-
Shorten long URLs
-
Redirect shortened URLs to the original link
-
Store URL mappings in a database
-
REST API for creating and retrieving URLs
-
Responsive React frontend for user interaction
-
Java 21+
-
Spring Boot
-
Spring Web
-
Spring Data JPA
-
H2 Database (or MySQL/PostgreSQL)
-
Lombok
-
Swagger for API documentation
-
React.js (Vite or Create React App)
-
Axios for API requests
-
TailwindCSS/Bootstrap for styling
-
React Router for navigation
-
Java 21+
-
Node.js (for React frontend)
-
Maven
-
Database (H2, MySQL, or PostgreSQL)
- Clone the repository:
git clone https://github.com/SureshKumar-HelloWorld/url-shortener-projects.git cd url-shortener-sb
- Build and run the Spring Boot application:
mvn spring-boot:run
- API will be available at http://localhost:8080
1.Navigate to the frontend directory:
cd ../url-shortener-frontend
2.Install dependencies:
npm install
3.Start the React app:
npm run dev
4.Open http://localhost:5173 (or as per Vite configuration) in the browser.
{ "longUrl": "https://example.com" }
Response:
{ "shortUrl": "http://localhost:8080/s/abc123" }
Redirects to the original URL.
-
User authentication
-
Custom short URLs
-
Analytics (click tracking)
-
Expiration time for short links
This project is licensed under the MIT License.