Skip to content

An online messaging service using Flask, similar in spirit to Slack.

Notifications You must be signed in to change notification settings

Mohitkumar6122/Flack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

91 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flack

A Slack like online messaging service

python badge hrml5 badge css badge SocketIO flask badge SQLAlchemy Heroku

Summary

Flack is a messaging platform like Slack that allows users to message in real time. Current features includes registering an account, adding or removing message channels, adding or removing users to channels and sending messages in desired channels. For messaging, Flask-SocketIo library is used.

Files Structure

Flack
├── config.py
├── flack
│   ├── application.py
│   ├── forms.py
│   ├── __init__.py
│   ├── models.py
│   ├── static
│   │   ├── images
│   │   │   ├── demo.gif
│   │   │   ├── favicon-people-arrows.ico
│   │   │   └── man-silhouette-profile-7.png
│   │   ├── scripts
│   │   │   ├── chat.js
│   │   │   ├── lib.js
│   │   │   └── socket.js
│   │   └── styles
│   │       ├── chat.css
│   │       └── layout.css
│   └── templates
│       ├── chat.html
│       ├── helper.html
│       ├── index.html
│       ├── layout.html
│       ├── login.html
│       └── temp.html
├── Procfile
├── README.md
└── requirements.txt

File descriptions

  • /flack: the main app module
  • application.py: the main application file containing the logic for registering, login, logout, and other API calls such as adding/removing channels.
  • forms.py: contains the classes for registration form and login in form which uses the Flask-WTForms library.
  • models.py: Uses Flask SQLAlchemy to abstract away the database tables and there relationships. Models include User, Channel, and Message.
  • /templates: contains all the HTML files to render different views.
  • /script: contains all the JavaScript files to run the client side code.
  • /styles: contains all the CSS files for styling.
  • requirements.txt: contains all the Python packages installed for this project and also this file is required for Heroku.
  • Procfile: a file required for heroku.

Tech Stacks

  • Frontend - JavaScript, HTML5, CSS3
  • Backend - Python Flask
  • Database - MySQL, SQL

Usage

Running the app:

Use this link to run the live app directly

Cloning and editing

  • After cloning, replace the secret key (i.e modify the line SECRET_KEY = os.environ.get('SECRET_KEY')) and the Database URL (i.e the line SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL')) in config.py with your own values.

Running Project

First of all you have to prepare your virtual environment. Select a location where you want to store the files and follow the following steps.

    mkdir Projects
    cd Projects
    git clone https://github.com/Mohitkumar6122/Flack.git
    python3 -m venv virtenv
    source venv/bin/activate
    pip install -r requirements.txt
    python applications.py

It will create a Projects Folder which will contain all files of project. Then after running applications.py. A chrome window will open which contains a interacive window where app will be running.