antkrit / chat

Simple chat web application

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Simple chat

Description

Chat is a simple chat website where different people can communicate with each other. Anyone can enter the chat or create it without the need to register on the site.

Installation

Prerequisites

Make sure you have installed all the following prerequisites on your development machine:

  • Python 3.6+ (with setuptools, wheel and virtualenv packages)
  • Docker
  • make utility (Windows only)

Set up project

  • Clone repository
git clone https://github.com/antkrit/chat.git
  • Move into project root folder:
cd chat
  • Create and activate virtual environment:

Linux:

virtualenv venv
source venv/bin/activate

Windows:

virtualenv venv
venv\Scripts\activate
  • Install dependencies:

Development requirements (includes production requirements)

python -m pip install -e .[dev]

Production requirements (if you are only interested in launching the application, these requirements are enough for you)

python -m pip install -e .
  • Set the following environment variables:
POSTGRES_DB=<db_name>
POSTGRES_USER=<username>
POSTGRES_PASSWORD=<password>
POSTGRES_HOST=<host or 'localhost'>
POSTGRES_PORT=<port>
  • Run database on docker:
make db-run
make db-upgrade
make db-populate # optional

Run application

Configuration

All configuration (.yaml) files are stored in config folder.

After <variable name>: use:

  • <variable value> to set variable values
  • !include <filename>.yaml if you want to include variable values from another .yaml file
  • !ENV ${ENV_NAME} if you want to read a variable from the environment

Run development server

python app.py

Web app will be available locally http://127.0.0.1:8080/.

Documentation

You can view sphinx documentation of the project with this file

Additional utilities

All configs for utilities are in setup.cfg file. All tests are stored in tests folder

  • Run tests with coverage report:
make test
  • Code analysis:
flake8 src
  • Alembic revision:
make db-revision msg="some message"

About

Simple chat web application

License:MIT License


Languages

Language:Python 72.6%Language:HTML 11.7%Language:JavaScript 6.7%Language:CSS 6.3%Language:Makefile 1.9%Language:Mako 0.8%