Platform Documentation
Complete guide to building and deploying applications on Rofy.
Platform Documentation
Complete guide to building and deploying applications on Rofy.
Understanding the Basics
What is Preview vs Deployment?
| Feature | Preview | Deployment |
|---|---|---|
| What it is | Your testing playground | Your live app |
| How long it lasts | Up to 30 minutes (if inactive it stops) | Always online |
| Resources (CPU/RAM) | High (more powerful) | Lower (optimized) |
| URL looks like | yourapp.preview.rofyagent.com | yourapp.rofy.host |
| Database | Preview database | Production database |
| Cost | Development credits only | 50 credits ($10) first time |
Info
Simple rule: Preview and Deployment are completely separate environments.
If you make changes in preview, you must redeploy for them to appear in the live app.
Machine Types in Preview
| Machine | Power | When to Use |
|---|---|---|
| Regular | Standard power | Normal development |
| Large | Extra power | Testing heavy features |
Info
On paid tiers the system automatically switches machines when needed.
On basic tiers, if the agent sleeps you must wake it with a larger machine button.
Before You Deploy
✔ Agent is awake (deployment fails if agent is asleep)
✔ App works in preview (fix all errors first)
✔ Not using excessive compute resources
✔ Queries are optimized
✔ Plan ahead for large databases
Tip
If your app will store large datasets or files, plan external storage early.
Phase 1: Build Phase
What Happens Here?
Your code gets compiled and prepared for production.
Think of it as packing your application into a box before shipping it live.
| What Gets Built | Source |
|---|---|
| Frontend | React code |
| Backend | Python / FastAPI |
| JavaScript packages | package.json |
| Python packages | requirements.txt |
Note
Build time usually takes around 5 minutes.
The Big Problem: Heavy Libraries
| Preview | Deployment | Reason |
|---|---|---|
| Heavy libraries often work | Heavy libraries may fail | Deployment has fewer resources |
| Example: pandas, matplotlib | May timeout or crash | Limited CPU/RAM |
Warning
Deployment environments are more resource-efficient than preview.
What works during development might fail in production.
The Solution: Use APIs Instead
| Don't Install | Use Instead |
|---|---|
| pandas / matplotlib / plotly | External data APIs |
| Large AI libraries | OpenAI or HuggingFace APIs |
| Playwright / Selenium | Automation services |
| Heavy image tools | Cloudinary / imgix |
| Large calculations | AWS Lambda or Cloud Functions |
Tip
If a library is large, use an external API instead of installing it locally.
Example External Services
| Service Type | Examples | Purpose |
|---|---|---|
| File Storage | Amazon S3, Google Cloud Storage | Store images, videos, PDFs |
| Databases | Supabase, PostgreSQL | Manage structured data |
| Media Hosting | Cloudinary | Manage images and media |
Info
Databases store structured data (users, orders, records).
Storage services store large files (images, videos, documents).
Common Build Errors
| Error | Meaning | Fix |
|---|---|---|
| Module not found | Missing dependency | Add to package.json or requirements.txt |
| Build timeout | App too heavy | Remove heavy libraries |
| Syntax error | Code mistake | Fix code |
| Out of memory | RAM overload | Optimize packages |
Fixing Build Problems with the Agent
Step 1
Share logs with the agent.
Step 2
Ask the agent to optimize your code.
Step 3
The agent identifies and fixes the issue.
Step 4
Test again in preview.
Step 5
Run a Pre-Deployment Health Check.
Step 6
Deploy your application.
Phase 2: Database Migration
What Happens?
Your preview database moves to production.
Think of it as moving furniture to a new house.
Note
Time required: 1–2 minutes
What is a Database?
| Type | Description |
|---|---|
| Relational | Data stored in tables (like Excel) |
| Non-Relational | Flexible document-based data |
Info
Rofy uses MongoDB by default, which is flexible and easy to scale.
How Databases Work
| Key Detail | Explanation |
|---|---|
| Shared hosting | Multiple users share clusters |
| Preview vs deployment | Completely separate databases |
| Built-in storage | Can store text and small files |
| Query optimization | Required for deployment performance |
Warning
The agent cannot access your production database unless logs are shared.
When Databases Become Too Heavy
| Problem | Solution |
|---|---|
| Many images | Use Amazon S3 |
| Videos or PDFs | Use Cloudinary |
| Large datasets | Use Supabase or PostgreSQL |
| High traffic | Request dedicated database |
Optimizing Queries
| Query Speed | Result |
|---|---|
| Slow queries | Deployment may fail |
| Optimized queries | Faster performance |
Tip
Tell the agent:
“Optimize my database queries.”
Phase 3: Exporting Secrets
What Are Secrets?
Secrets are passwords, API keys, and configuration values required by your app.
These are stored inside a .env file.
Note
Setup time: 1–2 minutes
Types of Secrets
| Type | Examples | Provided By |
|---|---|---|
| System secrets | MongoDB URL, Backend URL | Rofy |
| Custom secrets | API keys, service credentials | You |
Golden Rules
- Never put secrets directly in code
- Always store secrets in
.env - Be careful when editing environment variables
- Redeploy after changing secrets
What Breaks Your App
| Wrong Value | Result |
|---|---|
| Port number | App can't connect |
| URL | 404 errors |
| API key | External services fail |
| Database URL | No data loads |
Phase 4: Deploy and Health Check
Deploy Phase
Your application is launched on servers.
What Happens
- Servers are created
- App is installed
- Network configured
- Resources assigned
Note
Deploy time: 3–5 minutes
Common Deploy Errors
| Error | Meaning | Fix |
|---|---|---|
| Provisioning failed | Server setup problem | Retry deployment |
| Container crashed | App failed to start | Check logs |
| Port conflict | Port already used | Update port |
| Out of resources | App too heavy | Optimize code |
Health Check
After deployment the system verifies your app works correctly.
Checks Performed
- API responses
- Frontend loading
- Database connection
- Service availability
Note
Health check time: 1–2 minutes
Total Deployment Time
| Phase | Time |
|---|---|
| Build + Database + Secrets + Deploy + Health Check | 10–15 minutes |
Deployment Costs
| Action | Cost |
|---|---|
| First deployment | 50 credits ($10) |
| Redeploy same app | Free |
| Deploy new app | 50 credits |
What You Get
- 24/7 uptime
- Managed database
- Full build pipeline
- Domain support
Tip
After the first deployment, you can redeploy unlimited times for free.
Redeploying
| Updates | Stays Same |
|---|---|
| Code | Database |
Warning
Preview data created after deployment will not automatically appear in production.
URLs in Rofy
| URL Type | Example | Duration |
|---|---|---|
| Preview | app.preview.rofyagent.com | 30 minutes |
| Deployed | app.rofy.host | Always |
| Custom domain | yourdomain.com | Always |
Adding a Custom Domain
- Buy a domain (GoDaddy, Namecheap, etc)
- Update DNS records
- Link domain in Rofy dashboard
- Wait for DNS propagation (10 min – 2 hours)
Troubleshooting Guide
| Problem | Quick Fix |
|---|---|
| Build fails | Share logs with agent |
| Database fails | Check MONGO_URL |
| Deploy fails | Review deployment logs |
| App won't start | Check .env |
| Domain not working | Wait for DNS update |
When to Contact Support
Email support@rofy.ai when:
- Infrastructure errors repeat
- Database export needed
- Domain issues occur
- Dedicated database required
Pre-Deployment Checklist
✔ Works in preview
✔ Database queries optimized
✔ APIs used instead of heavy libraries
✔ All packages listed in config files
✔ API keys valid
✔ Secrets stored in .env
✔ Agent is awake
Quick Reference
| Term | Meaning |
|---|---|
| Preview | Temporary testing environment |
| Deployment | Live production app |
| Redeploy | Update existing app |
| Job ID | Unique build identifier |
| Heavy library | Large dependency |
| External API | Third-party service |
.env file | Secure environment variables |
| Agent | AI assistant that builds and fixes apps |