9.4 KiB
Burmddit - Complete Deployment Guide
From Zero to Production in 30 Minutes
Target URL: burmddit.vercel.app
Cost: $0-$60/month (mostly Claude API)
📋 PRE-REQUISITES
Accounts Needed (All Free to Start):
- ✅ GitHub - github.com (code hosting)
- ✅ Vercel - vercel.com (frontend hosting)
- ✅ Railway - railway.app (backend + database)
- ✅ Anthropic - console.anthropic.com (Claude API for translation)
Time to create accounts: ~10 minutes
🚀 DEPLOYMENT STEPS
STEP 1: Push Code to GitHub (5 mins)
# On your local machine or server:
cd /home/ubuntu/.openclaw/workspace/burmddit
# Initialize git
git init
git add .
git commit -m "Initial Burmddit deployment"
# Create repository on GitHub (via website):
# 1. Go to github.com/new
# 2. Name: burmddit
# 3. Public or Private (your choice)
# 4. Create repository
# Push to GitHub
git remote add origin https://github.com/YOUR_USERNAME/burmddit.git
git branch -M main
git push -u origin main
✅ Done! Your code is now on GitHub
STEP 2: Deploy Backend to Railway (10 mins)
2.1: Create Railway Project
- Go to railway.app
- Click "New Project"
- Select "Deploy from GitHub repo"
- Choose your
burmdditrepository - Railway will auto-detect it as a Python project
2.2: Add PostgreSQL Database
- In your Railway project, click "+ New"
- Select "Database" → "PostgreSQL"
- Railway creates database instantly
- Copy the
DATABASE_URL(Click database → Connect → Copy connection string)
2.3: Set Environment Variables
In Railway project settings → Variables, add:
DATABASE_URL=<paste from step 2.2>
ANTHROPIC_API_KEY=<your Claude API key from console.anthropic.com>
ADMIN_PASSWORD=<choose a secure password>
PYTHONPATH=/app/backend
2.4: Configure Build
Railway → Settings → Build:
- Root Directory:
backend - Build Command:
pip install -r requirements.txt - Start Command:
python run_pipeline.py
2.5: Initialize Database
In Railway console (click database service):
python init_db.py init
✅ Done! Backend is live on Railway
STEP 3: Deploy Frontend to Vercel (5 mins)
3.1: Connect GitHub to Vercel
- Go to vercel.com/new
- Click "Import Git Repository"
- Select your
burmdditrepo - Vercel auto-detects Next.js
3.2: Configure Settings
Framework Preset: Next.js
Root Directory: frontend
Build Command: (default next build)
Output Directory: (default .next)
3.3: Set Environment Variables
In Vercel project settings → Environment Variables:
DATABASE_URL=<same as Railway PostgreSQL URL>
NEXT_PUBLIC_SITE_URL=https://burmddit.vercel.app
3.4: Deploy
Click "Deploy"
Wait 2-3 minutes...
✅ Done! Frontend is live at burmddit.vercel.app!
STEP 4: Set Up Automation (5 mins)
Option A: GitHub Actions (Recommended)
Create file: .github/workflows/daily-publish.yml
name: Daily Content Pipeline
on:
schedule:
# Run at 6 AM UTC daily
- cron: '0 6 * * *'
workflow_dispatch: # Allow manual trigger
jobs:
run-pipeline:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
cd backend
pip install -r requirements.txt
- name: Run pipeline
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
run: |
cd backend
python run_pipeline.py
Add secrets to GitHub:
- Repo → Settings → Secrets and variables → Actions
- Add:
DATABASE_URLandANTHROPIC_API_KEY
Option B: Railway Cron (Simpler but less flexible)
In Railway, use built-in cron:
- Project settings → Deployments
- Add cron trigger:
0 6 * * * - Command:
python backend/run_pipeline.py
✅ Done! Auto-publishes 10 articles daily at 6 AM UTC!
🧪 TESTING
Test the Pipeline Manually:
# SSH into Railway or run locally with env vars:
cd backend
# Test scraper
python scraper.py
# Test compiler
python compiler.py
# Test translator
python translator.py
# Test full pipeline
python run_pipeline.py
Check Database:
python init_db.py stats
Test Website:
- Visit burmddit.vercel.app
- Should see homepage with categories
- Once pipeline runs, articles will appear
💰 COST BREAKDOWN
Monthly Costs:
Free tier (Month 1-3):
- Vercel: FREE (Hobby plan)
- Railway: FREE ($5 credit/month) or $5/month
- GitHub Actions: FREE (2,000 mins/month)
- Total: $0-$5/month
With Claude API (Month 1+):
- Claude API: ~$30-60/month
- 10 articles/day × 30 days = 300 articles
- ~1,500 words per article = 2,000 tokens
- 300 × 2,000 = 600k tokens/month
- Claude pricing: ~$0.015/1k tokens input, $0.075/1k tokens output
- Estimated: $30-60/month
- Total: $35-65/month
Optimization tips:
- Use Claude 3 Haiku for translation (cheaper, still good quality)
- Batch translations to reduce API calls
- Cache common translations
📊 MONITORING
Check Pipeline Status:
Railway Dashboard:
- View logs for each pipeline run
- Check database size
- Monitor CPU/memory usage
Vercel Dashboard:
- Page views
- Load times
- Error rates
Database Stats:
python init_db.py stats
🐛 TROUBLESHOOTING
Pipeline Not Running
Check logs:
# Railway → Deployments → View logs
# Or locally:
tail -f burmddit_pipeline.log
Common issues:
- API key not set → Check environment variables
- Database connection failed → Verify DATABASE_URL
- Scraping blocked → Check rate limits, use VPN if needed
No Articles Showing
Verify pipeline ran:
python init_db.py stats
Check articles table:
SELECT COUNT(*) FROM articles WHERE status = 'published';
Manual trigger:
python backend/run_pipeline.py
Translation Errors
Check API key:
echo $ANTHROPIC_API_KEY
Test translation:
python backend/translator.py
Rate limit hit:
- Anthropic free tier: 50 requests/min
- Paid tier: 1,000 requests/min
- Add delays if needed
🔧 CUSTOMIZATION
Change Number of Articles:
Edit backend/config.py:
PIPELINE = {
'articles_per_day': 20, # Change from 10 to 20
...
}
Add New Content Sources:
Edit backend/config.py:
SOURCES = {
'your_source': {
'enabled': True,
'url': 'https://example.com/feed/',
...
}
}
Update backend/scraper.py to handle new source format.
Change Translation Quality:
Use Claude 3 Opus for best quality (more expensive):
TRANSLATION = {
'model': 'claude-3-opus-20240229',
...
}
Or Claude 3 Haiku for lower cost (still good):
TRANSLATION = {
'model': 'claude-3-haiku-20240307',
...
}
🎨 FRONTEND CUSTOMIZATION
Change Colors:
Edit frontend/tailwind.config.ts:
colors: {
primary: {
500: '#YOUR_COLOR',
// ... other shades
}
}
Add Logo:
Replace text logo in frontend/components/Header.tsx:
<Image src="/logo.png" width={40} height={40} alt="Burmddit" />
Add logo.png to frontend/public/
Change Fonts:
Update frontend/app/layout.tsx with Google Fonts link
📈 SCALING
When Traffic Grows:
Vercel (Frontend):
- Free tier: Unlimited bandwidth
- Pro tier ($20/mo): Analytics, more team members
Railway (Backend + DB):
- Free tier: $5 credit (good for 1-2 months)
- Hobby tier: $5/mo (500 hours)
- Pro tier: $20/mo (unlimited)
Database:
- Railway PostgreSQL: 100 MB free → 8 GB on paid
- For larger: Migrate to Supabase or AWS RDS
Claude API:
- Pay-as-you-go scales automatically
- Monitor costs in Anthropic console
✅ POST-DEPLOYMENT CHECKLIST
After deployment, verify:
- Frontend loads at burmddit.vercel.app
- Database tables created (run
init_db.py stats) - Pipeline runs successfully (trigger manually first)
- Articles appear on homepage
- All 4 categories work
- Mobile responsive (test on phone)
- Search works (if implemented)
- Burmese fonts display correctly
- GitHub Actions/Railway cron scheduled
- Environment variables secure (not in code)
🎉 SUCCESS!
You now have:
✅ Fully automated AI content platform
✅ 10 articles published daily
✅ Professional Burmese website
✅ Zero manual work needed
✅ Scalable infrastructure
Next steps:
- Monitor first week's content quality
- Adjust scraping sources if needed
- Promote on social media
- Apply for Google AdSense (after 3 months)
- Build email list
- Scale to 20 articles/day if demand grows
📞 SUPPORT
Issues? Check:
- Railway logs
- Vercel deployment logs
- GitHub Actions run history
- Database stats (
init_db.py stats)
Still stuck? Review code comments in:
backend/run_pipeline.py(main orchestrator)backend/scraper.py(if scraping issues)backend/translator.py(if translation issues)
Built by Bob (OpenClaw AI) for Zeya Phyo
Deploy time: ~30 minutes
Maintenance: ~5 minutes/week
Passive income potential: $2,000-5,000/month 🚀
Let's make AI accessible to all Burmese speakers! 🇲🇲