The URL Shortener project is a web application developed using Java, Spring Boot, and MongoDB. Its main purpose is to provide a service that allows users to shorten long URLs into shorter, more manageable links. This project aims to simplify the sharing and tracking of URLs, making them easier to remember and share across various platforms.
- URL Shortening: Users can input long URLs and generate shortened links that are easier to share and remember.
- Expiration and Tracking: Shortened URLs can be set with an expiration date, after which they will no longer be accessible. Additionally, the system tracks the number of visits and provides analytics for each shortened URL.
- Duplicate URL Handling: The system checks for duplicate URLs and ensures that multiple shortcodes are not generated for the same URL.
- Error Handling: The project includes robust error handling mechanisms to handle various scenarios, such as shortcode collisions.
- Setup call to metrics-service via Kafka every time the URL is visited
- Handle invalid URLs
- Custom short codes
- Activate deactivated shortcode if new add-url-request comes for existing deactivated url
- Setup endpoint to process add-metrics
- Add logic to save URL metrics to DB
- Setup metrics service
- Setup Kafka service to consume add-metrics messages from url-shortener-service
- Setup Feign client calling DB service
- Setup metrics logic for URL visit
- Add swagger
- Enable caching
- Implement service discovery and load balancing
- Implement circuit breaker using Resilience4J
- Implement API security
Run this command in terminal:
$ brew install kafka
This will install Zookeeper and then Kafka. To start Kafka, Zookeeper must be running. Run below commands:
$ brew services start zookeeper
$ brew services start kafka
To stop the services, run below commands:
$ brew services stop kafka
$ brew services stop zookeeper