Skip to content

CNMAT/cnmat.io

Repository files navigation

cnmat.io

WebSocket server with a React monitor UI: channels, broadcast, send to client/channel.

Quick start

# Install dependencies
yarn

# Build the React UI (output goes to deprecated/public/)
yarn build

# Run the server
yarn start

Open http://localhost:3000

CLI commands

yarn          # install dependencies
yarn build    # build React client → deprecated/public/
yarn start    # run server (node server.js)
yarn lint     # lint
yarn test     # run tests (deprecated/tests)

What’s what

  • server.js – Single file: Express serves deprecated/public/ (React build), SPA fallback, WebSocket (channels, broadcast, send) inlined.
  • client/ – Vite + React app: monitor page (connection, channels, send message, incoming messages). Builds to deprecated/public/.

The old stack (Preact, Lit, build.sh) lives in deprecated/ — see deprecated/README.md.

Deploy (AWS Elastic Beanstalk)

If you deploy on AWS Elastic Beanstalk, keep these:

  • .elasticbeanstalk/ – EB CLI config (app name, region, platform). Used when you run eb deploy or create/update environments.
  • .ebextensions/ – Config applied to the environment (ALB HTTP→HTTPS redirect, optional DynamoDB/SNS resources, Node/nginx options). Applied on deploy.

Deploy steps

  1. Build: yarn build so deprecated/public/ exists.
  2. Deploy: eb deploy (or your CI). EB runs npm install (or yarn) and should run node server.js via your Procfile or platform default.
  3. Set PORT from the environment if needed (EB sets it for Node).

Amazon Linux 2 → Amazon Linux 2023 (required by June 30, 2026)

AWS is retiring Elastic Beanstalk Amazon Linux 2 (AL2) platform branches on June 30, 2026. After that, AL2 environments will not receive security or platform updates.

What to do

  • Migrate to an Amazon Linux 2023 (AL2023) platform branch before that date.
  • In the EB console: create a new environment (or clone) and choose a Node.js 18 (or 20) on AL2023 platform, then switch traffic to it. Or follow AWS’s migration path for in-place upgrade where supported.
  • Check which environments use AL2:
    aws elasticbeanstalk describe-environments --region us-west-2 \
      --query "Environments[?PlatformArn.contains(@,'Amazon Linux 2/')]" --output text

Docs

Optional: serve old Preact UI

To serve the old Preact build instead of the React UI:

cp -r deprecated/build deprecated/public
yarn start

To use the React UI again, run yarn build.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors