Module 1: Web Application Development with Flask
Module Overview
What is a web application? It's a pretty overloaded term, but in general, refers to any sort of useful interactive tool you can load in a web browser. In this module, we'll break down the specific components of a web application, and learn how to develop our own basic web application using the Flask Python framework.
Learning Objectives
1. Learn the difference between the "frontend" and "backend" of a web application
• Understand the client-server architecture of web applications
• Identify the roles and responsibilities of frontend components
• Explain the purpose and functions of backend systems
• Recognize how data flows between frontend and backend
• Compare different types of web application architectures
• Evaluate when to use different architectural approaches
2. Create a simple Flask app that runs locally
• Set up a basic Flask development environment
• Create and run a Flask application on your local machine
• Define routes and handle HTTP requests
• Implement basic templates for rendering HTML
• Connect Flask to a local database
• Test and debug Flask applications
3. Set up a database with tables for holding User and Tweet data
• Design database schema for storing user information
• Create tables for tweet content and metadata
• Establish relationships between users and tweets
• Implement database queries for retrieving and storing data
• Manage database connections in a Flask application
• Perform basic CRUD operations on database records
Guided Project
Web Application Development with Flask
Project Resources
Please read the README.md file in the GitHub repository for a complete overview of this module. Also, check the assignment.md file for detailed instructions on completing the following tasks:
Guided Project File:
guided-project.md
Module Assignment
Please read the assignment.md file in the GitHub repository for detailed instructions on completing the following tasks:
- Reproduce the steps from lecture: write and run a basic local Flask web application
- Create a model for Tweet and User as demonstrated in lecture, and populate your local (SQLite) database with some invented data (at least 6 Tweets and 2 Users)
- For tomorrow, make sure to sign up for the Twitter Developer API and check out the SpaCy documentation, as we will use the Twitter API and to populate our database with real data from Twitter, and we'll use the SpaCy Python package to build a simple NLP prediction model.
Assignment File:
assignment.md
Assignment Solution Video
Check for Understanding
Complete the following items to test your understanding:
- Distinguish between front-end, back-end, and database components
- Set up a Flask application and run it locally
- Create routes in Flask to handle different URL endpoints
- Implement HTML templates with Flask
- Connect a Flask application to a database