# 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/lab-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/lab-1/assets/info.mp4" width="100%" autoplay loop muted></video> ## ðŊ Tasks In this project, you will learn: - How to connect a Flask application to a MySQL database - How to create and manage a MySQL database schema for storing URL information - How to implement frontend web pages using HTML and CSS to interact with the backend - How to handle form data and requests in Flask to create short URLs - How to develop functionality to redirect users from a short URL to the original URL - How to create a simple analytics feature to track URL usage, including click counts and basic browser/platform information - How to design user-friendly error handling and custom 404 pages for better user experience ## ð Achievements After completing this project, you will be able to: - Perform basic operations with MySQL, including database and table creation, data insertion, and querying - Understand the fundamentals of Flask, including routing, request handling, and template rendering - Work with HTML forms and process data in a Flask application - Apply basic frontend design principles and use CSS to create a visually appealing web interface - Implement simple analytics to gather and display data about URL usage - Implement best practices for error handling in web applications to improve reliability and user experience
Click the virtual machine below to start practicing