Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
471 changes: 471 additions & 0 deletions COMPLETE_SYSTEM_SUMMARY.md

Large diffs are not rendered by default.

305 changes: 179 additions & 126 deletions DEPLOYMENT_CHECKLIST.md
Original file line number Diff line number Diff line change
@@ -1,129 +1,182 @@
# πŸš€ TrapHouse Bot Deployment Checklist

## βœ… Pre-Deployment Steps

### 1. Discord Bot Setup
- [ ] Go to https://discord.com/developers/applications
- [ ] Create new application
- [ ] Navigate to "Bot" section
- [ ] Create bot and copy token
- [ ] Enable required intents:
- [ ] Message Content Intent
- [ ] Server Members Intent (optional)
- [ ] Guild Message Reactions

### 2. Environment Configuration
- [ ] Copy `.env.example` to `.env`
- [ ] Add your Discord bot token to `.env`
- [ ] Verify token format (should start with MTN... or similar)

### 3. Dependencies
- [ ] Run `npm install discord.js dotenv`
- [ ] Verify all files are present (run `ls *.js`)

### 4. tip.cc Setup
- [ ] Invite tip.cc bot to your Discord server
- [ ] Set up tip.cc wallet
- [ ] Test tip.cc functionality with small amounts
- [ ] Ensure tip.cc has permissions in front channels

## πŸ”§ Bot Configuration

### 5. Bot Permissions
Invite bot to server with these permissions:
- [ ] Send Messages
- [ ] Read Message History
- [ ] Add Reactions
- [ ] Mention Everyone (for @user features)
- [ ] Manage Messages (for admin commands)

### 6. Channel Setup
- [ ] Create `#tony-montanas-fronts` private channel
- [ ] Create `#showoff-your-hits` channel (50 respect points)
- [ ] Create `#busted-and-disgusted` channel (75 respect points)
- [ ] Set proper channel permissions
- [ ] Test bot access to channels

## πŸ§ͺ Testing Phase

### 7. Basic Functionality
- [ ] Run `./start.sh` or `node index.js`
- [ ] Verify bot comes online in Discord
- [ ] Test `!front help` command
- [ ] Test `!work` command for respect

### 8. Respect System
- [ ] Test `!work` command (15 points)
- [ ] Test `!respect @user` (100 points, cooldown)
- [ ] Post in #showoff-your-hits (50 points)
- [ ] Post in #busted-and-disgusted (75 points)
- [ ] Test πŸ”₯ reactions (10 points)
- [ ] Verify rank progression with `!front trust`

### 9. Fronts System
- [ ] Use `!admin_front override` to bypass Monday restriction
- [ ] Test `!front me 10` (small amount)
- [ ] Verify tip.cc integration instructions appear
- [ ] Test `!front check` and `!front trust`
- [ ] Test admin commands: `!admin_front debts`, `!admin_front confirm`

## πŸ”΄ Go-Live Steps

### 10. Production Setup
- [ ] Remove Monday override: `!admin_front restore`
- [ ] Set up monitoring/logging
- [ ] Create backup of data files
- [ ] Document admin procedures

### 11. User Onboarding
- [ ] Post rules in #tony-montanas-fronts
- [ ] Explain respect earning methods
- [ ] Share command list (`!front help`)
- [ ] Set expectations for tip.cc payments

### 12. Admin Training
- [ ] Train admins on `!admin_front confirm @user`
- [ ] Show how to check `!admin_front debts`
- [ ] Explain tip.cc verification process
- [ ] Create admin response templates

## πŸ“Š Monitoring

### 13. Daily Checks
- [ ] Monitor `!admin_front stats`
- [ ] Check `!admin_front debts` for overdue loans
- [ ] Verify tip.cc transactions match bot records
- [ ] Review respect point distribution

### 14. Weekly Reviews
- [ ] Analyze user engagement with `!hood`
- [ ] Check for any abuse patterns
- [ ] Update trust levels if needed
- [ ] Review rank progression

## πŸ†˜ Troubleshooting

### Common Issues:
- **Bot not responding**: Check token, permissions, and error logs
- **tip.cc not working**: Verify tip.cc bot permissions and setup
- **Users can't get fronts**: Check Monday restriction and rank limits
- **Data not persisting**: Verify file write permissions

### Emergency Commands:
- `!admin_front clear @user` - Manually clear debt
- `!admin_front override` - Enable testing mode
- Restart bot if needed: `./start.sh`

## πŸ“ File Backup

Important files to backup regularly:
- [ ] `loans.json` - Active loans
- [ ] `user_trust.json` - Trust levels
- [ ] `user_data.json` - Respect points
- [ ] `respect_cooldowns.json` - Cooldown tracking
# TiltCheck Deployment Checklist

## βœ… Pre-Deployment Verification

### 1. Dependencies
- [ ] Run `npm install` to ensure all dependencies are installed
- [ ] Verify `jsonwebtoken` is installed (required for OAuth)
- [ ] Check `package.json` has all required dependencies

### 2. Tests
- [ ] Run `npm test` - Basic RTP and Claims tests
- [ ] Run `npm run test:all` - Full test suite (requires dependencies)
- [ ] Run `npm run test:rtp` - RTP verification only
- [ ] Run `npm run test:claims` - Casino claims analyzer only
- [ ] Run `npm run test:mobile` - Mobile integration (requires dependencies)
- [ ] Run `npm run test:compliance` - Compliance monitoring (requires dependencies)

