DTP Base provides a scalable and secure Node.js application development harness ready for production service.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

2.3 KiB

DTP Chat

A no-nonsense/no-frills communications platform.

System Requirements

Make sure you've got the latest/greatest for your Ubuntu.

apt -y update && apt -y upgrade
apt -y install python3-pip build-essential ffmpeg supervisor

The Linux headers and image installs are optional. If you not using a GPU for video encoding, you won't need kernel sources to build your GPU's driver.

apt -y install linux-headers-generic linux-headers-virtual linux-image-virtual linux-virtual

The latest pnpm instructions can always be found here: pnpm installation

These are just convenience copies from that page.

corepack enable pnpm
corepack use pnpm@latest
pnpm install

Development Host Management

For convenience, it's possible to open multiple terminals in VS Code using Ctrl + Shift + ~

In one terminal, start the workers and MinIO.

./start-local

In a separate terminal, starts the dev application environment.

pnpm dev

Production Host Configuration

Configure the firewall:

ufw allow ssh
ufw allow http
ufw allow https
ufw allow from [console_ip] proto tcp to [host_ip] port 8190
ufw enable

Create the DTP admin user on the host. All production hosts require this user. Do not set a login password for this user. We will be creating SSH keys for the user to access your git repo as a deployer, but you will never log into the host using the DTP user account.

Instead, we always log in as root, and use su - dtp to become the DTP user.

adduser dtp   # just accept the defaults or enter whatever you want
su - dtp      # this will put you in the DTP home directory as the DTP user
ssh-keygen    # generate the user's SSH key to use for git deployments

# print the DTP user's SSH public key to provide to git repo as deploy key
cat ~/.ssh/id_rsa.pub

Add that SSH key to your git repo as a deploy key.

In the DTP user's home directory:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash

npm install --lts

Edit .bashrc and set NODE_ENV=production

Emoji Picker

Chat currently uses emoji-picker-element as the renderer of an emoji picker, and then it manages the presentation of the picker itself.