Spaces:
Sleeping
Sleeping
| # π― DEPLOY NOW - Everything Ready! | |
| ## β What's Configured | |
| I've set up everything to work exactly like your localhost, using your FREE API keys: | |
| - β **Groq API**: `gsk_3pLc...kvfC` - For chat, transformations, insights | |
| - β **Gemini API**: `AIzaS...ep_0` - For embeddings, search, long context | |
| - β **Database**: test namespace/database (same as localhost) | |
| - β **All settings**: Same retry/worker config as your working setup | |
| --- | |
| ## π STEP 1: Copy Railway Variables | |
| Go to Railway Dashboard β Your Service β Variables, and paste ALL of these: | |
| ```plaintext | |
| SURREAL_URL=ws://127.0.0.1:8000/rpc | |
| SURREAL_USER=root | |
| SURREAL_PASSWORD=root | |
| SURREAL_NAMESPACE=test | |
| SURREAL_DATABASE=test | |
| INTERNAL_API_URL=http://127.0.0.1:5055 | |
| API_URL=http://localhost:5055 | |
| SURREAL_COMMANDS_MAX_TASKS=5 | |
| SURREAL_COMMANDS_RETRY_ENABLED=true | |
| SURREAL_COMMANDS_RETRY_MAX_ATTEMPTS=3 | |
| SURREAL_COMMANDS_RETRY_WAIT_STRATEGY=exponential_jitter | |
| SURREAL_COMMANDS_RETRY_WAIT_MIN=1 | |
| SURREAL_COMMANDS_RETRY_WAIT_MAX=30 | |
| GROQ_API_KEY=<YOUR_GROQ_KEY_HERE> | |
| GOOGLE_API_KEY=<YOUR_GEMINI_KEY_HERE> | |
| ``` | |
| **Note**: We'll update `API_URL` after first deploy. | |
| --- | |
| ## π STEP 2: Push Code | |
| ```powershell | |
| cd c:\sem6-real\studyrocket\notebookllm\open-notebook | |
| git add . | |
| git commit -m "Add Railway deployment with FREE tier (Groq + Gemini)" | |
| git push origin main | |
| ``` | |
| --- | |
| ## π STEP 3: Wait for Deploy | |
| Railway will: | |
| 1. Build the Docker image (~5-10 minutes) | |
| 2. Start all services (SurrealDB, API, Worker, Frontend) | |
| 3. Run migrations (0 β 18) | |
| 4. Expose your app on a public URL | |
| **Watch the logs** in Railway dashboard for: | |
| ``` | |
| β Ready in XXXms | |
| INFO: Application startup complete | |
| Migrations completed successfully. Database is now at version 18 | |
| ``` | |
| --- | |
| ## π STEP 4: Update API_URL | |
| 1. Find your Railway domain in the dashboard (e.g., `https://se-production-1a2b.up.railway.app`) | |
| 2. Update the `API_URL` variable: | |
| ```plaintext | |
| API_URL=https://se-production-1a2b.up.railway.app | |
| ``` | |
| 3. Railway will auto-redeploy (~1 minute) | |
| --- | |
| ## β STEP 5: Test Everything | |
| Visit your app: `https://your-railway-domain.up.railway.app` | |
| **Test these features:** | |
| - β Create a notebook | |
| - β Upload a document (tests embeddings) | |
| - β Search documents (tests Gemini embeddings) | |
| - β Chat with documents (tests Groq LLM) | |
| - β Generate insights (tests transformations) | |
| - β Create notes | |
| **Skip for now:** | |
| - βΈοΈ Podcast generation (you'll configure later) | |
| --- | |
| ## π What You'll Have | |
| ### Working Features (FREE): | |
| - β Chat using Groq Llama 3.1 70B | |
| - β Document embeddings using Gemini | |
| - β Semantic search using Gemini | |
| - β Transformations using Groq | |
| - β Insights using Groq | |
| - β Long context (1M tokens!) using Gemini | |
| - β All for **$0/month** (AI costs) | |
| ### Railway Costs: | |
| - First month: **FREE** ($5 credit) | |
| - After: **$5-10/month** (just hosting) | |
| --- | |
| ## π§ Models Available | |
| In the UI, you can select from: | |
| ### Groq Models (FREE): | |
| - `llama-3.1-70b-versatile` - Best for complex tasks | |
| - `llama-3.1-8b-instant` - Fast for simple tasks | |
| - `mixtral-8x7b-32768` - Alternative option | |
| ### Gemini Models (FREE): | |
| - `gemini-1.5-flash` - Fast, FREE | |
| - `gemini-1.5-pro` - 1M context, FREE tier | |
| - `text-embedding-004` - Embeddings | |
| --- | |
| ## π If Something Goes Wrong | |
| ### Build Fails | |
| β Check Railway logs for error message | |
| β Ensure all files are committed (especially migrations/18.surrealql) | |
| ### Services Won't Start | |
| β Check `SURREAL_URL=ws://127.0.0.1:8000/rpc` (not localhost!) | |
| β Verify both API keys are set correctly | |
| ### Can't Access App | |
| β Wait 2-3 minutes after deploy | |
| β Check `API_URL` is set to your Railway domain | |
| β Try incognito/private browser window | |
| ### Features Don't Work | |
| β Groq models: Check chat works in UI | |
| β Gemini embeddings: Try uploading a document | |
| β If API key issues: Regenerate keys at provider dashboards | |
| --- | |
| ## π Your Setup Summary | |
| | Component | Configuration | Status | | |
| |-----------|--------------|--------| | |
| | **Database** | SurrealDB (embedded) | β Ready | | |
| | **API** | FastAPI on port 5055 | β Ready | | |
| | **Frontend** | Next.js on port 8080 | β Ready | | |
| | **Worker** | Background tasks | β Ready | | |
| | **LLM** | Groq Llama 3.1 | β FREE | | |
| | **Embeddings** | Gemini | β FREE | | |
| | **Hosting** | Railway | β $5-10/mo | | |
| | **Podcasts** | Not configured | βΈοΈ Later | | |
| --- | |
| ## π Next Steps After Deploy | |
| 1. β Test all features (except podcasts) | |
| 2. β Upload some test documents | |
| 3. β Try searching and chatting | |
| 4. β Generate some insights | |
| 5. βΈοΈ Configure podcasts later when needed | |
| --- | |
| ## π° Cost Tracking | |
| Track your FREE tier usage: | |
| - **Groq**: https://console.groq.com/dashboard | |
| - **Gemini**: https://console.cloud.google.com/apis/dashboard | |
| - **Railway**: https://railway.app/dashboard | |
| All providers show FREE tier limits and usage! | |
| --- | |
| ## π Ready to Deploy! | |
| Everything is configured. Just run: | |
| ```powershell | |
| git add . | |
| git commit -m "Railway deployment ready with FREE tier keys" | |
| git push origin main | |
| ``` | |
| Then watch Railway build and deploy! π | |
| --- | |
| **Questions?** Everything should work exactly like your localhost setup, but on Railway! The same models, same features (minus podcasts), all working with your FREE API keys. | |