# DTP Base A production-ready Node.js application development framework for use in-house at DTP Technologies, LLC. ## System Requirements Make sure you've got the latest/greatest for your Ubuntu. ```sh 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. ```sh 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](https://pnpm.io/installation) These are just convenience copies from that page. ```sh corepack enable pnpm corepack use pnpm@latest ``` ```sh 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. ```sh ./start-local ``` In a separate terminal, starts the dev application environment. ```sh pnpm dev ``` ## Production Host Configuration Configure the firewall: ```sh 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. ```sh 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: ```sh 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 Base currently uses [emoji-picker-element](https://www.npmjs.com/package/emoji-picker-element) as the renderer of an emoji picker, and then it manages the presentation of the picker itself.