Coder Social home page Coder Social logo

url-shortener's Introduction

URL Shortener Web Application

This project is a simple URL shortening web application built using Flask and PostgreSQL to shorten URLs and manage a user's shortened links.

Overview

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

Installation

  1. Clone the repository:

    git clone https://github.com/your-username/url-shortener.git
  2. Install the required dependencies:

    pip install -r requirements.txt
  3. Set up a PostgreSQL database and configure the app.py file with the appropriate credentials.

  4. Run the Flask application:

    python app.py

Usage

  1. Access the application through the browser: http://localhost:5000/

  2. Register or login with your credentials.

  3. Shorten your URLs and manage them through the provided interface.

Endpoints

  • /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

File Structure

  • 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.

Contributing

Contributions to enhance the project are welcome! Please follow these steps to contribute:

  1. Fork the repository.
  2. Create your feature branch: git checkout -b feature/YourFeature.
  3. Commit your changes: git commit -am 'Add some feature'.
  4. Push to the branch: git push origin feature/YourFeature.
  5. Open a pull request.

This project is licensed under the MIT License.

url-shortener's People

Contributors

grzzlyb avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.