Skip to content

Latest commit

 

History

History
250 lines (192 loc) · 5.77 KB

File metadata and controls

250 lines (192 loc) · 5.77 KB

Revertly AI - Quick Setup (5 Minutes)

Option 1: Hardcoded Credentials (Easiest for Demo)

Step 1: Get Your Confluence API Token

  1. Go to https://id.atlassian.com/manage-profile/security/api-tokens
  2. Click "Create API token"
  3. Name it "Revertly Demo"
  4. Copy the token (you won't see it again!)

Step 2: Add Credentials to Code

  1. Open mcp/main.py
  2. Find lines 27-28 (near the top):
    DEMO_CONFLUENCE_EMAIL = "siddharth@altorlab.com"  # ← Change this to your email
    DEMO_CONFLUENCE_TOKEN = ""  # ← Paste your API token here
  3. Replace with your email and token:
    DEMO_CONFLUENCE_EMAIL = "your-email@altorlab.com"
    DEMO_CONFLUENCE_TOKEN = "ATATT3xFfGF0..."  # Your actual token
  4. Save the file

Step 3: Start Backend

cd mcp
uvicorn main:app --reload

You should see:

============================================================
🚀 Revertly MCP Server Starting...
============================================================
📝 Using HARDCODED credentials from mcp/main.py
   Email: your-email@altorlab.com
   Token: ATAT...6ab
============================================================

✅ Database initialized at .../mcp/revertly.db
🔄 Fetching current state of page 622593...
   Using email: your-email@altorlab.com
   API token: **********6ab
✅ Page cache initialized: AI Agentic future (v12)

Step 4: Start Frontend

# In a new terminal
cd web
npm start

Step 5: Start ngrok (for webhooks)

# In a new terminal
ngrok http 8000

Copy the HTTPS URL (e.g., https://abc123.ngrok.io)

Step 6: Configure Confluence Webhook

  1. Go to https://altorlab.atlassian.net/wiki/settings/webhooks
  2. Click "Create a new webhook"
  3. Configure:
    • Name: Revertly Tracker
    • URL: https://your-ngrok-url.ngrok.io/webhook/confluence
    • Events: Page → Updated
    • Status: Enabled
  4. Save

Step 7: Test!

  1. Open http://localhost:3000
  2. Edit the Confluence page: https://altorlab.atlassian.net/wiki/spaces/~712020a2d43ea4d5ac4f889a17ed23f13fb6ab/pages/622593/AI+Agentic+future
  3. See the change appear in the dashboard
  4. Click "Revert" to undo it

Option 2: Environment Variables (More Secure)

Step 1: Set Environment Variables

export CONFLUENCE_USER_EMAIL="your-email@altorlab.com"
export CONFLUENCE_API_TOKEN="your-token-here"

Step 2: Verify

echo $CONFLUENCE_USER_EMAIL
echo $CONFLUENCE_API_TOKEN

Step 3: Start Backend

cd mcp
uvicorn main:app --reload

You should see:

============================================================
🚀 Revertly MCP Server Starting...
============================================================
📝 Using ENVIRONMENT VARIABLE credentials
   Email: your-email@altorlab.com
   Token: ATAT...6ab
============================================================

Step 4-7: Same as Option 1


Option 3: Use Helper Scripts (Recommended)

Quick Start

# Make scripts executable
chmod +x *.sh

# Set up credentials (interactive)
source ./setup_env.sh

# Start everything
./start_demo.sh

# In another terminal, start webhook tunnel
./start_webhook.sh

# Check if everything is working
./diagnose.sh

Troubleshooting

❌ 401 Unauthorized Error

Problem: Backend shows 401 Client Error: Unauthorized

Solution:

  1. Check your credentials in mcp/main.py (lines 27-28)
  2. Make sure your API token is correct
  3. Test manually:
    curl -u "your-email@altorlab.com:your-token" \
      "https://altorlab.atlassian.net/wiki/api/v2/pages/622593"

❌ No Agents Showing in Dashboard

Problem: Dashboard loads but "AI Agents" section is empty

Solution:

  1. Check backend is running: curl http://127.0.0.1:8000/api/agents
  2. Check browser console (F12) for errors
  3. Refresh the page

❌ Webhook Not Firing

Problem: Edit Confluence page but nothing happens

Solution:

  1. Check ngrok is running: curl http://localhost:4040/api/tunnels
  2. Check webhook is configured in Confluence
  3. Check you're editing the correct page (ID: 622593)
  4. Check backend logs for webhook events

❌ Port Already in Use

Problem: Address already in use error

Solution:

# Find what's using port 8000
lsof -i :8000

# Kill it
kill -9 <PID>

# Or use a different port
uvicorn main:app --reload --port 8001

Quick Reference

URLs

Commands

# Start backend
cd mcp && uvicorn main:app --reload

# Start frontend
cd web && npm start

# Start ngrok
ngrok http 8000

# Test backend
curl http://127.0.0.1:8000/

# Test agents endpoint
curl http://127.0.0.1:8000/api/agents

# Test changes endpoint
curl http://127.0.0.1:8000/api/changes

# Reset database
curl -X POST http://127.0.0.1:8000/api/reset

# View database
sqlite3 mcp/revertly.db "SELECT * FROM changes;"

Files to Edit

  • Credentials: mcp/main.py (lines 27-28)
  • Target Page ID: mcp/main.py (search for TARGET_PAGE_ID)
  • Agent Name: mcp/main.py (search for agent_name)

Next Steps

  1. ✅ Get credentials working
  2. ✅ Start backend and frontend
  3. ✅ Configure webhook
  4. ✅ Test the demo flow
  5. 📖 Read NEW_DEMO_GUIDE.md for presentation script
  6. 🎯 Practice the 3-minute demo

Getting Help

  • Diagnostics: Run ./diagnose.sh
  • Troubleshooting: See TROUBLESHOOTING.md
  • Demo Script: See NEW_DEMO_GUIDE.md
  • Quick Reference: See DEMO_QUICK_START.md

You're ready to demo! 🚀