Native prerequisites
- Running Weer natively requires Node.js, Yarn, Postgres, Redis, and PM2.
56:49 - Docker installed those automatically, but native deployment requires installing and managing them manually.
56:4957:06
Version selection
- The speaker uses official installation instructions for each technology.
57:19 - For Node.js, the tutorial uses the LTS version because LTS releases are supported for years, while current releases may be supported only for months.
57:1957:40 - NVM is used to install and switch Node versions, comparable to SDKMAN for Java.
58:1558:36 - Ubuntu
aptpackages can lag behind latest upstream major versions; this is why some installations add official repositories before installing.59:231:02:11 - The speaker emphasizes keeping server software current because known vulnerabilities in old versions are commonly exploited.
1:03:181:03:32
Postgres, Redis, and PM2
- Postgres is installed, checked with
systemctl status, and assigned a password for the defaultpostgresuser.1:03:471:04:171:04:46 - Redis is installed from official instructions rather than relying on an older default package.
1:05:221:06:06 - Redis is verified with
redis-cli, including a simpleset/gettest and version check.1:07:111:07:41 - PM2 is installed globally with npm and is used to run Node.js processes, restart them, and manage them in the background.
1:07:411:08:19 - The same Postgres and Redis installations can be reused by the other applications deployed later.
1:08:34
Build and start Weer
- After installing prerequisites, disk usage increased by only a few hundred megabytes.
1:09:13 - The production setup path is
yarn setup, thenyarn start.1:09:301:09:49 yarn setupinstalls dependencies, builds packages, creates the Weer database, creates tables, seeds data, and flushes Redis.1:09:491:11:141:11:57- The
.envfile must include the Postgres password chosen during installation.1:10:46 - Native deployment used about 5 GB after setup, compared with about 6 GB in the Docker path.
1:11:571:12:15 yarn startruns the app through PM2, andpm2 logsis needed to see runtime logs.1:12:151:12:35
Runtime behavior
- PM2 runs two server instances plus one janitor instance.
1:13:01 - Node applications need cluster mode to better use available CPU cores because requests are initially handled through a single-threaded model.
1:13:171:13:33 - Java and Rust applications usually do not follow this Node cluster pattern because their runtimes/frameworks handle threading differently.
1:13:17
Inspecting Redis and Postgres
- Redis Insight can connect to the server's Redis through an SSH tunnel.
1:13:541:14:19 - Visiting a shortened link creates a view record in the Redis stream with fields such as user agent, link type, and QR-code indicator.
1:17:301:17:50 - The janitor drains the Redis stream and inserts views into Postgres in batches, then acknowledges the processed stream entries.
1:18:141:18:301:18:56 - The stream max length is configured as 100,000, allowing Redis to truncate when it reaches that size.
1:18:56 - Postgres can be inspected from the command line or with pgAdmin through an SSH tunnel.
1:19:221:20:13