Giter VIP home page Giter VIP logo

chat-app-socketio's Introduction

Chat application on Flask and Socket.io

Sample messaging app, built with Flask, Socket.io and Redis. Check it live on Heroku.

Features

  • Authorize user and keep them logged in.
  • Detect user location based on IP and/or HTML5 Geolocation services
  • Upload user avatar image, directly or through drag-and-drop component
  • Allows user to edit personal data, and update it for other users immediately
  • Allow to create and participate in public channel or send private message to the user
  • Track list of user channels and currently active conversation.
  • Components are rendered at the server and being updated at the client instantly

Built with

Frontend

  • Pug for HTML templating
  • SASS for stylesheets
  • Babel through Browserify for JS
  • Socket.io library for handling socket connections at the client
  • Twemoji library for nice emoji popover.

Backend

  • Python
  • Flask
  • Flask-Socketio
  • Redis for data storage
  • ... and few other useful modules

Getting Started

First, clone this repo: git clone https://github.com/Illustrova/Chat-App-Socketio.git

Frontend server - for HTML/CSS/UI scripts development

cd frontend
npm install
npm start

The commands above will run development server at localhost:3000.

Once you done with editing frontend, you have to run npm run build in order to build files into backend/ folder.

Note about HTML templates. Frontend development server will be running compiled src/pug/index.pug file; it contains mock data for quick frontend testing and development. However, the backend build will process all files located in src/pug/templates/. All files located in this folder, contain Jinja2 expressions instead of mock data; this way they are getting compiled directly into Jinja2 templates, which are being served by Flask. Yep, it looks pretty overcomplicated, but that's how this project is built.

Backend

Prerequisites: Redis should be installed on the machine. First run Redis in separate terminal:

redis-server

Then run flask server:

cd backend
pip3 install -r requirements.txt
python3 application.py run

There are also management commands available through command line:

Drop database completely:

python3 application.py clear_db

Create database and import starter data from config.yaml:

python3 application.py create_db

Project origins

This project was originally started for CS50 Web Programming with Python and JavaScript course, and built according course requirements, listed here. However the final app functionality was significantly expanded.

Authors

chat-app-socketio's People

Contributors

illustrova avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.