Code Monkey home page Code Monkey logo

sociochat's Introduction

SocioChat

This is source code of SocioChat. The code is a bit rough in some places, lacking of tests, but pretty readable and managable.

SocioChat is licensed under the Apache Licence, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.html).

The story

In the beginning of 2014 I was reading an article about ReactPHP and Ratchet. It looked really attractive and promising stack. At the same time I stumbled upon a yet another chat roulette. It was utilizing socionic theory about 16 types of information metabolizm (very close to MBTI) but appeared very buggy. It had all signs of poor code quality even without source code exposed. So if I decided to join that project it would result a complete rewrite. That's why SocioChat appeared as an alternative.

At first it had closed source code but one day I realized that it's really stupid to hide this work. Because maybe one day I'll exit the project and it will die without any useful contribution to society. So now thanks to that decision and GitHub, of course, you have an opportunity to learn something new and even influence to make the project better.

Features

  • Very fast and full async websocket handling
  • Adaptive markup via Twitter Bootstrap 3
  • UI optimized to use with mobile devices
  • HTML5 Notifications
  • Silex framework (for typical web request handling)
  • Partial multilanguage
  • The concept "chat first - register later"
  • Private chatting and personal banning
  • Seamless reconnect on interruption of connection
  • Flood protection
  • Avatars
  • Music player
  • Rude filter
  • Message history dumps to memcache

Installation

  • At least PHP 5.5
  • MySQL or PostgreSQL. Use phinx utility to apply migrations.
  • Memcache
  • Give write permissions to www/uploads/avatars
  • PECL extension 'libevent' is recommended to achieve the best speed
sudo apt-get install libevent-dev
sudo pecl install libevent

Don't forget to enable this extension in php-cli

  • Get composer and do in project root
$ php composer.phar update

to get all necessary libraries

  • Configure web server (nginx/apache) for project host and edit conf/local.ini. This file overrides settings from default.ini. For example
db.name = chat
db.pass = 111
db.user = chat
db.scheme = pgsql
db.host = localhost

session.lifetime = 3600
session.timeout = 10
floodTimeout = 1
inviteTimeout = 10

logger =

domain.web = chat
domain.ws = ws://chat:8080
domain.protocol = http://

metrika = 0
  • Run from project root with command for development purpose
php bin/chat-server.php

To start in daemon mode use

nohup php bin/chat-server.php &

See also nginx.conf

sociochat's People

Contributors

kryoz avatar f3ath 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.