Giter Site home page Giter Site logo

tanhongit / php_realtime_chat_app Goto Github PK

View Code? Open in Web Editor NEW
13.0 1.0 4.0 3.31 MB

Create a Chat Application using PHP MVC model with MySQL & JavaScript

License: MIT License

PHP 63.54% JavaScript 19.81% CSS 14.02% Hack 2.64%
php-mvc chat-application chat-realtime chatapp mysql php php-chat-app realtime tanhongit tanhongit-mvc

php_realtime_chat_app's Introduction

Welcome to PHP Realtime Chat App MVC Model by TanHongIT

Create a Chat Application using PHP MVC model with MySQL & JavaScript.

This source structure is cloned from project: yl-mvc-structure

1. Configuration requirements

- Version PHP 7.2 and above
- OpenSSL PHP Extension

2. Technology

  • Pure PHP language
  • Using MVC model
  • Javascript

3. Setup assets folder

This Project is using webpack in order to compile Javascript modules and compile Sass/SCSS files to css. Run the following commands in the project's asset directory:

Run:

cd public/frontend/assets
npm install
npm run build

4. Download Database

This is the path to the database file for you to download: /database/***.sql

Create a new database on PHPMyAdmin at your server (or any other database connection tool), then import the .sql file that you just downloaded.

5. Edit Connect Database

You need to change the connection information to the database after you have cloned my repository so that the website can work.

Path: /config/database.php

This is the path to the database file for you to download: /database/***.sql

define('DB_HOST', 'localhost');
define('DB_USER', 'root');
define('DB_PASS', 'root');
define('DB_NAME', 'chatapp-php');

And then run to import database

 mysql -u root -p chatapp-php < YOUR-PATH/PHP_Realtime_Chat_App/database/chatapp-php.sql 

Please change YOUR-PATH to your project's path.

6. Install and using ssl certificate

Using mkcert to create ssl certificate

For Ubuntu

sudo apt install libnss3-tools

sudo wget https://github.com/FiloSottile/mkcert/releases/download/v1.4.3/mkcert-v1.4.3-linux-amd64 && \
sudo mv mkcert-v1.4.3-linux-amd64 mkcert && \
sudo chmod +x mkcert && \
sudo cp mkcert /usr/local/bin/

Now that the mkcert utility is installed, run the command below to generate and install your local CA:

mkcert -install

Create ssl certificate for this project

Run:

cd /var/www/certs
mkcert local.php_realtime_chat_app.com

And then change local.PHP_Realtime_Chat_App.com.conf file (/apache2/sites-available/ to this)

<VirtualHost *:80>
	ServerAdmin localserver@localhost
	ServerName local.PHP_Realtime_Chat_App.com
	ServerAlias www.PHP_Realtime_Chat_App.vdx.com
	DocumentRoot /var/www/PHP_Realtime_Chat_App
	ErrorLog /var/www/logs/error-PHP_Realtime_Chat_App.log
    CustomLog /var/www/logs/access-PHP_Realtime_Chat_App.log combined
</VirtualHost>

<VirtualHost *:443>
    ServerAdmin localserver@localhost
    ServerName local.PHP_Realtime_Chat_App.com
    ServerAlias www.local.PHP_Realtime_Chat_App.com
    DocumentRoot /var/www/PHP_Realtime_Chat_App

    ErrorLog /var/www/logs/error-PHP_Realtime_Chat_App.log
    CustomLog /var/www/logs/access-PHP_Realtime_Chat_App.log combined

    SSLEngine on
	SSLCertificateFile /var/www/certs/local.PHP_Realtime_Chat_App.com.pem
	SSLCertificateKeyFile /var/www/certs/local.PHP_Realtime_Chat_App.com-key.pem

    <Directory /var/www/PHP_Realtime_Chat_App>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

7. Demo

license

Demo account:

Email: [email protected]
Pass: 123456

license

php_realtime_chat_app's People

Contributors

dependabot[bot] avatar tanhongit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.