Build URL Shortener with Flask MySQL (Challenge)

# Introduction This project guides you through creating a simple URL shortener service using Flask and MySQL. You'll learn to set up a database, design a web interface, and implement functionality to shorten URLs, search for URLs by tags, and view analytics. The project is beginner-friendly and offers a comprehensive insight into web development with Python and database management. The project is based on <https://github.com/highoncarbs/shorty>, which is originally licensed under the MIT license. ## 👀 Preview Convert the URL with/without custom suffix, Search URLs by tag, Access the link: <video src="https://file.labex.io/namespace/718bace8-27a3-4200-a588-dde4041ceeb9/web/project-build-a-simple-url-shortener-with-flask-and-mysql/challenge-1/assets/convert.mp4" width="100%" autoplay loop muted></video> View information about the operating system and platform used to access the link: <video src="https://file.labex.io/namespace/718bace8-27a3-4200-a588-dde4041ceeb9/web/project-build-a-simple-url-shortener-with-flask-and-mysql/challenge-1/assets/info.mp4" width="100%" autoplay loop muted></video> ## 🎯 Tasks In this project, you will learn to: - Connect a Flask application to a MySQL database. - Create and manage a MySQL database schema for storing URL information. - Implement frontend web pages using HTML and CSS to interact with the backend. - Handle form data and requests in Flask to create short URLs. - Develop functionality to redirect users from a short URL to the original URL. - Create a simple analytics feature to track URL usage, including click counts and basic browser/platform information. - Design user-friendly error handling and custom 404 pages for better user experience. ## 🏆 Achievements By completing this project, you will learn: - Basic operations with MySQL, including database and table creation, data insertion, and querying. - The fundamentals of Flask, including routing, request handling, and template rendering. - How to work with HTML forms and process data in a Flask application. - Basic frontend design principles and how to apply CSS to create a visually appealing web interface. - Simple analytics implementation to gather and display data about URL usage. - Best practices for error handling in web applications to improve reliability and user experience.

|60 : 00

Click the virtual machine below to start practicing