knottalk/
├── server.js ← Node.js backend (matchmaking + AI bot)
├── package.json ← Dependencies
├── public/
│ ├── index.html ← Main landing + chat page
│ ├── assets/
│ │ └── shared.css ← Shared styles
│ └── pages/
│ ├── about.html ← About page
│ ├── safety.html ← Safety page
│ ├── profile.html ← User profile & settings
│ ├── admin.html ← Admin dashboard
│ └── blog.html ← Blog page
└── README.md ← This file
Download from: https://nodejs.org (choose LTS version)
Verify install:
node --version # should show v18+
npm --versionOpen terminal in the knottalk folder:
npm installThis installs: express, socket.io, uuid
npm startOpen browser → http://localhost:3000
Open two tabs and chat with yourself to test matching!
Get a free Anthropic API key from: https://console.anthropic.com
Set it as an environment variable:
Mac/Linux:
export ANTHROPIC_API_KEY=your_key_here
npm startWindows:
set ANTHROPIC_API_KEY=your_key_here
npm startOn Railway (see Step 5): Add it in the Variables tab.
When enabled, users who wait more than 8 seconds with no match get connected to an AI chatbot automatically.
Railway gives you free hosting with a real URL.
- Go to https://github.com and create a free account
- Create a new repository called "knottalk"
- Upload all your files (drag & drop works)
- Go to https://railway.app
- Click "Start a New Project"
- Choose "Deploy from GitHub repo"
- Select your knottalk repo
- Railway auto-detects Node.js and deploys it
In your Railway project:
- Click "Variables"
- Add:
ANTHROPIC_API_KEY= your key - Add:
PORT= 3000 (Railway sets this automatically)
Railway gives you a URL like: https://knottalk-production.up.railway.app
That's your live website! Share it with anyone.
- Buy a domain at Namecheap (~₹800/year): https://namecheap.com
- In Railway → Settings → Custom Domain → add your domain
- In Namecheap DNS → add the CNAME record Railway gives you
- Wait 10-30 minutes → your domain points to KnotTalk!
Railway and Render both give you free HTTPS automatically. No extra steps needed — your site will be https:// by default.
- Go to https://render.com
- New → Web Service → Connect GitHub repo
- Build Command:
npm install - Start Command:
node server.js - Add environment variables in the dashboard
| Item | Cost |
|---|---|
| Railway hosting | Free (500 hrs/month) or $5/mo unlimited |
| Domain (optional) | ~₹800/year |
| Anthropic AI bot | ~$1-5/month depending on usage |
| Total to start | ₹0 — completely free |
| URL | Page |
|---|---|
/ |
Landing page + chat |
/pages/about.html |
About KnotTalk |
/pages/safety.html |
Safety center |
/pages/profile.html |
User profile |
/pages/admin.html |
Admin dashboard |
/pages/blog.html |
Blog |
/api/stats |
Live stats JSON |
Go to: yourdomain.com/pages/admin.html
// Add this to server.js before app.use(express.static(...))
app.get('/pages/admin.html', (req, res, next) => {
const pass = req.query.key;
if (pass !== 'your-secret-password') return res.status(403).send('Access denied');
next();
});Then access via: yourdomain.com/pages/admin.html?key=your-secret-password
The AI bot kicks in automatically when:
- A user waits more than 8 seconds without a match
- The user is shown as "Connected to Stranger" (bot acts like a real person)
- The bot uses Claude claude-haiku-4-5-20251001 — fast and cheap (~$0.00025/message)
To disable the bot entirely, remove the setTimeout block in server.js.
If you get stuck on any step, the most common issues are:
npm installfails → Make sure Node.js 18+ is installed- Port already in use → Change PORT in package.json scripts
- Socket.io not connecting → Make sure server is running on correct port
- AI bot not replying → Check ANTHROPIC_API_KEY is set correctly
Built with ❤️ — KnotTalk 2026