Project 2: Flack

Objectives

Overview

In this project, you’ll build an online messaging service using Flask, similar in spirit to Slack. Users will be able to sign into your site with a display name, create channels (i.e. chatrooms) to communicate in, as well as see and join existing channels. Once a channel is selected, users will be able to send and receive messages with one another in real time. Finally, you’ll add a personal touch to your chat application of your choosing!

Milestones

We recommend that you try to meet the following milestones:

Getting Started

Python and Flask

As with Project 1, make sure that you have a copy of Python 3.6 or higher installed on your machine. You’ll also need to install pip. If you downloaded Python from Python’s website, you likely already have pip installed (you can check by running pip in a terminal window). If you don’t have it installed, be sure to install it before moving on!

To run this Flask application:

  1. Download the project2 distribution code from https://cdn.cs50.net/web/2019/x/projects/2/project2.zip and unzip it.
  2. In a terminal window, navigate into your project2 directory.
  3. Run pip3 install -r requirements.txt in your terminal window to make sure that all of the necessary Python packages (Flask and Flask-SocketIO, for instance) are installed.
  4. Set the environment variable FLASK_APP to be application.py. On a Mac or on Linux, the command to do this is export FLASK_APP=application.py. On Windows, the command is instead set FLASK_APP=application.py.
  5. Run flask run to start up your Flask application.
  6. If you navigate to the URL provided by flask, you should see the text "Project 2: TODO"!

Requirements

Alright, it’s time to actually build your web application! Here are the requirements:

Beyond these requirements, the design, look, and feel of the website are up to you! You’re also welcome to add additional features to your website, so long as you meet the requirements laid out in the above specification!

Hints