Chatify is an online messaging web app made using Flask and Socket.IO wherein you can create friends and chat with them live!
Short Video Demo: https://youtu.be/2klEwbfnoTY
-
Customizing Profile
- Profile Photo
- Name
- About Me
-
Friend Requests
- Send Requests
- Accept / Reject Requests
-
Messaging
- Chat with friends in real-time
- Optional profanity filter for incoming messages
- Flask
- SQLAlchemy + PyMySQL
- AWS-S3
- Flask-SocketIO
git clone https://github.com/ppl-call-me-tima/chatify.git
cd chatifypy -3 -m venv .venv
.venv/Scripts/activate
pip install -r requirements.txtThe default method used for connection is using a cloud MySQL connection provider - TiDB. But to configure for a local MySQL connection, one must alter the connection string required for an SQLAlchemy + PyMySQL connection. The connection string is of the form:
connection_string = f"mysql+pymysql://{username}:{password}@{host}/{dbname}?{option}"-
Using Local MySQL Connection:
A suitable version of the connection string variables are already initialized in the commented form inside
database.py. -
Using TiDB Cloud MySQL Connection:
Visit the TiDB dashboard. Inside the configure options for the
Connecting to Clustermenu, select the following:- Connect With: SQLAlchemy
- Instead of
mysqlclientselectPyMySQL
You can now obtain the Connection String provided which requires the user to replace two parameters:
- PASSWORD - Which can be obtained by clicking on the Generate Password button in the same page (one-time view only).
- CA_PATH - The path of the CA Certificate which can be downloaded using the link visible in the same page.
Please re-configure the CA_PATH variable inside
database.pycorrectly as it may be different for you.
-
App Key: Generate a random secret app key that is required for Flask Sessions.
python -c 'import secrets; print(secrets.token_hex())' -
AWS Variables:
- AWS Bucket Name: The AWS-S3 Bucket used for storing profile photos has been named here and accessed universally throughout the code.
- AWS Access Key ID: (Standard S3 Credential)
- AWS Secret Access Key: (Standard S3 Credential)
-
Database Connection Password: Database connection password can be:
- set by the user in case of using a local MySQL connection
- provided by the cloud MySQL connection provider (see Setting Up the Database Connection - Using TiDB)
Download the CA Certificate from the Connecting to Cluster menu of the TiDB dashboard and add its path as the required parameter inside the connection string as mention in Setting Up the Database Connection with TiDB.
