Skip to content

PratikC54/NanoURL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

73 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

NanoURL πŸ”—

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.


πŸš€ Features

  • 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

πŸ› οΈ Tech Stack

Frontend

  • React.js
  • Axios
  • Tailwind CSS

Backend

  • Spring Boot
  • Spring Web
  • Spring Data JPA
  • Spring Security

Database

  • PostgreSQL

Dev Tools

  • Docker
  • Postman
  • Maven

πŸ—οΈ System Architecture

Frontend (React) communicates with backend REST APIs built in Spring Boot.

The backend:

  1. Accepts long URLs
  2. Generates unique short codes
  3. Stores mappings in PostgreSQL
  4. Redirects users using stored mappings

πŸ“‚ Project Structure

NanoURL/
β”‚
β”œβ”€β”€ NanoUrl-frontend/        # React frontend
β”œβ”€β”€ NanoURL/                 # Spring Boot backend
└── README.md

βš™οΈ Installation & Setup

Clone Repository

git clone https://github.com/your-username/NanoURL.git
cd NanoURL

πŸ”§ Backend Setup

cd NanoURL
mvn clean install
mvn spring-boot:run

πŸ’» Frontend Setup

cd NanoUrl-frontend
npm install
npm run dev

🐳 Docker Setup

Run the entire application using Docker:

docker build -t .

πŸ—„οΈ Database Configuration

create application.properties:

spring.datasource.url=jdbc:postgresql://localhost:5432/nanourl
spring.datasource.username=postgres
spring.datasource.password=yourpassword

Screenshots

Screenshot 2026-05-28 210432 image image image

πŸ”Œ API Endpoints

Create Short URL

POST /api/url/shorten

Request Body

{
  "originalUrl": "https://Google.com"
}

Response

{
    "clickCount": 0,
    "dateTime": "2026-05-19T21:29:28.5594516",
    "id": 2,
    "originalurl": "https://Google.com",
    "shorturl": "ElEULFH",
    "username": "Pratik"
}

πŸ”„ Redirect Endpoint

GET /{shortCode}

Redirects user to original URL.


πŸ§ͺ API Testing

API endpoints were tested using Postman.

Example test cases:

  • Valid URL shortening
  • Invalid URL handling
  • Redirection validation
  • Duplicate URL checks


🌟 Future Improvements

  • Redis caching
  • Rate limiting
  • QR code generation

πŸ‘¨β€πŸ’» Author

Pratik Senapati

GitHub: https://github.com/PratikC54

About

A URL shortner application using REACT and SPRINGBOOT

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors