In 2019 I have created this small chat application to:
- check out websockets and some js stuff
- try making something useful and working in a short time (hackathon style)
- have a place for a small team to talk about project ideas
It took me approximately 24,5h as stated in the commit messages. I was developing in 30 minute intervals.
I have just found this project still working on an old hosting and moved it here for preservation.
- session based password protected auth
- login/password changing in app
- creating channels/topics
- sending messages in different channels (live communication)
- unread message count indicator in each topic
- uploading files
- browsing files in different tab (sorting by type)
- rwd
(this can be incomplete or incorrect due to me not remembering everything correct)
- PHP 7.2+
- CodeIgniter3
- HashIds
- workerman/phpsocket.io
- MySQL
- KnockoutJS
- Bootstrap
- jQuery
- socket.io
- require.js
- Create a MySQL database and import the
db.sql
file. - Insert user into
users
table by hand (passwords are hashed withbcrypt
, you can useusers.type
ADMIN
but I don't remember if its any different from the defaultMEMBER
) - Move this code into your webserver root.
- Run
composer install
- In the
app/config
dir copy:config.sample.php
toconfig.php
and fill out thebase_url
vardatabase.sample.php
todatabase.php
and fill out the database connection infosocket.sample.php
tosocket.php
and fill out theaddress
andport
var
- Configure your server with the domain and port from the socket config.
- Run the php websocket server with
php server/chat.php
.
Configuring the websocket server (points 6. and 7.) might need a bit more work than described. If by any chance you need help post an issue and I'll try helping ;)
- my code: WTFPL
- the rest: as stated in the respected packages/libs