Skip to content

sunagdas/ZipLink

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 ZipLink – URL Shortener

ZipLink is a full-stack URL shortener web application built with Spring Boot. It allows users to create short, shareable links, manage them through a dashboard, and track usage with click analytics.


🎯 Purpose of the Project

This project was developed primarily to learn and understand the fundamentals of Spring Boot and building RESTful web applications.

The main focus was on:

Backend development and application architecture Authentication and security using Spring Security Designing and implementing core business logic

The frontend was kept secondary, and AI tools were used to assist in building UI components and speeding up development where appropriate.

✨ Features

  • 🔐 User authentication (Register / Login)
  • 🔗 Generate short URLs from long links
  • ✏️ Custom alias support (optional)
  • 📊 Dashboard with URL management
  • 👁️ Click tracking for each link
  • 🗑️ Delete URLs
  • 🔒 Secure password storage using BCrypt
  • ⚡ Session-based authentication

🛠️ Tech Stack

Backend

  • Java 17
  • Spring Boot
  • Spring Security
  • Spring Data JPA

Frontend

  • JSP (Java Server Pages)
  • Bootstrap

Database

  • H2 (file-based database)

🧠 Architecture

The application follows a layered architecture:

Controller → Service → Repository → Database

  • Controllers handle HTTP requests and responses
  • Services contain business logic
  • Repositories interact with the database

🔑 How It Works

Authentication

  • Uses Spring Security with session-based authentication
  • User credentials are validated via AuthenticationManager
  • Authentication is stored in the SecurityContext and maintained via HTTP session

URL Shortening

  • Generates a random short code using SecureRandom
  • Ensures uniqueness by checking existing entries in the database
  • Supports custom aliases with validation and reserved keyword checks

Redirect Flow

  • Short URL is resolved from database
  • Redirects to original URL
  • Click count is incremented for analytics

📦 Project Structure

com.ziplink.app

controller # Handles HTTP requests
service # Business logic
repository # Database operations
entity # JPA entities
dto # Request/response models
config # Security configuration
exception # Global error handling


▶️ Getting Started

Prerequisites

  • Java 17+
  • Maven

Run the Application

mvn spring-boot:run

App will start at: http://localhost:8080


🗄️ H2 Database Console


🧪 Testing

mvn test


🤖 Use of AI

This project was primarily designed and developed by me, with selective assistance from AI tools.

🤖 Where AI was used

  • Assisted with boilerplate configurations (e.g., Spring Security setup)
  • Suggested validation patterns and annotations
  • Helped with UI development (JSP + Bootstrap)
  • Supported debugging and code readability improvements
  • Assisted in generating README content

👨‍💻 What was implemented manually

  • Designed the project architecture (Controller → Service → Repository)
  • Implemented core business logic (URL generation, collision handling, click tracking)
  • Built the basic frontend integration
  • Integrated authentication flow using Spring Security
  • Designed and handled application-level error handling

Approach

AI was used as a development assistant, not a replacement for understanding.


🚧 Future Improvements

  • Redis caching
  • Advanced analytics
  • Link expiration
  • Rate limiting
  • Migration to MySQL/PostgreSQL

💡 Key Learnings

  • Spring Security authentication
  • Layered backend architecture
  • Real-world system design
  • Performance and scalability trade-offs

👨‍💻 Author

SUNAG M


⭐ Support

Give it a star if you like it!

Releases

No releases published

Packages

 
 
 

Contributors