### 3. Build & Lint
- [ ] Run `npm run build` (currently skipped - no build required)
- [ ] Run `npm run lint` (currently skipped - no linter configured)

### 4. Environment Variables
Ensure these are set in your deployment environment:

**Required:**
- [ ] `MAGIC_SECRET_KEY` - Magic.link secret key
- [ ] `MAGIC_PUBLISHABLE_KEY` - Magic.link public key
- [ ] `SESSION_SECRET` - Session encryption secret
- [ ] `DEVELOPER_DISCORD_WEBHOOK` - Discord webhook for alerts

**Optional:**
- [ ] `DATABASE_URL` - Database connection (production)
- [ ] `REDIS_URL` - Redis connection for sessions
- [ ] `AI_ENDPOINT` - AI/LLM endpoint for claims analysis
- [ ] `AI_API_KEY` - API key for AI service

### 5. File Structure
Verify these files exist:

**Core Systems:**
- [x] `rtpVerificationAnalyzer.js`
- [x] `aiFairnessMonitor.js`
- [x] `tiltCheckOAuthFlow.js`
- [x] `mobileGameplayAnalyzer.js`
- [x] `magicCollectClockAuth.js`
- [x] `casinoComplianceMonitor.js`
- [x] `provablyFairVerifier.js`
- [x] `casinoClaimsAnalyzer.js`
- [x] `legalTermsManager.js`

**Tests:**
- [x] `test_rtp_verification.js`
- [x] `test_casino_claims_analyzer.js`
- [x] `test_mobile_integration.js`
- [x] `test_compliance_monitoring.js`

**Documentation:**
- [x] `MOBILE_APP_INTEGRATION_GUIDE.md`
- [x] `IMPLEMENTATION_COMPLETE.md`
- [x] `COMPLETE_SYSTEM_SUMMARY.md`
- [x] `DEPLOYMENT_CHECKLIST.md` (this file)

### 6. Data Directories
These directories will be created automatically on first run:
- `./data/` - Storage for compliance data, claims, evidence
- `./data/casino_evidence/` - Evidence for legal cases

### 7. Port Configuration
Default ports (ensure they're available):
- `3000` - Main application
- `3001` - OAuth handler
- `3002` - CollectClock integration

## πŸš€ Deployment Steps

### Railway Deployment

1. **Install Dependencies**
```bash
npm install
```

2. **Set Environment Variables**
- Add all required env vars in Railway dashboard
- Verify `DEVELOPER_DISCORD_WEBHOOK` is valid

3. **Start Command**
```bash
npm start
```

4. **Verify Deployment**
- Check health endpoint: `curl https://your-app.railway.app/health`
- Monitor logs for startup errors
- Verify Discord webhook receives test alert

### Local Development

1. **Install Dependencies**
```bash
npm install
```

2. **Create `.env` File**
```bash
MAGIC_SECRET_KEY=your_key_here
MAGIC_PUBLISHABLE_KEY=your_key_here
SESSION_SECRET=generate_with_crypto
DEVELOPER_DISCORD_WEBHOOK=your_webhook_url
```

3. **Run Tests**
```bash
npm run test:all
```

4. **Start Server**
```bash
npm start
```

## πŸ› Common Issues

### Issue: `Cannot find module 'jsonwebtoken'`
**Solution:** Run `npm install` to install all dependencies

### Issue: Test script fails with "crypto-test.js not found"
**Solution:** Fixed in latest commit. Use `npm run test:rtp` or `npm run test:claims`

### Issue: Mobile integration tests fail
**Solution:** Ensure dependencies are installed with `npm install`

### Issue: No Discord alerts received
**Solution:** Verify `DEVELOPER_DISCORD_WEBHOOK` environment variable is set and valid

### Issue: Data directory errors
**Solution:** Ensure write permissions for `./data/` directory. It will be created automatically.

## βœ… Post-Deployment Verification

1. **Health Check**
```bash
curl https://your-app.railway.app/health
```

2. **Test OAuth Flow**
- Visit OAuth initiation endpoint
- Verify redirect works
- Check session creation

3. **Test Compliance Alert**
- Trigger a critical RTP deviation
- Verify Discord webhook receives alert
- Check evidence is saved

4. **Monitor Logs**
- Watch for startup errors
- Verify system initialization messages
- Check for dependency warnings

---
## πŸ“Š Success Criteria

βœ… All core modules load without errors
βœ… Tests pass (at minimum: RTP and Claims tests)
βœ… Health endpoint responds
βœ… Discord webhook receives alerts
βœ… Data directories are writable
βœ… No critical errors in logs

## πŸ†˜ Support

**🎯 Ready to launch? All checkboxes completed = GO TIME!**
If deployment fails:
- Check this checklist
- Review logs for error messages
- Verify all environment variables are set
- Ensure all dependencies are installed
- Contact @jmenichole on Discord

---

*"Say hello to my little bot!"* πŸ€–πŸ”«
**Last Updated:** 2025-01-17
**Version:** 1.0.0
Loading
Loading