Rofy|Rofy Help
Deployment

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?

FeaturePreviewDeployment
What it isYour testing playgroundYour live app
How long it lastsUp to 30 minutes (if inactive it stops)Always online
Resources (CPU/RAM)High (more powerful)Lower (optimized)
URL looks likeyourapp.preview.rofyagent.comyourapp.rofy.host
DatabasePreview databaseProduction database
CostDevelopment credits only50 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

MachinePowerWhen to Use
RegularStandard powerNormal development
LargeExtra powerTesting 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 BuiltSource
FrontendReact code
BackendPython / FastAPI
JavaScript packagespackage.json
Python packagesrequirements.txt

Note
Build time usually takes around 5 minutes.

The Big Problem: Heavy Libraries

PreviewDeploymentReason
Heavy libraries often workHeavy libraries may failDeployment has fewer resources
Example: pandas, matplotlibMay timeout or crashLimited 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 InstallUse Instead
pandas / matplotlib / plotlyExternal data APIs
Large AI librariesOpenAI or HuggingFace APIs
Playwright / SeleniumAutomation services
Heavy image toolsCloudinary / imgix
Large calculationsAWS Lambda or Cloud Functions

Tip
If a library is large, use an external API instead of installing it locally.

Example External Services

Service TypeExamplesPurpose
File StorageAmazon S3, Google Cloud StorageStore images, videos, PDFs
DatabasesSupabase, PostgreSQLManage structured data
Media HostingCloudinaryManage images and media

Info
Databases store structured data (users, orders, records).
Storage services store large files (images, videos, documents).

Common Build Errors

ErrorMeaningFix
Module not foundMissing dependencyAdd to package.json or requirements.txt
Build timeoutApp too heavyRemove heavy libraries
Syntax errorCode mistakeFix code
Out of memoryRAM overloadOptimize 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?

TypeDescription
RelationalData stored in tables (like Excel)
Non-RelationalFlexible document-based data

Info
Rofy uses MongoDB by default, which is flexible and easy to scale.

How Databases Work

Key DetailExplanation
Shared hostingMultiple users share clusters
Preview vs deploymentCompletely separate databases
Built-in storageCan store text and small files
Query optimizationRequired for deployment performance

Warning
The agent cannot access your production database unless logs are shared.

When Databases Become Too Heavy

ProblemSolution
Many imagesUse Amazon S3
Videos or PDFsUse Cloudinary
Large datasetsUse Supabase or PostgreSQL
High trafficRequest dedicated database

Optimizing Queries

Query SpeedResult
Slow queriesDeployment may fail
Optimized queriesFaster 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

TypeExamplesProvided By
System secretsMongoDB URL, Backend URLRofy
Custom secretsAPI keys, service credentialsYou

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 ValueResult
Port numberApp can't connect
URL404 errors
API keyExternal services fail
Database URLNo 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

ErrorMeaningFix
Provisioning failedServer setup problemRetry deployment
Container crashedApp failed to startCheck logs
Port conflictPort already usedUpdate port
Out of resourcesApp too heavyOptimize 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

PhaseTime
Build + Database + Secrets + Deploy + Health Check10–15 minutes

Deployment Costs

ActionCost
First deployment50 credits ($10)
Redeploy same appFree
Deploy new app50 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

UpdatesStays Same
CodeDatabase

Warning
Preview data created after deployment will not automatically appear in production.

URLs in Rofy

URL TypeExampleDuration
Previewapp.preview.rofyagent.com30 minutes
Deployedapp.rofy.hostAlways
Custom domainyourdomain.comAlways

Adding a Custom Domain

  1. Buy a domain (GoDaddy, Namecheap, etc)
  2. Update DNS records
  3. Link domain in Rofy dashboard
  4. Wait for DNS propagation (10 min – 2 hours)

Troubleshooting Guide

ProblemQuick Fix
Build failsShare logs with agent
Database failsCheck MONGO_URL
Deploy failsReview deployment logs
App won't startCheck .env
Domain not workingWait 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

TermMeaning
PreviewTemporary testing environment
DeploymentLive production app
RedeployUpdate existing app
Job IDUnique build identifier
Heavy libraryLarge dependency
External APIThird-party service
.env fileSecure environment variables
AgentAI assistant that builds and fixes apps

On this page