β Railway Deployment Checklist
Pre-Deployment Verification
β Local Testing Complete
- Project restructured with
backend/static/folder - All frontend files copied to
backend/static/ -
main.pyupdated to serve static files -
data.jsupdated for Railway deployment - Local server tested and working (
http://localhost:8000) - All pages accessible (index, login, dashboards, questionnaires)
- API endpoints working (grouping, data saving)
β Git Repository Status
-
.envfile in.gitignore(API key NOT committed) - All changes committed to Git
- Changes pushed to GitHub main branch
- Repository:
https://github.com/talimbot/talimbot
π Railway Deployment Steps
Step 1: Create Railway Account
- Go to https://railway.app
- Click "Start a New Project"
- Sign in with GitHub account
- Authorize Railway to access your repositories
Step 2: Deploy from GitHub
- Click "Deploy from GitHub repo"
- Select
talimbot/talimbotrepository - Railway auto-detects Python project
- Deployment starts automatically
Step 3: Configure Environment Variables
- Go to project dashboard
- Click "Variables" tab
- Click "+ New Variable"
- Add variable:
- Key:
OPENROUTER_API_KEY - Value:
sk-or-v1-your-actual-key-here
- Key:
- Click "Add"
Step 4: Generate Public URL
- Go to "Settings" tab
- Scroll to "Networking" section
- Click "Generate Domain"
- Copy your URL:
https://talimbot-production-xxxx.up.railway.app
Step 5: Wait for Deployment
- Monitor deployment in "Deployments" tab
- Wait 2-3 minutes for build to complete
- Look for "β Deployment successful" message
π§ͺ Post-Deployment Testing
Test All Features
Visit your Railway URL and verify:
Frontend Pages
- Main page loads (
/) - Login page works (
/pages/login.html) - Student dashboard loads and functions
- Teacher dashboard loads and functions
- AMS questionnaire page works
- Cooperative questionnaire page works
- Group view page displays correctly
Authentication & Navigation
- Can login as student (use student number from data)
- Can login as teacher (password:
teacher123) - Navigation between pages works
- Back buttons work correctly
- Logout functionality works
Student Features
- MBTI test can be filled and saved
- VARK test can be filled and saved
- AMS questionnaire completes and auto-saves score
- Cooperative questionnaire completes and auto-saves score
- Preferred students selection works (max 4)
- "Save All Data" button saves successfully
- Data persists after page refresh
- Can view assigned group
Teacher Features
- Can view all students in table
- Can edit student information
- Can add new students
- Can delete students
- Download data button works
- Toggle visibility for students works
- AI Grouping functionality works
- Can select course (Riazi, Faravari, etc.)
- Grouping completes successfully
- Groups are created and saved
- Students can see their groups
- AMS and Cooperation columns display correctly
API & Data Persistence
- API calls complete without errors (check browser console)
- Student data saves to backend
- Data persists between sessions
- Groups persist after creation
- No 404 errors for API endpoints
- No CORS errors in console
π Troubleshooting Guide
If pages don't load:
- Check Railway deployment logs for errors
- Verify
backend/static/folder contains all files - Check browser console for 404 errors
If API calls fail:
- Verify environment variable
OPENROUTER_API_KEYis set - Check Railway logs for API errors
- Test API endpoints directly:
https://your-url.railway.app/api/students
If grouping doesn't work:
- Verify OpenRouter API key is correct
- Check you have credits in OpenRouter account
- View Railway logs during grouping attempt
- Ensure request is reaching
/api/groupingendpoint
If static files are missing:
- Verify files exist in
backend/static/folder locally - Ensure git committed and pushed all files
- Trigger manual redeploy in Railway
- Check file paths in HTML are correct (relative paths)
π Monitoring
Check Deployment Status
- Railway dashboard shows "Active" status
- Latest deployment timestamp is recent
- No error messages in deployment logs
Monitor Usage
- View usage in Railway "Usage" tab
- Verify you're within free tier ($5/month)
- Estimated usage: ~$2-3/month
View Logs
- Real-time logs available in "Deployments" tab
- Check logs for any errors or warnings
- Monitor API request logs
π― Final Verification
Complete Success Criteria
- Application is accessible from any device with internet
- All features work identically to localhost version
- No errors in browser console
- No errors in Railway logs
- Data persistence works correctly
- AI grouping creates groups successfully
- Teachers can manage students
- Students can complete questionnaires
Share with Users
- Copy Railway URL
- Share URL with teacher
- Provide login instructions:
- Teacher: Password is
teacher123 - Students: Use their student number
- Teacher: Password is
- Explain how to access from any device
π You're Done!
Once all checkboxes are checked, your TalimBot is:
- β Fully deployed on Railway
- β Accessible from anywhere via the internet
- β Secure (API key in environment variables)
- β Free (within Railway's $5/month credit)
- β Professional (real production website)
Your Live URL: https://your-project.up.railway.app
π Next Steps
- Bookmark your Railway dashboard for monitoring
- Keep your OpenRouter API key safe (never share it)
- Monitor Railway usage to stay within free tier
- Test from multiple devices (phone, tablet, different computers)
- Collect feedback from teachers and students
π Need Help?
- Railway Docs: https://docs.railway.app
- Railway Discord: https://discord.gg/railway
- Review:
RAILWAY_SETUP_GUIDE.mdfor detailed instructions