Bobchat is a social media network for University of California, Merced students.
To run this code:
-
Clone the repository::
git clone https://github.com/tsainez/bobchat.git cd bobchat
-
Create and activate a virtual environment::
python3 -m venv venv . venv/bin/activate
-
Install Bobchat::
pip install -e .
This installs Bobchat as a Python package as well as all the dependencies needed.
-
Run the application::
-
Initialize the database:
flask init-db
-
Run the application:
In production, run using Gunicorn:
gunicorn "bobchat:create_app()"
Alternatively, to run in development mode using Werkzeug:
export FLASK_ENV=development flask run
Do not use
flask run
in production.
-
-
View the Application::
Navigate to
localhost:5000
or127.0.0.1:5000
in a browser.
- Python 3.9 or higher
- Sqlite 3.36.0 or higher
Some trouble we ran into on macOS BigSur: after running brew upgrade sqlite
brew installed sqlite3 to /usr/local/cellar/sqlite/3.36.0/bin/sqlite3
. You can either add this to the beginning of $PATH or move the brew installed sqlite3 file to /usr/local/bin
.
If your database is not as expected, try running flask init-db
to reset the database to it's factory default (with sample data inserted).
This project was made to satisfy the final project requirements in the CSE 106 (Exploratory Computing) and CSE 111 (Database Systems).
Want to make an application like this? Here's some useful resources:
- This tutorial from the Flask official documentation was a great starting point for our project and for learning how to use Flask.
- Knowing what Patterns for Flask are available is useful figuring out how you want to use Flask and organize your project before you begin...
- The sqlite3 API documentation was immensely helpful for figuring out exactly how to create, use and manage a database using Python's built-in sqlite3 package.