table of Contents
Luo Xun IM
A web chat system developed by Laravel + LayIM + GatewayWorker.
New change
Before we open-source project - pole Yun Fu has been reconstructed, a new version of the project structure clearer, more reasonable database design, program syntax is more concise, easy expansion and maintenance. The new version not only includes all the functions of the old version, but we also added the following new functions to keep up with the times:
- The front and back ends are completely separated . This project includes a complete API server and two newly designed clients (PC client and mobile client);
- Brand new right-click menu;
- MySQL+MongoDB dual database configuration, high-performance MongoDB is responsible for storing a large number of chat records and message records;
- Alibaba Cloud SMS;
- Alibaba Cloud OSS stores large files and pictures;
- Apply https and wss transfer protocol
Project screenshot
- Experience URL: im.luoxune.com
Project structure
- app
- Concole ------------------------------------------------- -----Contains all custom Artisan commands applied
- Http
- Controllers/Api ----------------------------------------------- -----------Handle all requests entering the application through the interface
- Middleware ------------------------------------------------- ------------- Middleware
- Requests ------------------------------------------------- ----------------Request verification class
- Resources ------------------------------------------------- --------------Interface resource class
- Providers ------------------------------------------------- ---------Service provider
- Services ------------------------------------------------- ----------Service
- Applications/LuoXun ---------------------------------------GatewayWorker configuration file directory
- config ------------------------------------------------- ---------------Laravel configuration file directory
- database
- factories ------------------------------------------------- --------- Database factory directory
- migrations ------------------------------------------------- ------- Database migration file directory
- seeds ------------------------------------------------- ------------- Data fill directory
- public
- plugins ------------------------------------------------- ------ Front-end plugin directory
- layui ------------------------------------------------- --------- Put Layui containing LayIM here
- resources
- css ------------------------------------------------- ----------- Front-end CSS directory
- js ------------------------------------------------- ------------- Front-end JS directory
- lang ------------------------------------------------- --------- Multilingual setting directory
- views
- mobile ------------------------------------------------- ------------- Mobile client
- pc ------------------------------------------------- --------------------PC client
- index.blade.php --------------------------------------------- ----- Home view
- login.blade.php --------------------------------------------- ------ Login view
- reg.blade.php --------------------------------------------- -------- Register view
- routes
-api ----------------------------------------------- ----------------- Interface routing
-web ----------------------------- ----------------------------------View routing - .env ------------------------------------------------ ------ Laravel global configuration file
Install and use
We assume that your server has been configured with Laravel project environment.
Install expansion pack
composer update
Package css/js
npm install
npm run production
Edit the configuration file, fill in XXXX
cp .env_example .env
vim .env
Put the layui containing LayIM in the /public directory
Modify the domain names in /resources/views/pc/app.blade.php and /resources/views/mobile/app.blade.php
var domain = ‘{Yourdomain}/wss’;
Configure nginx to solve wss protocol problems
#laravel 框架 nginx 配置文件中的对根目录的访问修改为以下
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location /wss {
proxy_pass localhost:5210;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection “upgrade”;
proxy_set_header Host $host;
}
Generate data encryption key
php artisan key:generate
Generate jwt token key
php artisan jwt:secret
Database migration
php artisan migrate
Populate user and group account data tables
php artisan db:seed
Online project
php artisan up
FAQ
- Why is the LayIM file not included in the project?
LayIM is protected by the national computer software copyright, and the product source files cannot be disclosed without authorization from the official website. After you get LayIM, put the layui containing LayIM in the /public directory. - Why is there no management background?
The management background directly manipulates the data table, which has nothing to do with the request processing logic in the project. Use laravel-admin to build a fully functional management backend within ten minutes. - Are there supporting documents?
The old version has supporting documents , and the new version is still under preparation.