This is a URL shortener project that allows both registered and unregistered users to create shortened versions of URLs. For registered users, additional features include the ability to generate custom URLs, track visits on both custom and non-custom URLs, and view the history of generated short URLs.
-
URL Shortening:
- Both registered and unregistered users can create shortened URLs.
- Registered users can generate custom URLs and track visits on all URLs.
-
Analytics:
- The system automatically tracks the number of visits to each shortened URL.
- Registered users can view analytics and the history of generated short URLs.
- Python 3.x
- MySQL database
-
Clone the repository:
git clone https://github.com/Orjihenry/url-shortener.git
-
Install dependencies:
cd url-shortener pip install -r requirements.txt
-
Set up the database:
- Create a MySQL database named
url_shortener
. - Copy config_example.py to a new file named config.py.
- Replace placeholder values in config.py with actual config values, such as database credentials and secret keys.
- Create a MySQL database named
-
Run the application:
python main.py
-
Open your web browser and visit http://localhost:5000.
-
Registration: Users can register for an account.
-
Login: Once registered, users can log in using their credentials.
-
URL Shortening:
- After logging in, users can visit the dashboard to shorten a new URL.
- They can input the long URL, and a shortened version will be generated.
-
Analytics:
- The system automatically tracks the number of visits to each shortened URL.
- Registered users can view analytics and the history of generated short URLs.
-
All Users:
- Can create shortened URLs.
-
Registered Users:
- Can generate custom URLs.
- Can track visits on all URLs.
- Can view the history of generated short URLs.
Please adhere to the following guidelines when using GitHub Issues:
-
Bug Reports: Open an issue only for actual bugs.
-
Questions/Ideas: Use GitHub Discussions for questions, ideas, or general items.
-
Avoiding Noise: This policy prevents bugs from being drowned out by enhancement suggestions or help requests.
Contributions are welcome! If you have any improvements or features, please submit a pull request.
- Branch Naming: Name your branch 'bug-fix' or 'features' to make corrections or add new features.
- Pull Requests: Submit a pull request detailing the change(s) you made.
Happy Hacking!