Skip to content
/ Tinify Public

Tinify - a simple URL shortener built with Python and Flask.

License

Notifications You must be signed in to change notification settings

Frakko/Tinify

Repository files navigation


Tinify logo

Tinify

A simple but awesome URL shortener app!
Report Bug · Request Feature



Table of Contents
  1. About The Project
  2. Getting Started
  3. Contributing
  4. License
  5. Contact

About The Project


Project image


There are already many great URL shortener apps available for free on the internet, however, I wanted to build my own custom one! Even though this is a fairly simple project, It's a great opportunity to learn either new technologies or improve in the ones that you already know.

ULR shorteners work through a technique that goes by the name of redirecting or forwarding. It allows for multiple ULRs to link to the same web page which, under certain circumstances is really useful. Once a web browser attempts to open a ULR which has been redirected, a page with a different ULR is opened.

If you'd like to try out the project for yourself, feel free to read the getting started section.

Built With

This project was built using the following technologies:


Getting Started

To get a local copy of the project up and running follow these simple steps listed below.

Prerequisites

  • Python

    Python can be downloaded from here - version 3.8 or higher is recommended. To check if you have Python installed run the following command:

    python --version
    # or
    python3 --version
  • Pip

    Pip (Python's package manager) is also required for this project. It usually comes with Python. To check if you have Pip run:

    pip --version
    # or
    pip3 --version
  • Pipenv

    This project uses Pipenv's virtual enviroments. To install Pipenv run the following command:

    pip install pipenv

Installation

  1. Clone the repository

    # Through SSH
    git clone git@github.com:Frakko/Tinify.git
    # Through HTTPS
    git clone https://github.com/Frakko/Tinify.git
  2. CD in to the project folder:

    cd Tinify
  3. Start Pipenv's virtual enviroment:

    pipenv shell
  4. Install the required Python packages:

    pipenv install
    # or
    pipenv sync
  5. Create the Sqlite database:

    • In the settings.py file change the constant SQLALCHEMY_DATABASE_URI to a hard coded database link that looks like this: sqlite:///db.sqlite3 (SQLite does not impose any naming requirements, thus you can name the database as you wish). This will later on be loaded from an enviroment variable, however those variables get loaded only once flask run is called, therefore we would have some issues when creating the database.

    • Open then the Python shell in your terminal by running the python command.

    • In the shell, write the following lines:

    from url_shortener import create_app
    from url_shortener.extensions import db
    db.create_all(app=create_app())
  6. Now that the database is created, create a .env file and add to it the following line, so that it will be loaded by this enviroment variable:

    DATABASE_URL=sqlite:///your_database_name_here
  7. The project is set up! To run it, type:

    flask run

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated. See contributing for more informations.

License

Distributed under the MIT License. See LICENSE for more information.

Contact

If you'd like to contact me, feel free to message me on either one of the follwing networks:

  • Twitter - @Frakko
  • Discord - Frakko#0001

About

Tinify - a simple URL shortener built with Python and Flask.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published