This project is a TinyURL-style service that allows users to create short links for long URLs. It includes basic functionality to create, delete, retrieve long URLs, and track the number of times a short URL has been accessed. The service is designed to be run from the command line and does not include a web service or persistent storage.
To run this POC, follow these steps:
-
Clone the repository to your local machine.
-
Ensure you have the .NET runtime installed.
-
Open the project in your preferred C# development environment (e.g., Visual Studio or Visual Studio Code).
-
Build and run the project.
The application provides a simple command-line menu for interacting with the service. It includes the following options:
-
Create Short URL: Generates a short URL for a long URL. You can provide a custom short URL or let the application generate a random one.
-
Delete Short URL: Deletes a short URL and its associated long URL.
-
Get Long URL: Retrieves the long URL associated with a short URL.
-
Get Click Count: Retrieves statistics on how many times a short URL's long URL has been accessed (clicked).
-
Exit: Closes the application.
Please follow the on-screen instructions to use the service effectively.
URLService
: Manages the core functionality of the TinyURL-style service.URLRepository
: Provides an in-memory representation of data storage.ShortURLGenerator
: Generates short URLs based on a long URL.Constants
: Centralizes constants and configuration settings.
You can configure the POC by adjusting the Constants
class, which centralizes constants and configuration settings.
This project includes unit tests and integrated tests for the URLService
and URLRepository
classes. You can run these tests to ensure the correctness and reliability of the core functionality.
This POC provides a basic implementation of a TinyURL-style service. To make it production-ready, you can consider the following enhancements:
- Implement a web service for user interaction.
- Use a proper database for persistent storage.
- Add more advanced statistics and analytics.
- Enhance security features.
Tejas Hemant Choudhari