A compact, easy-to-use URL shortening service developed in Go. It allows users to create shortened versions of long URLs, making them easier to share and manage.
The service is designed with simplicity and performance in mind, providing both a command-line interface and an HTTP server for web redirection.
- URL Shortening: Generate short, unique identifiers for long URLs.
- HTTP Redirection: Redirects short URLs to their original destinations through an embedded HTTP server.
- CLI Support: Offers a command-line interface for shortening URLs and retrieving original URLs.
- Concurrency Support: Handles multiple requests concurrently, ensuring high performance.
- In-Memory Storage: Utilizes an in-memory repository for fast retrieval and storage of URL mappings.
- Persistent Storage: Integrate a database (MongoDB) to persist URL mappings beyond the application lifecycle.
- Languages and Frameworks: The project is entirely written in Go, leveraging its standard library for HTTP server functionality & concurrency management.
- Architecture: Follows the Model-View-Controller (MVC) design pattern, separating data handling (Model), user interface (View), and application logic (Controller) for clarity and maintainability.
- Data Storage: Uses an in-memory data store for quick access and simplicity, with a straightforward path to adapt to database storage for persistence. Expanded to include MongoDB.
- Clone the Repository:
git clone https://github.com/siddhant-vij/URL-Shortener.git
- Build the Project: Navigate to the project directory and run the following command:
cd URL-Shortener go build -o urlShortener
- Run the Server: Start the HTTP server and CLI tool by running the following command:
./urlShortener
- Usage: CLI: Follow the on-screen prompts to perform url shortening operations.
- Usage: HTTP Redirection: Access
http://localhost:8080/<shortened-path>
in a web browser to be redirected to the original URL.
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch:
git checkout -b feature/AmazingFeature
- Commit your Changes:
git commit -m 'Add some AmazingFeature'
- Push to the Branch:
git push origin feature/AmazingFeature
- Open a Pull Request
- Custom Short URL Aliases: Allow users to specify custom aliases for their shortened URLs.
- User Authentication: Implement user accounts and authentication to enable personalized URL management.
- Dockerization: Containerize the application with Docker for easy deployment and scaling.
- Access Statistics: Track and report on the number of times each shortened URL is accessed.
Distributed under the MIT License. See LICENSE
for more information.