Skip to content

abdelrahman998/url-shortener

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

URL Shortener Application

URL Shortener is a service that shortens a long URL into a short URL which is easier to share.

Table of Contents

  1. Features
  2. Prerequisites
  3. Getting Started
  4. Project Structure
  5. Technologies Used
  6. License

Features

  • Create short URLs with optional expiration.
  • Public and private short URLs.
  • User authentication and role-based access.
  • Validation for original URLs.
  • Tracks click counts for each short URL.

Prerequisites

Before running the application, ensure you have the following installed:

  • Java 17 or higher
  • Maven 3.8 or higher
  • Docker and Docker Compose
  • Git

Getting Started

1. Clone the Repository

git clone https://github.com/abdelrahman998/url-shortener.git
cd url-shortener

2. Configure the Application

Update the src/main/resources/application.properties file with your database configuration:

spring.datasource.url=jdbc:postgresql://db:5432/url_shortener
spring.datasource.username=your_db_username
spring.datasource.password=your_db_password
spring.jpa.hibernate.ddl-auto=update

3. Build the Application

Run the following command to build the application:

mvn clean install

4. Run the Application with Docker

Ensure the docker-compose.yml file is present in the project root.

Start the application using Docker Compose:

docker-compose up --build

This will start the application and a PostgreSQL database container.

Project Structure

  • src/main/java/com/example/url_shortener: Main application code.
  • src/main/resources: Configuration files and templates.
  • db/migration: SQL migration scripts.

Technologies Used

  • Java 17
  • Spring Boot
  • Spring Data JPA
  • Maven
  • PostgreSQL
  • FlywayDb Migrations
  • Docker
  • Thymeleaf (for templates)
  • Spring Security

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

URL Shortener is a service that shortens a long URL into a short URL which is easier to share.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published