Skip to content

CodeSageAnsh/wh_bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WhatsApp Production Data Bot

WhatsApp bot for SHJM Mill production data collection.

🚀 Deploy to Railway

Step 1 — Push to GitHub

git init
git add .
git commit -m "initial commit"
git branch -M main
git remote add origin https://github.com/YOUR_USERNAME/YOUR_REPO.git
git push -u origin main

Step 2 — Deploy on Railway

  1. Go to railway.appNew ProjectDeploy from GitHub repo
  2. Pick your repo
  3. Railway will detect the Dockerfile and build automatically (Node 20 + Chromium + all libs come baked in)

Step 3 — Add a Volume (so QR survives redeploys)

  1. Service → SettingsVolumes+ New Volume
  2. Mount path: /app/.wwebjs_auth
  3. Save

Step 4 — Scan QR

  1. Open Deployments → latest deployment → View Logs
  2. A QR code appears in the logs
  3. WhatsApp on phone → Settings → Linked Devices → Link a Device → scan it

✅ Done. Send "Hi" to your number to test.


⚠️ Why a Dockerfile?

The previous nixpacks.toml approach failed because Railway's Nixpacks builder didn't apply the apt packages reliably, so Chromium couldn't find libglib-2.0.so.0.

The Dockerfile includes every shared library Chromium needs and forces Puppeteer to use the system Chromium at /usr/bin/chromium instead of downloading its own. This is the standard, reliable way to run whatsapp-web.js on Railway.


🛠️ Run Locally

npm install
npm start

A QR code will print in your terminal.


📁 Files

.
├── Dockerfile         # Build instructions (Node 20 + Chromium + libs)
├── railway.json       # Tells Railway to use the Dockerfile
├── .dockerignore      # Keeps image small
├── index.js           # Bot logic
├── menus.js           # Department + OCR menus
├── package.json       # Dependencies
├── .gitignore
└── README.md

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors