Documentation Index
Fetch the complete documentation index at: https://mintlify.com/danielitoCode/AlejoTaller/llms.txt
Use this file to discover all available pages before exploring further.
alejo_publisher is a standard Node.js/Express application. It compiles to plain JavaScript via tsc and runs with node. Any host that can run a Node.js process — Render, Railway, Fly.io, a plain VPS — will work. This guide covers local development first, then a Render deployment.
Local Development
Navigate to the service directory
All commands in this guide run from inside the
alejo_publisher package directory.Copy the environment file
The repository ships an
.env.example with placeholder values. Copy it to create your local .env:Fill in your credentials
Open
.env and replace the placeholder values with your actual Pusher app credentials and a chosen API key:You can find your Pusher credentials in the App Keys section of the Pusher dashboard after creating or opening an app.
Start the development server
The You should see:
dev script uses tsx watch, which compiles TypeScript on the fly and restarts on file changes — no separate build step needed.Deploy to Render
Connect your GitHub repository to Render
Log in to render.com, go to New → Web Service, and connect the GitHub account that hosts the
AlejoTaller monorepo. Authorize Render to access the repository.Set the Root Directory
Under Root Directory, enter:Render will treat this subdirectory as the project root, so
package.json is resolved correctly.Set the Build Command
npm run build runs tsc -p tsconfig.json, which compiles TypeScript sources into the dist/ folder.Add environment variables
In the Environment section, add the following key-value pairs. All variables are required except
PORT and ALLOW_ORIGIN, which have defaults.| Variable | Example value |
|---|---|
PORT | 3000 |
PUBLISHER_API_KEY | (your secret key) |
PUSHER_APP_ID | (from Pusher dashboard) |
PUSHER_KEY | (from Pusher dashboard) |
PUSHER_SECRET | (from Pusher dashboard) |
PUSHER_CLUSTER | mt1 |
ALLOW_ORIGIN | https://your-operator-app.example.com |
Configure Render’s Health Check Path to
/health. Render will poll this path and automatically restart the instance if it stops responding, giving you zero-downtime recovery from crashes.Environment Variables Reference
ThereadEnv() function in server.ts reads all variables at startup. Missing required variables throw immediately, so a misconfigured deploy fails fast during boot rather than at runtime.
| Variable | Required | Default | Description |
|---|---|---|---|
PORT | No | 3000 | TCP port the Express server listens on. Render injects its own PORT automatically. |
PUBLISHER_API_KEY | Yes | — | Bearer token that the operator app must send. Requests with a wrong or missing token receive 401. |
PUSHER_APP_ID | Yes | — | Pusher application ID, found in the Pusher dashboard under App Keys. |
PUSHER_KEY | Yes | — | Pusher public key. Also used by client SDKs to subscribe to channels. |
PUSHER_SECRET | Yes | — | Pusher secret key used to sign server-side trigger requests. Never expose this to clients. |
PUSHER_CLUSTER | Yes | — | Pusher cluster region (e.g. mt1, eu, ap2). Must match the cluster chosen when the Pusher app was created. |
ALLOW_ORIGIN | No | * | CORS allowed origins. A single * permits all origins. For multiple specific origins, provide a comma-separated list: https://app.example.com,https://admin.example.com. |
Scripts Reference
These scripts are defined inpackage.json and can be run from the function/alejo_publisher directory:
| Script | Command | Use |
|---|---|---|
npm run dev | tsx watch src/presentation/http/server.ts | Local development with hot reload |
npm run build | tsc -p tsconfig.json | Compile TypeScript to dist/ |
npm run start | node dist/presentation/http/server.js | Run the compiled build (production) |
npm run check | tsc -p tsconfig.json --noEmit | Type-check without emitting files |