This project is a simple URL shortening web application built using Flask and PostgreSQL to shorten URLs and manage a user's shortened links.
The project includes several features:
- User authentication using username and password
- Shortening URLs with a 48-hour expiration
- Viewing the history of shortened URLs with the number of clicks
-
Clone the repository:
git clone https://github.com/your-username/url-shortener.git
-
Install the required dependencies:
pip install -r requirements.txt
-
Set up a PostgreSQL database and configure the
app.py
file with the appropriate credentials. -
Run the Flask application:
python app.py
-
Access the application through the browser:
http://localhost:5000/
-
Register or login with your credentials.
-
Shorten your URLs and manage them through the provided interface.
/home
: Home page/login
: User login page/
: Login page (root endpoint)/logout
: Logout endpoint/shorten
: Shorten URL endpoint/<short_url>
: Redirects to the original URL associated with the provided short URL/base
: Main user dashboard for URL shortening/history
: View history of shortened URLs
app.py
: Contains the main Flask application.templates/
: Folder containing HTML templates.static/
: Folder for static files (like images or CSS).README.md
: Documentation file for the repository.requirements.txt
: File containing all necessary Python packages for the project.
Contributions to enhance the project are welcome! Please follow these steps to contribute:
- Fork the repository.
- Create your feature branch:
git checkout -b feature/YourFeature
. - Commit your changes:
git commit -am 'Add some feature'
. - Push to the branch:
git push origin feature/YourFeature
. - Open a pull request.
This project is licensed under the MIT License.