Skip to content

This project is a url shortener, created with python, flask and making connection to mongodb.

License

Notifications You must be signed in to change notification settings

iamjuaness/shortys

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SHORTYS

Shortys is a simple URL shortener built with Python and Flask, leveraging MongoDB for storage. This project allows users to shorten long URLs easily, providing a clean and user-friendly interface.

license last-commit repo-top-language repo-language-count

Built with the tools and technologies:

Flask HTML5 Python


Table of Contents

πŸ“ Overview

URL Shortener is a web application developed with Flask and built in Python that allows you to shorten long URLs, making them easier to manage and share. This tool converts long URLs into shorter links, ideal for social media posts, emails, or anywhere short and easy to remember links are preferred.

Key Features

  • URL Shortening: Converts long URLs into short, customizable links.
  • Simple and Friendly Interface: The application includes an intuitive.
  • HTML interface so that users can shorten and manage links without hassle.
  • Efficient Storage: Uses a MongoDB database to store and manage shortened URLs.
  • Redirected Routes: Allows quick redirection from the shortened URL to the original URL.

Who is it designed for?

This project is ideal for developers who need to implement a custom URL shortener, or for small businesses and users who want to shorten and manage links for easy sharing.

Technologies Used

  • Python and Flask for the backend logic.
  • HTML for the user interface.
  • MongoDB for URL and data management.

πŸ“ Project Structure

└── shortys/
    β”œβ”€β”€ app.py
    β”œβ”€β”€ requirements.txt
    β”œβ”€β”€ static
    β”‚   └── style.css
    β”œβ”€β”€ templates
    β”‚   └── index.html
    β”œβ”€β”€ vercel.json
    └── wsgi.py

πŸ“‚ Project Index

SHORTYS/
__root__
vercel.json ❯ Configuration for Vercel deployment.
app.py ❯ Main application file.
requirements.txt ❯ Python dependencies.
wsgi.py ❯ WSGI entry point for the application.
templates
index.html ❯ Main HTML template for the application.

Live Demo

Check out the live application here.

πŸš€ Getting Started

β˜‘οΈ Prerequisites

Before getting started with shortys, ensure your runtime environment meets the following requirements:

  • Programming Language: Python
  • Package Manager: Pip

βš™οΈ Installation

Install shortys using one of the following methods:

Build from source:

  1. Clone the shortys repository:
❯ git clone https://github.com/iamjuaness/shortys
  1. Navigate to the project directory:
❯ cd shortys
  1. Install the project dependencies:

Using pip Β 

❯ pip install -r requirements.txt

πŸ› οΈ Configure DataBase

Get Connection String.

For the project to work correctly, it is necessary to set up a database in MongoDB. Follow these steps:

  • Log in to MongoDB Atlas and create a new project.

  • In the project, create a Cluster. You can choose the type of cluster that suits your needs.

  • Once the cluster is created, go to the Connection section and select Connect your application.

  • Copy the Connection String, which should have a format similar to:

    mongodb+srv://<username>:<password>@cluster.mongodb.net/<dbname>?retryWrites=true&w=majority
    

Set up the .env file.

  • In the root of the project, create a .env file.

  • Add the connection string to the .env file, replacing <username>, <password>, and <dbname> with the corresponding values:

    MONGODB_URI=mongodb+srv://<username>:<password>@cluster.mongodb.net/<dbname>?retryWrites=true&w=majority

πŸ€– Usage

Run shortys using the following command: Using pip Β 

❯ python wsgi.py

πŸ§ͺ Testing

Run the test suite using the following command: Using pip Β 

❯ pytest

πŸ“Œ Project Roadmap

  • Task 1: Shorten URL's.
  • Task 2: Optimization Database.

πŸ”° Contributing

Contributing Guidelines
  1. Fork the Repository: Start by forking the project repository to your github account.
  2. Clone Locally: Clone the forked repository to your local machine using a git client.
    git clone https://github.com/iamjuaness/shortys
  3. Create a New Branch: Always work on a new branch, giving it a descriptive name.
    git checkout -b new-feature-x
  4. Make Your Changes: Develop and test your changes locally.
  5. Commit Your Changes: Commit with a clear message describing your updates.
    git commit -m 'Implemented new feature x.'
  6. Push to github: Push the changes to your forked repository.
    git push origin new-feature-x
  7. Submit a Pull Request: Create a PR against the original project repository. Clearly describe the changes and their motivations.
  8. Review: Once your PR is reviewed and approved, it will be merged into the main branch. Congratulations on your contribution!
Contributor Graph


πŸŽ— License

This project is protected under the MIT License License. For more details, refer to the LICENSE file.


πŸ™Œ Acknowledgments

This project would not have been possible without the support of the following tools and resources:

  • Flask: Special thanks to the creators and maintainers of Flask, a Python micro-framework that has made web development fast and accessible.
  • MongoDB: Thanks to the MongoDB team for providing a flexible and scalable database, perfect for managing and storing URLs.
  • Flask and MongoDB documentation: The tutorials and official documentation for both technologies were instrumental in guiding the development of this project.
  • Stack Overflow and the Developer Community: We are grateful to the global community of developers and contributors who share their knowledge and provide constant support, making troubleshooting faster and more efficient.

About

This project is a url shortener, created with python, flask and making connection to mongodb.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published