Skip to main content
RemoteAgent is built entirely on managed services — there is no custom infrastructure to provision or maintain. Every service used has a free tier, which means the infrastructure cost for the MVP is effectively $0/month.

Vercel

Role: Hosts the Next.js web app, API Routes, and cron jobs. All server-side logic runs as Vercel serverless functions:
  • POST /api/telegram — receives Telegram webhook events, dispatches commands to Redis
  • POST /api/pair and POST /api/pair/confirm — handles the agent pairing flow
  • GET /api/agents and DELETE /api/agents/:id — agent management
  • POST /api/stripe/checkout and POST /api/stripe/portal — Stripe session creation
  • POST /api/stripe/webhook — handles Stripe billing events
  • GET /api/cron/trial-reminders — daily cron for trial expiry notifications
Functions are deployed globally on Vercel’s edge network. Cold starts are minimal because the functions are small and stateless. Free tier: Vercel Hobby plan — sufficient for the MVP traffic volume.

Neon PostgreSQL

Role: Primary database for persistent state. Tables: users, agents, sessions, pairing_codes. Neon is a serverless PostgreSQL provider with per-query billing and automatic scale-to-zero. The database is not in the hot path for real-time message relay — it is only accessed for authentication, plan checks, session recording, and pairing code lifecycle. Free tier: Neon free tier — 0.5 GB storage, sufficient for user and session data at MVP scale.

Redis (Upstash)

Role: Real-time pub/sub relay between API Routes and the local agent. Two channel patterns:
  • agent:{agentId} — commands published by API Routes, subscribed to by the local agent
  • output:{sessionId} — output chunks published by the agent, subscribed to by the output forwarder Vercel function
Redis is the only service involved in every message in both directions. Latency matters here — Upstash provides sub-10ms pub/sub with a serverless-compatible REST API (used by Vercel functions) and a native Redis protocol connection (used by the agent via ioredis). Free tier: Upstash free tier — 10,000 commands/day, sufficient for development and light production use. Upgrade to the pay-per-use tier for production.

Telegram

Role: User interface for sending commands and receiving output. RemoteAgent uses the Telegram Bot API via Grammy.js. The bot runs in webhook mode — Telegram sends a POST request to /api/telegram for each incoming message. There is no polling, no persistent bot process, and no server-to-Telegram persistent connection. Grammy.js handles:
  • HMAC-SHA256 signature verification on every webhook request
  • Message parsing and routing
  • Sending and editing messages (for streaming output)
  • Inline keyboards (for plan upgrade buttons in trial reminders)
  • Telegram Login Widget verification (for the connect page)
Cost: Free. The Telegram Bot API has no usage fees.

Stripe

Role: Payment processing and subscription management. Stripe handles:
  • Hosted Checkout pages (no payment form to build or maintain)
  • Subscription lifecycle (creation, renewal, failure, cancellation)
  • Customer Portal (self-service billing management for users)
  • Webhook events for real-time plan updates
Plan updates (upgrade, downgrade, cancellation, payment failure) are processed exclusively from Stripe webhook events — never from redirect URLs or client-side callbacks. Free tier: No monthly fee. Stripe charges a percentage per transaction (typically 2.9% + 30¢ for card payments).

Summary

ServiceRoleFree tier
VercelWeb app hosting, API Routes, cronHobby plan
Neon PostgreSQLDatabase0.5 GB
Upstash RedisReal-time relay (pub/sub)10k cmds/day
Telegram Bot APIUser interfaceFree
StripePayments and subscriptionsNo monthly fee
All services are managed — no VMs, no containers, no Kubernetes. RemoteAgent has zero custom infrastructure to maintain. Scale is handled automatically by each provider.