Skip to content

Timmietheoriginal/shorturlapp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔗 ShortURLApp

A URL shortening web application built with Spring Boot that allows users to register, log in, shorten long URLs, and manage their shortened links. The app supports role-based access control and is designed with a server-rendered HTML UI using Thymeleaf.


🚀 Features

  • 🔒 User Registration & Login (Spring Security + Thymeleaf)
  • ✂️ Shorten URLs with generated short codes
  • 🔄 Redirect from Short URL to Original URL
  • 🧑‍💼 Role-Based Access Control (ROLE_USER, ROLE_ADMIN)
  • 📦 Persistent Storage (e.g., PostgreSQL)
  • 🌐 Thymeleaf-based Web Interface

🛠️ Tech Stack

  • Java 17+
  • Spring Boot 3
  • Spring MVC
  • Spring Security (Form Login)
  • Thymeleaf
  • PostgreSQL
  • Flyway (for database migrations)
  • Maven

🖼️ Web Pages

  • /register → User registration form
  • /login → Custom login form
  • / → Homepage and shortening form (public)
  • /my-urls → View and manage your own URLs (protected)
  • /admin/** → Admin-only features (optional)
  • /s/{shortCode} → Redirect to original URL

🔐 Security

  • Users are authenticated via form-based login
  • User roles are defined using a custom Role enum:
    public enum Role {
        ROLE_USER, ROLE_ADMIN
    }

How to Run Locally

Clone the project

git clone https://github.com/yourusername/shorturlapp.git cd shorturlapp

Build the project

./mvnw clean install

Run the application

./mvnw spring-boot:run

🧪 Database Configuration

To run the project locally with PostgreSQL:

  1. Create a PostgreSQL database named shorturlapp
  2. Copy application-example.properties to application.properties
  3. Update it with your own database username and password

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published