A high-performance, minimalist URL shortening service built with Spring Boot and React. This project demonstrates professional backend system design and a sleek, modern frontend architecture.
- Fast Redirection: Uses HTTP 302 Found for high-speed URL forwarding.
- Atomic Analytics: Real-time access tracking with
accessCount(Stats). - CRUD Operations: Complete REST API for managing shortened links.
- Safe Deletion: Transactional integrity for all database modifications.
- CORS Enabled: Seamless integration with modern frontend frameworks.
- SPA Architecture: Powered by
react-router-domfor instantaneous navigation. - Real-time Search: Instant filtering of your link database.
- Modal Driven: Sleek modal interfaces for creating and updating links.
- Responsive: Fully optimized for desktop and mobile viewing.
- Java 17+
- Spring Boot 3.x (Web, Data JPA)
- H2 Database (File-based persistence)
- Lombok (Boilerplate reduction)
- React 19
- Vite (Build tool)
- React Router 7 (Navigation)
- Vanilla CSS (Minimalist design system)
URLShortner/
├── Backend/ # Spring Boot application
│ ├── src/main/java # Controller, Service, Repository, Model
│ └── data/ # H2 Database files
└── frontend/ # React/Vite application
├── src/components# Modular UI components
└── src/pages # Route-based page views
- JDK 17 or higher
- Node.js & npm
- Navigate to the
Backenddirectory. - Run
./mvnw spring-boot:run(or use your IDE). - The API will be available at
http://localhost:8080.
- Navigate to the
frontenddirectory. - Install dependencies:
npm install. - Start the dev server:
npm run dev. - Open your browser at
http://localhost:5173.
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/shorten |
Create a new short URL |
GET |
/api/shorten/all |
List all saved URLs |
GET |
/api/{shortCode} |
Redirect to original URL |
PUT |
/api/shorten/{shortCode} |
Update a destination URL |
DELETE |
/api/shorten/{shortCode} |
Delete a short URL |
GET |
/api/shorten/{shortCode}/stats |
Get detailed click stats |
Sai Amirthesh