Open Source IM System Tinode Deployment Tutorial|WSL Environment
Introduction
Our requirement is to deploy an IM system locally, choose tinode. In order to facilitate the startup of the backend, we use the WSL environment and install the database with docker to start the IM application.
Solution
WSL starts front-end and back-end services
cmd input
WSL --updateto ensure that WSL is relatively newEnter WSL with cmd, make sure docker is installed,
docker ps -ato see if it starts.if prompted
wsl Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?Need to start docker:
sudo service docker startdocker install mysql
docker run --network="host" --name im-mysql -e MYSQL_ROOT_PASSWORD=123456 -d mysql:latestDownload
https://github.com/tinode/chat/releases/linux packagePut it in the WSL directory and unzip it
Execute
./init-db -data=data.jsonExecute
./tinodeIf you want to start on the server, use
nohup ./tinode >im.out 2>&1 &Check whether the startup is successful
ps aux|grep tinodeOpen
http://localhost:6060/Login test, user name
bobpasswordbob123, useralicepasswordalice123
The local deployment has been completed. If you want to modify the front-end code, the front-end needs to pull it from another repository
Front-end development
First make sure that the back-end has started normally, and then look at the front-end part alone
WSL ensures that git is installed, and extracts the front-end code from an empty directory
git clone https://github.com/tinode/webapp.gitWSL ensures that nodejs is installed (refer to nodejs-on-wsl ), installation dependencies
cd webapp npm iPackage after modifying the code His project does not have a development mode, and it can only be repackaged after each modification
npm run buildOpen
index-dev.htmlwith the VSCODE Live Server plugin But you need to change127.0.0.1tolocalhosthttp://localhost:8080/index-dev.html`Every time you open it, it is best to clear the browser cache and refresh
How to clear the browser cache: Open the browser console, right-click the refresh button on the left side of the address bar, click
Empty cache and hard refreshLogin test

Comments