A full-stack URL shortening application built using React, Spring Boot, and PostgreSQL. NanoURL allows users to generate compact shortened URLs and redirect users seamlessly to original links.
- Shorten long URLs into compact links
- Redirect shortened URLs to original destinations
- RESTful API architecture
- Persistent storage using PostgreSQL
- Responsive frontend built with React
- Dockerized setup for easy deployment
- API testing with Postman
- React.js
- Axios
- Tailwind CSS
- Spring Boot
- Spring Web
- Spring Data JPA
- Spring Security
- PostgreSQL
- Docker
- Postman
- Maven
Frontend (React) communicates with backend REST APIs built in Spring Boot.
The backend:
- Accepts long URLs
- Generates unique short codes
- Stores mappings in PostgreSQL
- Redirects users using stored mappings
NanoURL/
β
βββ NanoUrl-frontend/ # React frontend
βββ NanoURL/ # Spring Boot backend
βββ README.mdgit clone https://github.com/your-username/NanoURL.git
cd NanoURLcd NanoURL
mvn clean install
mvn spring-boot:runcd NanoUrl-frontend
npm install
npm run devRun the entire application using Docker:
docker build -t .create application.properties:
spring.datasource.url=jdbc:postgresql://localhost:5432/nanourl
spring.datasource.username=postgres
spring.datasource.password=yourpassword
POST /api/url/shorten{
"originalUrl": "https://Google.com"
}{
"clickCount": 0,
"dateTime": "2026-05-19T21:29:28.5594516",
"id": 2,
"originalurl": "https://Google.com",
"shorturl": "ElEULFH",
"username": "Pratik"
}GET /{shortCode}Redirects user to original URL.
API endpoints were tested using Postman.
Example test cases:
- Valid URL shortening
- Invalid URL handling
- Redirection validation
- Duplicate URL checks
- Redis caching
- Rate limiting
- QR code generation
Pratik Senapati
GitHub: https://github.com/PratikC54