Skip to content

Flask chatting web-aplications where users can create own channels

Notifications You must be signed in to change notification settings

dzionek/channels

Repository files navigation

Build Status codecov

Channels

Flask web-application where you can create own channels, manage them, and chat with your friends/colleagues. Created with Python, TypeScript, SCSS, Bootstrap, Socket.io, Handlebars templates, and love. Bundled with Webpack. Containerized with Docker.

Inspired by the Project 2 of Harvard's CS50’s Web Programming with Python and JavaScript.

Usage

1) Preferable way – with Docker

Install Docker, build the container, and run it.

docker-compose up -d --build

Your website should be available at localhost:5000.

2) Without Docker

  • If you don't want to use Docker, change the directory to web.

    cd web
  • Optional: If you wish to separate these python packages from your global ones, create a virtual environment with pip.

    python -m pip install --upgrade pip
    pip install virutalenv
    virtualenv venv
    source venv/bin/activate  # for Linux/MacOS, on Windows do instead: venv\Scripts\activate
  • Use Python package manager pip and Node.JS package manager npm to install the requirements.

    python -m pip install --upgrade pip
    pip install -r requirements.txt
    npm install --save
    npm run build
  • Create PostgreSQL database. Then, create environmental variables DATABASE_URI with the address of that database. Also, set environmental variable SECRET_KEY used for administering the app.

    • Linux/MacOS:

      export DATABASE_URI=postgres://{USER}:{PASSWORD}@{HOSTNAME}:{PORT}/{DB NAME}
      export SECRET_KEY={YOUR SECRET KEY}
    • Windows:

      set DATABASE_URI=postgres://{USER}:{PASSWORD}@{HOSTNAME}:{PORT}/{DB NAME}
      set SECRET_KEY={YOUR SECRET KEY}
  • Create the necessary databases.

    flask create-db
  • Run the app. Your application should be at localhost:5000.

    python run.py

TODO:

Login and Registration

  • Better main page
  • Registration view
  • Sending email and confirming
  • Forget password

Functionality

  • Channels should have passwords
    • Join a channel modal
    • Add password to channel model
    • Leave a channel
  • Add REST API

Design

  • Black mode

Learn and Use

  • Docker container
  • More unit tests
  • Add Travis CI
  • Add CodeCov
  • Deploy to AWS/Heroku