Skip to content

RealOgg/knottalk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 KnotTalk — Deployment Guide

What's Inside This Zip

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

Step 1 — Install Node.js

Download from: https://nodejs.org (choose LTS version)

Verify install:

node --version   # should show v18+
npm --version

Step 2 — Install Dependencies

Open terminal in the knottalk folder:

npm install

This installs: express, socket.io, uuid


Step 3 — Test Locally

npm start

Open browser → http://localhost:3000

Open two tabs and chat with yourself to test matching!


Step 4 — Enable AI Bot (Optional but Recommended)

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 start

Windows:

set ANTHROPIC_API_KEY=your_key_here
npm start

On 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.


Step 5 — Deploy to Railway (FREE hosting)

Railway gives you free hosting with a real URL.

A) Push to GitHub first

  1. Go to https://github.com and create a free account
  2. Create a new repository called "knottalk"
  3. Upload all your files (drag & drop works)

B) Deploy on Railway

  1. Go to https://railway.app
  2. Click "Start a New Project"
  3. Choose "Deploy from GitHub repo"
  4. Select your knottalk repo
  5. Railway auto-detects Node.js and deploys it

C) Add environment variables on Railway

In your Railway project:

  • Click "Variables"
  • Add: ANTHROPIC_API_KEY = your key
  • Add: PORT = 3000 (Railway sets this automatically)

D) Get your live URL

Railway gives you a URL like: https://knottalk-production.up.railway.app

That's your live website! Share it with anyone.


Step 6 — Connect Your Domain (Optional)

  1. Buy a domain at Namecheap (~₹800/year): https://namecheap.com
  2. In Railway → Settings → Custom Domain → add your domain
  3. In Namecheap DNS → add the CNAME record Railway gives you
  4. Wait 10-30 minutes → your domain points to KnotTalk!

Step 7 — Enable HTTPS (Free)

Railway and Render both give you free HTTPS automatically. No extra steps needed — your site will be https:// by default.


Alternative: Deploy to Render (also free)

  1. Go to https://render.com
  2. New → Web Service → Connect GitHub repo
  3. Build Command: npm install
  4. Start Command: node server.js
  5. Add environment variables in the dashboard

Monthly Costs

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

Pages Reference

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

Admin Dashboard

Go to: yourdomain.com/pages/admin.html

⚠️ Important: In production, add password protection to the admin page. Anyone with the URL can access it right now. Use a simple middleware:

// 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


AI Bot Setup Details

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.


Need Help?

If you get stuck on any step, the most common issues are:

  1. npm install fails → Make sure Node.js 18+ is installed
  2. Port already in use → Change PORT in package.json scripts
  3. Socket.io not connecting → Make sure server is running on correct port
  4. AI bot not replying → Check ANTHROPIC_API_KEY is set correctly

Built with ❤️ — KnotTalk 2026

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors