Complete Replit integration skill pack with 30 skills covering cloud IDE, deployments, AI assistance, and collaborative coding. Flagship+ tier vendor pack.
Installation
Open Claude Code and run this command:
/plugin install replit-pack@claude-code-plugins-plus
Use --global to install for all projects, or --project for current project only.
Skills (30)
Debug hard Replit issues: container lifecycle, Nix build failures, deployment crashes, and memory leaks.
Replit Advanced Troubleshooting
Overview
Deep debugging techniques for complex Replit issues that resist standard troubleshooting. Covers container lifecycle problems, Nix environment failures, deployment crash loops, memory leaks in constrained containers, and isolating Replit platform vs application issues.
Prerequisites
- Shell access in Replit Workspace
- Understanding of Replit container lifecycle
- Ability to read deployment logs
- Familiarity with
.replitandreplit.nix
Instructions
Step 1: Systematic Issue Isolation
#!/bin/bash
set -euo pipefail
# replit-diagnose.sh — Layer-by-layer diagnosis
echo "=== Replit Diagnostic ==="
# Layer 1: Platform status
echo -n "1. Platform: "
curl -s https://status.replit.com/api/v2/summary.json | \
python3 -c "import sys,json;print(json.load(sys.stdin)['status']['description'])" 2>/dev/null || \
echo "UNKNOWN (check status.replit.com)"
# Layer 2: Nix environment
echo -n "2. Nix: "
if [ -f replit.nix ]; then
echo "configured"
nix-env -qaP 2>/dev/null | head -3 || echo "(nix-env not in path)"
else
echo "NO replit.nix found"
fi
# Layer 3: Runtime
echo -n "3. Node: "
node --version 2>/dev/null || echo "N/A"
echo -n " Python: "
python3 --version 2>/dev/null || echo "N/A"
# Layer 4: Dependencies
echo "4. Dependencies:"
npm list --depth=0 2>/dev/null | head -10 || echo " npm: N/A"
pip list 2>/dev/null | head -5 || echo " pip: N/A"
# Layer 5: Environment
echo "5. Environment:"
echo " REPL_SLUG=$REPL_SLUG"
echo " REPL_OWNER=$REPL_OWNER"
echo " NODE_ENV=${NODE_ENV:-unset}"
echo " DATABASE_URL=${DATABASE_URL:+SET}"
echo " REPLIT_DB_URL=${REPLIT_DB_URL:+SET}"
# Layer 6: Resource usage
echo "6. Resources:"
echo " Disk: $(df -h / 2>/dev/null | tail -1 | awk '{print $3 "/" $2 " (" $5 ")"}')"
echo " Memory: $(free -m 2>/dev/null | head -2 | tail -1 | awk '{print $3 "MB / " $2 "MB"}' || echo 'N/A')"
echo " Processes: $(ps aux 2>/dev/null | wc -l) running"
# Layer 7: Network
echo "7. Network:"
echo -n " replit.com: "
curl -s -o /dev/null -w "%{http_code} (%{time_total}s)\n" https://replit.com
echo -n " Database: "
if [ -n "${DATABASE_URL:-}" ]; then
node -e "const{Pool}=require('pg');new Pool({connectionString:process.env.DATABASE_URL,ssl:{rejectUnauthorized:false}}).query('SELECT 1').then(()=>console.log('OK')).catch(e=>console.log('FAIL:',e.message)).finally(()=>process.exit())&Choose and implement Replit architecture blueprints: single-file script, modular app, and multi-service.
Replit Architecture Variants
Overview
Application architectures on Replit at three scales: single-file prototype, modular production app, and multi-service architecture. Each matches Replit's container model, built-in services, and deployment types.
Prerequisites
- Replit account
- Understanding of deployment types (Static, Autoscale, Reserved VM)
- Familiarity with Replit's storage options
Architecture Decision Matrix
| Factor | Single-File | Modular App | Multi-Service |
|---|---|---|---|
| Users | Prototype, < 100/day | 100-10K/day | 10K+/day |
| Database | Replit KV (50 MiB) | PostgreSQL | PostgreSQL + cache |
| Storage | Local + KV | Object Storage | Object Storage + CDN |
| Persistence | Ephemeral OK | Durable required | Durable required |
| Deployment | Repl Run / Autoscale | Autoscale / Reserved VM | Multiple Reserved VMs |
| Cost | Free-$7/mo | $7-25/mo | $25+/mo |
| Always-on | No (free), Yes (deploy) | Yes (deployment) | Yes (deployment) |
Instructions
Variant A: Single-File Script (Prototype)
Best for: Bots, scripts, learning, hackathon projects.
# main.py — everything in one file
from flask import Flask, request, jsonify
from replit import db
import os
app = Flask(__name__)
# KV Database for simple state
@app.route('/')
def home():
count = db.get("visits") or 0
db["visits"] = count + 1
return f"Visit #{count + 1}"
@app.route('/api/notes', methods=['GET', 'POST'])
def notes():
if request.method == 'POST':
note = request.json
notes = db.get("notes") or []
notes.append(note)
db["notes"] = notes
return jsonify(note), 201
return jsonify(db.get("notes") or [])
app.run(host='0.0.0.0', port=int(os.environ.get('PORT', 3000)))
# .replit
run = "python main.py"
[nix]
channel = "stable-24_05"
[deployment]
run = ["python", "main.py"]
deploymentTarget = "autoscale"
Limitations: 50 MiB data, files lost on restart, cold starts. Upgrade to Variant B when you need structured data or durability.
Variant B: Modular App with PostgreSQL (Production)
Best for: Web apps, APIs, SaaS MVPs with 100-10K daily users.
my-app/
├─Configure CI/CD for Replit with GitHub Actions, automated testing, and deploy-on-push.
Replit CI Integration
Overview
Set up CI/CD for Replit apps: GitHub repo connected to Replit, automated testing via GitHub Actions, deploy-on-push, and post-deploy health verification. Replit supports direct GitHub import and auto-sync.
Prerequisites
- GitHub repository with Actions enabled
- Replit App connected to GitHub (Settings > Git > Connect)
- GitHub Secrets configured for deploy verification
Instructions
Step 1: Connect Replit to GitHub
1. In your Repl, click "Git" in the sidebar
2. Click "Connect to GitHub"
3. Authorize Replit GitHub App
4. Select your repository
5. Changes pushed to GitHub auto-sync to Replit
Alternative: Import from GitHub
1. Create new Repl > "Import from GitHub"
2. Paste repo URL
3. Replit clones and configures automatically
Step 2: GitHub Actions — Test on PR
# .github/workflows/test.yml
name: Test
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- run: npm test -- --coverage
- run: npm run lint
- run: npm run build
Step 3: Deploy Verification After Push
Replit auto-deploys when you push to the connected branch. Verify the deployment is healthy:
# .github/workflows/deploy-verify.yml
name: Verify Deployment
on:
push:
branches: [main]
jobs:
verify:
runs-on: ubuntu-latest
# Wait for Replit to pick up the push and deploy
steps:
- name: Wait for deployment
run: sleep 60
- name: Health check
run: |
DEPLOY_URL="${{ secrets.REPLIT_DEPLOY_URL }}"
STATUS=$(curl -s -o /dev/null -w "%{http_code}" "$DEPLOY_URL/health")
if [ "$STATUS" != "200" ]; then
echo "Health check failed: HTTP $STATUS"
exit 1
fi
echo "Deployment healthy"
- name: Response time check
run: |
DEPLOY_URL="${{ secrets.REPLIT_DEPLOY_URL }}"
TIME=$(curl -s -o /dev/null -w "%{time_total}" "$DEPLOY_URL/health")
echo "Response time: ${TIME}s"
# Alert if response > 5 seconds (cold start)
if (( $(echo "$TIME > 5" | bc -l) )); then
echo "WARNING: Slow response (possible cold start)"
fi
Step 4: Store Deployment Secrets
# Set GitHub secrets for deploy verification
gh secret set REPLIT_DEPLOY_URL --body "https://your-app.replit.app"
# Optional: Replit ADiagnose and fix the top Replit errors: container sleep, port binding, Nix failures, DB limits.
Replit Common Errors
Overview
Quick reference for the 10 most common Replit errors with real solutions. Covers container lifecycle, Nix configuration, database, deployment, and networking issues.
Prerequisites
- Replit Workspace access
- Shell tab for diagnostics
- Console tab for error logs
Error Reference
1. Container Sleeping / App Goes Offline
Error: Your Repl is sleeping. Run it to wake up.
Cause: Free/Hacker plan Repls sleep after ~5 minutes of inactivity.
Solution:
- Use Replit Deployments (Autoscale or Reserved VM) for always-on
- Or set up external keep-alive pinging (UptimeRobot, cron-job.org)
- Check: Settings > Always On (deprecated in favor of Deployments)
2. Port Binding / Webview Not Loading
Error: EADDRINUSE: address already in use :::3000
Cause: Previous process still holding the port, or hardcoded port conflicts.
Solution:
# Find and kill the process
lsof -i :3000 | grep LISTEN
kill -9 <PID>
# Or use environment variable for port
// Always use PORT env var
const port = parseInt(process.env.PORT || '3000');
app.listen(port, '0.0.0.0'); // Must be 0.0.0.0, not localhost
3. Nix Package Build Failure
Error: error: Package 'python-xyz' not found in channel 'stable-23_05'
Cause: Package name wrong, or Nix channel too old.
Solution:
# replit.nix — update channel and fix package names
{ pkgs }: {
deps = [
pkgs.nodejs-20_x # not "nodejs" or "node"
pkgs.python311 # not "python3" or "python"
pkgs.python311Packages.pip # not "pip"
pkgs.zlib # for native modules (Pillow, etc.)
pkgs.openssl # for crypto dependencies
];
}
# .replit — use current stable channel
[nix]
channel = "stable-24_05"
After editing replit.nix, reload the shell (exit and re-enter Shell tab).
4. DATABASE_URL Not Set
Error: Connection refused / ECONNREFUSED / DATABASE_URL is undefined
Cause: PostgreSQL not provisioned, or accessing outside Replit.
Solution:
- Open the Database pane in the sidebar
- Click "Create a database" if none exists
DATABASE_URLauto-populates in your environment- For legacy Replit DB: check
REPLITDBURLinstead
5. Replit DB Write Failure (50MB Limit)
Build a full-stack web app on Replit with Express/Flask, PostgreSQL, Auth, and deployment.
Replit Core Workflow A — Full-Stack App
Overview
Build a production-ready web app on Replit: Express or Flask server, PostgreSQL database, Replit Auth for user login, Object Storage for file uploads, and Autoscale deployment. This is the primary money-path workflow for shipping apps on Replit.
Prerequisites
- Replit account (Core plan or higher for deployments)
.replitandreplit.nixconfigured (seereplit-install-auth)- PostgreSQL provisioned in the Database pane
Instructions
Step 1: Project Structure
my-app/
├── .replit # Run + deployment config
├── replit.nix # System dependencies
├── package.json
├── tsconfig.json
├── src/
│ ├── index.ts # Express entry point
│ ├── routes/
│ │ ├── api.ts # API endpoints
│ │ ├── auth.ts # Auth routes
│ │ └── health.ts # Health check
│ ├── services/
│ │ ├── db.ts # PostgreSQL pool
│ │ └── storage.ts # Object Storage
│ └── middleware/
│ ├── auth.ts # Replit Auth middleware
│ └── errors.ts # Error handler
└── tests/
Step 2: Configuration Files
# .replit
entrypoint = "src/index.ts"
run = "npx tsx src/index.ts"
modules = ["nodejs-20:v8-20230920-bd784b9"]
[nix]
channel = "stable-24_05"
[env]
NODE_ENV = "development"
[deployment]
run = ["sh", "-c", "npx tsx src/index.ts"]
build = ["sh", "-c", "npm ci"]
deploymentTarget = "autoscale"
# replit.nix
{ pkgs }: {
deps = [
pkgs.nodejs-20_x
pkgs.nodePackages.typescript-language-server
pkgs.postgresql
];
}
Step 3: Database Layer
// src/services/db.ts
import { Pool } from 'pg';
const pool = new Pool({
connectionString: process.env.DATABASE_URL,
ssl: { rejectUnauthorized: false },
max: 10,
idleTimeoutMillis: 30000,
connectionTimeoutMillis: 5000,
});
// Initialize schema
export async function initDB() {
await pool.query(`
CREATE TABLE IF NOT EXISTS users (
id TEXT PRIMARY KEY,
username TEXT UNIQUE NOT NULL,
profile_image TEXT,
created_at TIMESTAMPTZ DEFAULT NOW()
);
CREATE TABLE IF NOT EXISTS posts (
id SERIAL PRIMARY KEY,
user_id TEXT REFERENCES users(id),
title TEXT NOT NULL,
content TEXT NOT NULL,
created_at TIMESTAMPTZ DEFAULT NOW()
);
`);
}
export async function upsertUser(id: string, username: string, image: string) {
return pool.query(
`INSERT INTO users (id, username, profile_image)
VALUES ($1, $2, $3)
ON CONFLICT (id) DO UPDATE SET username = $2, profile_image = $3
RETURNING *`,
[id, username, image]
Manage Replit Teams, member permissions, deployment promotion, and bulk Repl admin.
Replit Core Workflow B — Teams & Admin
Overview
Secondary workflow for Replit: team member management, role assignment, deployment promotion (dev to production), custom domain setup, and organizational audit. Complements the app-building workflow in replit-core-workflow-a.
Prerequisites
- Replit Teams or Enterprise plan
- Organization Owner or Admin role
- Team API token stored in
REPLIT_TOKEN
Instructions
Step 1: Team Member Management
// src/admin/team-manager.ts
interface TeamMember {
username: string;
email: string;
role: 'owner' | 'admin' | 'member';
lastActive: string;
}
async function listMembers(teamId: string): Promise<TeamMember[]> {
const res = await fetch(`https://replit.com/api/v1/teams/${teamId}/members`, {
headers: { Authorization: `Bearer ${process.env.REPLIT_TOKEN}` },
});
return res.json();
}
async function inviteMember(teamId: string, email: string, role: string) {
return fetch(`https://replit.com/api/v1/teams/${teamId}/members`, {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.REPLIT_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ email, role }),
});
}
async function removeMember(teamId: string, username: string) {
return fetch(`https://replit.com/api/v1/teams/${teamId}/members/${username}`, {
method: 'DELETE',
headers: { Authorization: `Bearer ${process.env.REPLIT_TOKEN}` },
});
}
Step 2: Seat Audit
// Identify inactive members for seat optimization
async function auditSeats(teamId: string) {
const members = await listMembers(teamId);
const thirtyDaysAgo = new Date(Date.now() - 30 * 24 * 60 * 60 * 1000);
const audit = {
total: members.length,
active: members.filter(m => new Date(m.lastActive) > thirtyDaysAgo),
inactive: members.filter(m => new Date(m.lastActive) <= thirtyDaysAgo),
costPerSeat: 25, // USD/month for Teams
};
console.log(`Active: ${audit.active.length}, Inactive: ${audit.inactive.length}`);
console.log(`Potential savings: $${audit.inactive.length * audit.costPerSeat}/month`);
return audit;
}
Step 3: Deployment Promotion
// Promote from development to production deployment
async function promoteDeployment(replId: string) {
// Step 1: Verify dev deployment is healthy
const devHealth = await fetch(`https://${replId}.replit.dev/health`);
if (!devHealth.ok) {
throw new Error('Development deployment not healthy. Fix before promoting.');
}
// Step 2: Trigger production deployment
const res = await fetch(`https://replit.com/api/v1/repls/${replId}/deploy`, {
method: 'POST',
headers: {
Authorization: `Bearer ${pOptimize Replit costs: deployment sizing, seat audit, egress control, and plan selection.
Replit Cost Tuning
Overview
Optimize Replit spending across deployment compute, seat licenses, egress, and storage. Covers right-sizing deployment resources, choosing between Autoscale and Reserved VM, eliminating idle Repls, and managing team seat costs.
Prerequisites
- Replit account with billing access
- Understanding of current deployment architecture
- Access to usage metrics in Replit dashboard
Replit Pricing Model
| Component | Pricing |
|---|---|
| Replit Core | $25/month (includes $8 flexible credits) |
| Replit Pro | $40/month (team features + credits) |
| Autoscale | Pay per compute unit consumed |
| Reserved VM | From $0.20/day (~$6.20/month) |
| Static Deploy | Free (CDN-backed) |
| Egress | $0.10/GiB over monthly allowance |
| PostgreSQL | Included in plan allowance |
| Object Storage | Included in plan allowance |
Instructions
Step 1: Audit Deployment Costs
Review what you're spending and where:
In Replit Dashboard > Billing:
1. View "Usage" tab for compute breakdown
2. Sort by cost to find expensive Repls
3. Check "Always On" Repls (legacy) — convert to Deployments
Key metrics to check:
- CPU hours consumed per Repl
- Memory-hours consumed per Repl
- Egress data transfer per Repl
- Number of cold starts (Autoscale)
Step 2: Right-Size Deployment Resources
# Match resources to actual workload
micro: # Simple bot, webhook receiver
type: autoscale
cost: "Pay per request (free when idle)"
best_for: "< 1000 requests/day, tolerates cold starts"
small: # Basic API or web app
type: reserved_vm
cpu: 0.25 vCPU
memory: 512 MB
cost: "~$6/month"
best_for: "Low traffic, always-on required"
medium: # Production web app
type: reserved_vm
cpu: 0.5 vCPU
memory: 1 GB
cost: "~$12/month"
best_for: "Standard traffic, good response times"
large: # Compute-heavy or high-traffic
type: reserved_vm
cpu: 2 vCPU
memory: 4 GB
cost: "~$40/month"
best_for: "High traffic, background processing"
# Rule of thumb: if peak CPU < 30% and peak memory < 50%, downsize
Step 3: Choose Autoscale vs Reserved VM
Use AUTOSCALE when:
- Traffic is unpredictable or bursty
- App can tolerate 5-15s cold starts
- Many hours of zero traffic per day
- Low daily request count (< 5000)
- Cost: $0 when idle, proportional tImplement secure data handling on Replit: PostgreSQL, KV Database, Object Storage, and data security patterns.
Replit Data Handling
Overview
Manage application data securely across Replit's three storage systems: PostgreSQL (relational), Key-Value Database (simple cache/state), and Object Storage (files/blobs). Covers connection patterns, security, data validation, and choosing the right storage for each use case.
Prerequisites
- Replit account with Workspace access
- PostgreSQL provisioned in Database pane (for SQL use cases)
- Understanding of Replit Secrets for credentials
Storage Decision Matrix
| Need | Storage | API | Limits |
|---|---|---|---|
| Structured data, queries | PostgreSQL | pg npm / psycopg2 |
Plan-dependent |
| Simple key-value, cache | Replit KV Database | @replit/database / replit.db |
50 MiB, 5K keys |
| Files, images, backups | Object Storage | @replit/object-storage |
Plan-dependent |
Instructions
Step 1: PostgreSQL — Secure Connection
// src/services/database.ts
import { Pool, PoolConfig } from 'pg';
function createPool(): Pool {
if (!process.env.DATABASE_URL) {
throw new Error('DATABASE_URL not set. Create a database in the Database pane.');
}
const config: PoolConfig = {
connectionString: process.env.DATABASE_URL,
ssl: { rejectUnauthorized: false }, // Required for Replit PostgreSQL
max: 10,
idleTimeoutMillis: 30000,
connectionTimeoutMillis: 5000,
};
const pool = new Pool(config);
// Log errors without exposing connection string
pool.on('error', (err) => {
console.error('Database pool error:', err.message);
// Never: console.error(err) — may contain credentials
});
return pool;
}
export const pool = createPool();
// Parameterized queries ONLY — never string concatenation
export async function findUser(userId: string) {
// GOOD: parameterized
const result = await pool.query(
'SELECT id, username, created_at FROM users WHERE id = $1',
[userId]
);
return result.rows[0];
// BAD: SQL injection risk
// pool.query(`SELECT * FROM users WHERE id = '${userId}'`)
}
Dev vs Production databases:
Replit auto-provisions separate databases:
- Development: used when running in Workspace ("Run" button)
- Production: used when accessed via deployment URL
View in Database pane:
- Development tab: test data, iterate freely
- Production tab: live customer data, handle with care
Both use the same DATABASE_URL — Replit routes automatically.
Step 2: Key-Value Database — Session & Cache
Node.js:
// src/sCollect Replit diagnostic info for debugging deployments, workspace issues, and support tickets.
Replit Debug Bundle
Current State
!node --version 2>/dev/null || echo 'Node: N/A'
!python3 --version 2>/dev/null || echo 'Python: N/A'
!echo "REPLSLUG=$REPLSLUG REPLOWNER=$REPLOWNER" 2>/dev/null || echo 'Not on Replit'
Overview
Collect all diagnostic information needed to debug Replit workspace, deployment, and database issues. Produces a redacted evidence bundle safe for sharing with Replit support.
Prerequisites
- Shell access in Replit Workspace
- Permission to read logs and configuration
- Access to deployment monitoring (if deployed)
Instructions
Step 1: Automated Debug Bundle Script
#!/bin/bash
set -euo pipefail
# replit-debug-bundle.sh
BUNDLE="replit-debug-$(date +%Y%m%d-%H%M%S)"
mkdir -p "$BUNDLE"/{env,db,config,network,packages}
echo "=== Replit Debug Bundle ===" > "$BUNDLE/summary.txt"
echo "Generated: $(date -u +%Y-%m-%dT%H:%M:%SZ)" >> "$BUNDLE/summary.txt"
echo "" >> "$BUNDLE/summary.txt"
# 1. Environment info
echo "--- Runtime ---" >> "$BUNDLE/env/runtime.txt"
node --version >> "$BUNDLE/env/runtime.txt" 2>&1 || echo "Node: N/A" >> "$BUNDLE/env/runtime.txt"
python3 --version >> "$BUNDLE/env/runtime.txt" 2>&1 || echo "Python: N/A" >> "$BUNDLE/env/runtime.txt"
uname -a >> "$BUNDLE/env/runtime.txt"
# 2. Replit environment variables (safe ones only)
echo "--- Replit Env ---" >> "$BUNDLE/env/replit-vars.txt"
echo "REPL_SLUG=$REPL_SLUG" >> "$BUNDLE/env/replit-vars.txt"
echo "REPL_OWNER=$REPL_OWNER" >> "$BUNDLE/env/replit-vars.txt"
echo "REPL_ID=$REPL_ID" >> "$BUNDLE/env/replit-vars.txt"
echo "REPLIT_DB_URL=${REPLIT_DB_URL:+SET}" >> "$BUNDLE/env/replit-vars.txt"
echo "DATABASE_URL=${DATABASE_URL:+SET}" >> "$BUNDLE/env/replit-vars.txt"
echo "NODE_ENV=${NODE_ENV:-unset}" >> "$BUNDLE/env/replit-vars.txt"
# 3. Package versions
npm list --depth=0 > "$BUNDLE/packages/npm.txt" 2>&1 || true
pip list > "$BUNDLE/packages/pip.txt" 2>&1 || true
# 4. Configuration files (redacted)
cp .replit "$BUNDLE/config/.replit" 2>/dev/null || echo "No .replit" > "$BUNDLE/config/.replit"
cp replit.nix "$BUNDLE/config/replit.nix" 2>/dev/null || echo "No replit.nix" > "$BUNDLE/config/replit.nix"
# 5. Database connectivity
echo "--- Database ---" >> "$BUNDLE/db/status.txt"
if [ -n "${DATABASE_URL:-}" ]; then
ecDeploy Replit apps with Autoscale, Reserved VM, and Static deployment types.
Replit Deploy Integration
Overview
Deploy applications on Replit's hosting platform. Three deployment types: Static (free, frontend-only), Autoscale (scales to zero, pay per request), and Reserved VM (always-on, fixed cost). Includes custom domain setup, health checks, rollbacks, and deployment monitoring.
Prerequisites
- Replit Core, Pro, or Teams plan (deployment access)
- Application working in Workspace ("Run" button)
- Custom domain (optional) with DNS access
Deployment Types
| Type | Best For | Pricing | Scale |
|---|---|---|---|
| Static | HTML/CSS/JS frontends | Free | CDN-backed, auto-cached |
| Autoscale | Variable traffic APIs | Per request | 0 to N instances |
| Reserved VM | Always-on services | $0.20+/day | Fixed resources |
Instructions
Step 1: Configure .replit for Deployment
# .replit — Autoscale deployment (most common)
entrypoint = "src/index.ts"
run = "npx tsx src/index.ts"
[nix]
channel = "stable-24_05"
[env]
NODE_ENV = "production"
[deployment]
run = ["sh", "-c", "npx tsx src/index.ts"]
build = ["sh", "-c", "npm ci --production && npm run build"]
deploymentTarget = "autoscale"
Reserved VM:
[deployment]
run = ["sh", "-c", "node dist/index.js"]
build = ["sh", "-c", "npm ci && npm run build"]
deploymentTarget = "cloudrun"
Static:
[deployment]
deploymentTarget = "static"
publicDir = "dist"
build = ["sh", "-c", "npm ci && npm run build"]
Step 2: Configure Secrets for Production
Workspace Secrets auto-sync to Deployments (2025+).
1. Click lock icon (Secrets) in sidebar
2. Add production secrets:
- DATABASE_URL (auto-populated by Replit PostgreSQL)
- API_KEY, JWT_SECRET, etc.
3. Verify in Deployment Settings > Environment Variables
Step 3: Add Health Check Endpoint
Replit monitors your deployment via health checks. Always include one:
// src/routes/health.ts
import { Router } from 'express';
import { pool } from '../services/db';
const router = Router();
router.get('/health', async (req, res) => {
const checks: Record<string, any> = {
status: 'ok',
uptime: process.uptime(),
timestamp: new Date().toISOString()Configure Replit Teams roles, SSO/SAML, custom groups, and organization-level access control.
Replit Enterprise RBAC
Overview
Manage team access to Replit workspaces, deployments, and AI features. Covers the built-in role system (Admin, Manager, Editor, Viewer), custom groups (Enterprise only), SSO/SAML integration, deployment permissions, and audit logging.
Prerequisites
- Replit Teams or Enterprise plan
- Organization Owner or Admin role
- SSO identity provider (Enterprise only): Okta, Azure AD, Google Workspace
Role Hierarchy
| Role | Create Repls | Deploy | Manage Members | Billing | AI Features |
|---|---|---|---|---|---|
| Owner | Yes | All | Yes | Yes | Yes |
| Admin | Yes | All | Yes | View only | Yes |
| Manager | Yes | Staging | Add/remove | No | Yes |
| Editor | Yes | No | No | No | Yes |
| Viewer | No | No | No | No | No |
Instructions
Step 1: Configure Organization Roles
In Organization Settings > Members:
1. Invite members:
- Click "Invite" > enter email
- Select role: Admin, Manager, Editor, or Viewer
- Member receives email invitation
2. Bulk management (2025+):
- CSV export of all members
- Sort/filter by role, activity, last login
- Bulk role changes
3. Role assignment strategy:
- Owners: 1-2 (billing + full admin)
- Admins: team leads (manage members + deploy)
- Managers: senior devs (deploy to staging)
- Editors: developers (create + code)
- Viewers: stakeholders (read-only access)
Step 2: Custom Groups (Enterprise Only)
Enterprise plan enables custom permission groups:
1. Organization Settings > Groups
2. Create group: e.g., "Backend Team"
3. Assign permissions:
- Access to specific Repls
- Deployment permissions (staging only, or all)
- AI feature access
4. Add members to group
Example groups:
- "Frontend Team": access to UI Repls, deploy to staging
- "DevOps": all Repls, deploy to production, manage secrets
- "Contractors": specific Repls only, no deployment access
- "QA": read all, deploy to staging, no production
Step 3: SSO/SAML Configuration (Enterprise Only)
Organization Settings > Security > SSO:
1. Choose provider:
- Okta
- Azure Active Directory
- Google Workspace
- Any SAML 2.0 compatible IdP
2. Configure SAML:
- ACS URL: provided by Replit
- Entity ID: provided by Replit
- Certificate: from your IdP
- Map IdP groups to RepliCreate a minimal working Replit app with database, object storage, and auth.
Replit Hello World
Overview
Build a working Replit app that demonstrates core platform services: Express/Flask server, Replit Database (key-value store), Object Storage (file uploads), Auth (user login), and PostgreSQL. Produces a running app you can deploy.
Prerequisites
- Replit App created (template or blank)
.replitandreplit.nixconfigured (seereplit-install-auth)- Node.js 18+ or Python 3.10+
Instructions
Step 1: Node.js — Express + Replit Database
// index.ts
import express from 'express';
import Database from '@replit/database';
const app = express();
const db = new Database();
app.use(express.json());
// Health check with Replit env vars
app.get('/health', (req, res) => {
res.json({
status: 'ok',
repl: process.env.REPL_SLUG,
owner: process.env.REPL_OWNER,
timestamp: new Date().toISOString(),
});
});
// Replit Key-Value Database CRUD
// Limits: 50 MiB total, 5,000 keys, 1 KB per key, 5 MiB per value
app.post('/api/items', async (req, res) => {
const { key, value } = req.body;
await db.set(key, value);
res.json({ stored: key });
});
app.get('/api/items/:key', async (req, res) => {
const value = await db.get(req.params.key);
if (value === null) return res.status(404).json({ error: 'Not found' });
res.json({ key: req.params.key, value });
});
app.get('/api/items', async (req, res) => {
const prefix = (req.query.prefix as string) || '';
const keys = await db.list(prefix);
res.json({ keys });
});
app.delete('/api/items/:key', async (req, res) => {
await db.delete(req.params.key);
res.json({ deleted: req.params.key });
});
const PORT = process.env.PORT || 3000;
app.listen(PORT, () => {
console.log(`Server running on port ${PORT}`);
console.log(`Repl: ${process.env.REPL_SLUG} by ${process.env.REPL_OWNER}`);
});
package.json dependencies:
{
"dependencies": {
"@replit/database": "^2.0.0",
"express": "^4.18.0"
},
"devDependencies": {
"@types/express": "^4.17.0",
"typescript": "^5.0.0"
}
}
Step 2: Python — Flask + Replit Database
# main.py
from flask import Flask, request, jsonify
from replit import db
import os
app = Flask(__name__)
@app.route('/health')
def health():
return jsonify({
'status': 'ok',
'repl': os.environ.get('REPL_SLUG'),
'owner': os.environ.get('REPL_OWNER'),
})
# Replit DB works like a Python dict
@app.route('/api/items', methods=['POST'])
def create_item():
data = request.jsExecute Replit incident response: triage deployment failures, database issues, and platform outages.
Replit Incident Runbook
Overview
Rapid incident response for Replit deployment failures, database issues, and platform outages. Covers triage, diagnosis, remediation, rollback, and communication.
Prerequisites
- Access to Replit Workspace and Deployment settings
- Deployment URL for health checks
- Communication channel (Slack, email)
- Rollback awareness (Deployment History)
Severity Levels
| Level | Definition | Response Time | Examples |
|---|---|---|---|
| P1 | Complete outage | < 15 min | App returns 5xx, DB down |
| P2 | Degraded service | < 1 hour | Slow responses, intermittent errors |
| P3 | Minor impact | < 4 hours | Non-critical feature broken |
| P4 | No user impact | Next business day | Monitoring gap |
Quick Triage (First 5 Minutes)
set -euo pipefail
DEPLOY_URL="https://your-app.replit.app"
echo "=== TRIAGE ==="
# 1. Check Replit platform status
echo -n "Replit Status: "
curl -s https://status.replit.com/api/v2/summary.json | \
python3 -c "import sys,json;print(json.load(sys.stdin)['status']['description'])" 2>/dev/null || \
echo "Check https://status.replit.com"
# 2. Check your deployment health
echo -n "App Health: "
curl -s -o /dev/null -w "HTTP %{http_code} (%{time_total}s)" "$DEPLOY_URL/health" 2>/dev/null || echo "UNREACHABLE"
echo ""
# 3. Get health details
echo "Health Response:"
curl -s "$DEPLOY_URL/health" 2>/dev/null | python3 -m json.tool 2>/dev/null || echo "No response"
# 4. Check if it's a cold start issue (Autoscale)
echo -n "Second request: "
curl -s -o /dev/null -w "HTTP %{http_code} (%{time_total}s)\n" "$DEPLOY_URL/health"
Decision Tree
App not responding?
├─ YES: Is status.replit.com reporting an incident?
│ ├─ YES → Platform issue. Wait for Replit. Communicate to users.
│ └─ NO → Your deployment issue. Continue below.
│
│ Can you access the Replit Workspace?
│ ├─ YES → Check deployment logs:
│ │ ├─ Build error → Fix code, redeploy
│ │ ├─ Runtime crash → Check logs, fix, redeploy
│ │ └─ Secret missing → Add to Secrets tab, redeploy
│ └─ NO → Network/browser issue. Try incognito window.
│
└─ App responds but with errors?
├─ 5xx errors → Check logs for crash/exception
├─ Slow responses → Check database, cold start, memory
└─ Auth not working → Verify deployment domain, not dev URL
Remediation by Error Type
Deployment Crash (5xx / App Unreachable)
1. Open RepliSet up a Replit project with .
Replit Install & Auth
Overview
Set up a Replit App from scratch: configure .replit and replit.nix, manage Secrets (AES-256 encrypted environment variables), and integrate Replit Auth for zero-setup user authentication with Google, GitHub, Apple, X, and Email login.
Prerequisites
- Replit account (Free, Core, or Teams plan)
- Replit App created from template, GitHub import, or blank
- For Auth: deployed app on
.replit.appor custom domain
Instructions
Step 1: Configure .replit File
# .replit — controls run behavior, deployment, and environment
entrypoint = "index.ts"
run = "npm start"
# Nix modules provide language runtimes
modules = ["nodejs-20:v8-20230920-bd784b9"]
[nix]
channel = "stable-24_05"
[env]
NODE_ENV = "development"
PORT = "3000"
[deployment]
run = ["sh", "-c", "npm start"]
deploymentTarget = "autoscale"
build = ["sh", "-c", "npm run build"]
ignorePorts = [3001]
[unitTest]
language = "nodejs"
[packager]
language = "nodejs"
[packager.features]
packageSearch = true
guessImports = true
[gitHubImport]
requiredFiles = [".replit", "replit.nix"]
Step 2: Configure replit.nix
# replit.nix — system-level dependencies via Nix
{ pkgs }: {
deps = [
pkgs.nodejs-20_x
pkgs.nodePackages.typescript-language-server
pkgs.nodePackages.pnpm
pkgs.postgresql
pkgs.python311
pkgs.python311Packages.pip
];
}
After editing replit.nix, reload the shell for changes to take effect.
Step 3: Configure Secrets
Secrets are encrypted with AES-256 at rest and TLS in transit. Two scopes:
- App-level: specific to one Replit App
- Account-level: shared across all your Apps
Via UI:
1. Click the lock icon (Secrets) in the left sidebar
2. Add key-value pairs:
- DATABASE_URL = postgresql://...
- API_KEY = sk-...
- JWT_SECRET = your-jwt-secret
Via code — validate at startup:
// src/config.ts
function requireSecrets(keys: string[]): Record<string, string> {
const missing = keys.filter(k => !process.env[k]);
if (missing.length > 0) {
console.error(`Missing secrets: ${missing.join(', ')}`);
console.error('Add them in the Secrets tab (lock icon in sidebar)');
process.exit(1);
}
return Object.fromEntries(keys.map(k => [k, process.env[k]!]));
}
const config = requireSecrets(['DATABASE_URL', 'JWT_SECRET']);
Secrets sync automatically between Workspace and Deployments. Replit'
Avoid the top Replit anti-patterns: ephemeral filesystem, public secrets, port binding, Nix gotchas, and database limits.
Replit Known Pitfalls
Overview
Real gotchas when building on Replit. Each pitfall includes what goes wrong, why, and the correct pattern. Based on common failures in Replit's ephemeral container model, Nix-based environment, and cloud hosting platform.
Pitfall Reference
1. Writing to Local Filesystem for Persistence
What happens: Data is lost when the container restarts, deploys, or sleeps.
# BAD — files disappear on container restart
with open("user_data.json", "w") as f:
json.dump(data, f)
# GOOD — use Replit's persistent storage
from replit import db
db["user_data"] = data
# For files, use Object Storage
from replit.object_storage import Client
storage = Client()
storage.upload_from_text("user_data.json", json.dumps(data))
Rule: Anything written to the filesystem is ephemeral. Use PostgreSQL, KV Database, or Object Storage for data that must survive restarts.
2. Hardcoding Secrets in Source Code
What happens: Secrets are visible to anyone who views your Repl (public by default on free plans). Replit's Secret Scanner catches some cases but not all.
# BAD — exposed in public Repl
API_KEY = "sk-live-abc123"
DATABASE_URL = "postgresql://user:password@host/db"
# GOOD — use Replit Secrets (lock icon in sidebar)
import os
API_KEY = os.environ["API_KEY"]
DATABASE_URL = os.environ["DATABASE_URL"]
3. Binding to localhost Instead of 0.0.0.0
What happens: App starts but Webview is blank. Replit's proxy can't reach the app.
// BAD — unreachable from Webview and deployments
app.listen(3000, '127.0.0.1');
app.listen(3000, 'localhost');
// GOOD — accessible to Replit's proxy
app.listen(3000, '0.0.0.0');
// BEST — use PORT env var
const PORT = parseInt(process.env.PORT || '3000');
app.listen(PORT, '0.0.0.0');
4. Ignoring Nix System Dependencies
What happens: Python packages with C extensions (Pillow, psycopg2, cryptography) fail to build with cryptic errors.
# BAD — missing system libraries
{ pkgs }: {
deps = [ pkgs.python311 ];
}
# GOOD — include system libraries for native packages
{ pkgs }: {
deps = [
pkgs.python311
pkgs.python311Packages.pip
pkgs.zlib # Required for Pillow
pkgs.libjpeg # Required for Pillow
pkgs.libffi # Required for cffi/cryptography
pkgs.openssl # Required for cryptography
pkgs.postgresql # Required for psycopg2
];
}
After editing replit.nix: Exit and re-enter the Shell tab to reload.
5. Using Replit KV Database fo
Load test and scale Replit deployments with Autoscale tuning, Reserved VM sizing, and capacity planning.
Replit Load & Scale
Overview
Load testing, scaling strategies, and capacity planning for Replit deployments. Covers Autoscale behavior tuning, Reserved VM right-sizing, cold start optimization, database connection scaling, and capacity benchmarking.
Prerequisites
- Replit app deployed (Autoscale or Reserved VM)
- Load testing tool: k6, autocannon, or curl
- Health endpoint implemented
Replit Scaling Model
| Deployment Type | Scaling Behavior | Cold Start | Best For |
|---|---|---|---|
| Autoscale | 0 to N instances based on traffic | Yes (5-30s) | Variable traffic |
| Reserved VM | Fixed resources, always-on | No | Consistent traffic |
| Static | CDN-backed, infinite scale | No | Frontend assets |
Instructions
Step 1: Baseline Benchmark
# Quick benchmark with autocannon (built into Node.js ecosystem)
npx autocannon -c 10 -d 30 https://your-app.replit.app/health
# -c 10: 10 concurrent connections
# -d 30: 30 seconds duration
# Output shows:
# - Requests/sec
# - Latency (p50, p95, p99)
# - Throughput (bytes/sec)
# - Error count
Step 2: Load Test with k6
// load-test.js — comprehensive Replit load test
import http from 'k6/http';
import { check, sleep } from 'k6';
import { Rate, Trend } from 'k6/metrics';
const errorRate = new Rate('errors');
const coldStartTrend = new Trend('cold_start_duration');
export const options = {
stages: [
{ duration: '1m', target: 5 }, // Warm up
{ duration: '3m', target: 20 }, // Normal load
{ duration: '2m', target: 50 }, // Peak load
{ duration: '1m', target: 0 }, // Cool down
],
thresholds: {
http_req_duration: ['p(95)<2000'], // 95% of requests under 2s
errors: ['rate<0.05'], // Error rate under 5%
},
};
const BASE_URL = __ENV.DEPLOY_URL || 'https://your-app.replit.app';
export default function () {
// Health check
const healthRes = http.get(`${BASE_URL}/health`);
check(healthRes, {
'health returns 200': (r) => r.status === 200,
'health under 1s': (r) => r.timings.duration < 1000,
});
errorRate.add(healthRes.status !== 200);
// Detect cold start
if (healthRes.timings.duration > 5000) {
coldStartTrend.add(healthRes.timings.duration);
}
// API endpoint
const apiRes = http.get(`${BASE_URL}/api/status`);
check(apiRes, {
'api returns 200': (r) => r.status === 200,
});
sleep(1);
}
# Run k6 load test
k6 run --env DEPLOY_URL=https://your-appConfigure Replit development workflow with hot reload, Webview, and Replit Agent.
Replit Local Dev Loop
Overview
Configure the Replit Workspace development cycle: run commands, hot reloading, port configuration, Webview preview, dev/production database separation, and Replit Agent for AI-assisted building.
Prerequisites
- Replit App with
.replitconfigured - Node.js or Python project initialized
- Familiarity with Replit Workspace UI
Instructions
Step 1: Configure Run Commands
# .replit — run determines what happens when you click "Run"
# Simple string command
run = "npm run dev"
# Array form (recommended for deployment)
# run = ["sh", "-c", "npm run dev"]
# Multiple services simultaneously
# run = "npm run api & npm run frontend & wait"
entrypoint = "index.ts"
Compiled languages need a compile step:
# TypeScript
compile = "npx tsc -b"
run = "node dist/index.js"
# Go
compile = "go build -o main ."
run = "./main"
Step 2: Hot Reload Setup
Node.js with tsx watch:
# .replit
run = "npx tsx watch src/index.ts"
{
"scripts": {
"dev": "tsx watch src/index.ts",
"test": "vitest",
"test:watch": "vitest --watch"
}
}
Python with Flask auto-reload:
run = "python main.py"
[env]
FLASK_DEBUG = "1"
# main.py — Flask auto-reloads in debug mode
if __name__ == '__main__':
app.run(host='0.0.0.0', port=3000, debug=True)
Vite/Next.js dev server:
run = "npm run dev"
[env]
PORT = "3000"
Step 3: Port Configuration
Replit routes external traffic to your app's port. Your app must listen on 0.0.0.0:
// Correct — Replit can reach this
app.listen(3000, '0.0.0.0', () => console.log('Ready'));
// Wrong — unreachable from Webview
// app.listen(3000, '127.0.0.1', () => ...);
[deployment]
run = ["sh", "-c", "npm start"]
deploymentTarget = "autoscale"
# Ignore ports used by dev tools only
ignorePorts = [3001, 5555]
Use the Networking tool in the sidebar to view active port mappings.
Step 4: Dev vs Production Database
Replit provides separate development and production databases:
// Databases auto-switch based on context:
// - Workspace "Run&quoMigrate to Replit from Heroku, Railway, Vercel, or local development environments.
Replit Migration Deep Dive
Current State
!cat .replit 2>/dev/null | head -10 || echo 'No .replit found'
!cat Procfile 2>/dev/null || echo 'No Procfile (not Heroku)'
!cat Dockerfile 2>/dev/null | head -10 || echo 'No Dockerfile'
!cat railway.json 2>/dev/null || echo 'No railway.json'
Overview
Comprehensive guide for migrating existing applications to Replit from Heroku, Railway, Vercel, Render, or local development. Covers converting configuration files, migrating databases, adapting to Replit's Nix-based environment, and setting up Replit-native features.
Prerequisites
- Source application with working deployment
- Access to current database for export
- Git repository with application code
- Replit Core or Teams plan
Migration Paths
| From | Complexity | Duration | Key Changes |
|---|---|---|---|
| Local dev | Low | 1-2 hours | Add .replit + replit.nix |
| Heroku | Medium | 2-4 hours | Procfile to .replit, addons to Replit services |
| Railway | Low-Medium | 1-3 hours | railway.json to .replit |
| Vercel | Low | 1-2 hours | Usually frontend-only, use Static deploy |
| Docker | Medium | 3-6 hours | Dockerfile to replit.nix |
Instructions
Step 1: Import from GitHub
1. Go to replit.com > Create Repl > Import from GitHub
2. Paste your repository URL
3. Replit auto-detects language and creates default config
4. Review and adjust .replit and replit.nix
Step 2: Convert from Heroku
Procfile to .replit:
# Heroku Procfile
web: npm start
worker: node worker.js
release: node migrate.js
# Equivalent .replit
run = "npm start"
entrypoint = "index.js"
[deployment]
run = ["sh", "-c", "node migrate.js && npm start"]
build = ["sh", "-c", "npm ci --production"]
deploymentTarget = "autoscale"
[env]
NODE_ENV = "production"
Heroku addons to Replit services:
| Heroku Addon | Replit Equivalent | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Heroku Postgres | Replit PostgreSQL (Database pane) | ||||||||||||||||||||||||||||||||||||||||
| Heroku Redis | Upstash Redis (external) or Replit KV | ||||||||||||||||||||||||||||||||||||||||
| Heroku Scheduler | Replit Automations or external cron | ||||||||||||||||||||||||||||||||||||||||
| Papertrail | Replit deployment logs + external | ||||||||||||||||||||||||||||||||||||||||
| SendGrid | Same (use API key in Secrets) | ||||||||||||||||||||||||||||||||||||||||
| Cloudina
Configure Replit dev/staging/production environments with separate databases, secrets, and deployment tiers.
ReadWriteEdit
Replit Multi-Environment SetupOverviewConfigure development, staging, and production environments on Replit. Leverages Replit's built-in dev/prod database separation, environment-specific secrets, and deployment types. Covers the Replit-native approach (single Repl, dual databases) and the multi-Repl approach (separate Repls per environment). Prerequisites
Environment StrategyApproach 1: Single Repl, Dual Databases (Recommended)Replit natively provides separate development and production databases:
Approach 2: Multi-Repl (Staging + Production)For teams that need a staging environment:
InstructionsStep 1: Environment Detection
Step 2: Environment-Specific ConfigurationMonitor Replit deployments with health checks, uptime tracking, resource usage, and alerting.
ReadWriteEdit
Replit ObservabilityOverviewMonitor Replit deployment health, track cold starts, measure resource usage, and set up alerting. Covers Replit's built-in monitoring, external health checking, structured logging, and integration with monitoring services. Prerequisites
InstructionsStep 1: Health Endpoint with Detailed Metrics
Step 2: Structured LoggingOptimize Replit app performance: cold start, memory, Nix caching, and deployment speed.
ReadWriteEdit
Replit Performance TuningOverviewOptimize Replit app performance across the entire lifecycle: cold start reduction, Nix environment caching, build speed, runtime memory management, and deployment configuration. Replit containers have resource limits — efficient usage is critical. Prerequisites
InstructionsStep 1: Reduce Cold Start TimeAutoscale deployments scale to zero when idle. First request triggers a cold start (10-30s). Minimize it:
Step 2: Optimize Nix Environment
Step 3: Optimize Build Step
Enforce security and resource policies for Replit-hosted apps: secrets exposure prevention, resource limits, deployment visibility, and database access controls.
ReadWriteEditBash(npx:*)
Replit Policy GuardrailsOverviewPolicy enforcement for Replit-hosted applications. Replit's public-by-default Repls, shared hosting, and resource limits require specific guardrails around secrets exposure, resource consumption, deployment security, and endpoint protection. Prerequisites
InstructionsStep 1: Secrets Exposure PreventionReplit Repls are public by default on free plans. Source code is visible to anyone.
Automated secret detection: Execute Replit production deployment checklist with rollback and health monitoring.
ReadBash(curl:*)Grep
Replit Production ChecklistOverviewComplete checklist for deploying Replit apps to production using Autoscale or Reserved VM deployments. Covers configuration, secrets, health checks, custom domains, rollback procedures, and monitoring. Prerequisites
Production Deployment ChecklistPhase 1: Configuration
Phase 2: Secrets
Phase 3: Health Check
Phase 4: Error Handling
Handle Replit resource limits: KV database caps, deployment quotas, and request throttling.
ReadWriteEdit
Replit Rate LimitsOverviewUnderstand and work within Replit's resource limits: Key-Value Database size caps, Object Storage quotas, deployment compute budgets, and egress allowances. Implement rate limiting in your own app for production safety. Prerequisites
Replit Platform LimitsKey-Value Database
Object Storage (App Storage)
PostgreSQL
Deployments
InstructionsStep 1: Monitor KV Database Usage
Step 2: Implement App-Level Rate LimitingImplement Replit reference architecture with best-practice project layout, data layer, and deployment.
ReadGrep
Replit Reference ArchitectureOverviewProduction architecture for applications on Replit. Covers project structure, configuration files, data layer (PostgreSQL + KV + Object Storage), authentication, deployment strategy, and the platform constraints that shape architectural decisions. Architecture Diagram
InstructionsStep 1: Project StructureImplement reliability patterns for Replit: cold start handling, graceful shutdown, persistent state, and keep-alive.
ReadWriteEdit
Replit Reliability PatternsOverviewProduction reliability patterns for Replit's container-based hosting. Replit containers restart on deploy, sleep on inactivity (Autoscale), and have ephemeral filesystems. These patterns ensure your app survives container lifecycle events gracefully. Prerequisites
Container Lifecycle
InstructionsStep 1: Graceful Startup
Step 2: Graceful ShutdownReplit sends SIGTERM before stopping containers. Save state during shutdown. Apply production-ready patterns for Replit Database, Object Storage, and Auth APIs.
ReadWriteEdit
Replit SDK PatternsOverviewProduction-ready patterns for Replit's built-in services: Key-Value Database ( Prerequisites
InstructionsStep 1: Database Client Singleton (Node.js)
Step 2: Object Storage Wrapper
Step 3: PostgreSQL Connection PoolApply Replit security best practices: Secrets management, REPL_IDENTITY tokens, Auth headers, and public Repl safety.
ReadWriteGrep
Replit Security BasicsOverviewSecurity best practices for Replit: Secrets (AES-256 encrypted env vars), REPL_IDENTITY token verification, Auth header trust model, public Repl exposure risks, and Secret Scanner protection. Prerequisites
InstructionsStep 1: Secrets ManagementReplit Secrets are AES-256 encrypted at rest with TLS in transit. Keys rotate regularly. Two scopes:
Secret Scanner: Replit detects when you paste API keys into code files and warns you to store them as Secrets instead. Never dismiss this warning. Step 2: Public Repl SafetyReplit Repls are public by default on free plans. Your source code is visible to anyone.
Step 3: REPL_IDENTITY Token VerificationEvery Repl gets a Upgrade Replit Nix channels, migrate between database types, and update deployment targets.
ReadWriteEditBash(npm:*)Bash(pip:*)
Replit Upgrade & MigrationCurrent State! ! OverviewGuide for upgrading Replit environments: Nix channel updates, package version bumps, database migrations (KV to PostgreSQL, dev to prod), deployment type changes, and Node.js/Python runtime upgrades. Prerequisites
InstructionsStep 1: Upgrade Nix ChannelNix channels determine available package versions. Upgrade to get newer runtimes.
After changing the channel, reload the shell (exit Shell tab and re-enter). Then verify:
Step 2: Upgrade Node.js or Python Runtime
Verify after upgrade:
Step 3: Migrate from Replit KV to PostgreSQLWhen your app outgrows the 50 MiB KV database limit: Handle Replit deployment events, build Replit Extensions, and set up Agents & Automations.
ReadWriteEditBash(curl:*)
Replit Webhooks & EventsOverviewIntegrate with Replit's event ecosystem: deployment lifecycle hooks, Replit Extensions API for workspace customization, and Agents & Automations for scheduled tasks and chatbots. Also covers external webhook endpoints hosted on Replit. Prerequisites
InstructionsStep 1: Deployment Lifecycle MonitoringMonitor deployment events by polling or building a status dashboard:
Step 2: External Webhook ReceiverHost webhook endpoints on Replit to receive events from external services: Ready to use replit-pack?Related Plugins000-jeremy-content-consistency-validatorRead-only validator that generates comprehensive discrepancy reports comparing messaging consistency across ANY HTML-based website (WordPress, Hugo, Next.js, React, Vue, static HTML, etc.), GitHub repositories, and local documentation. Detects mixed messaging without making changes. 002-jeremy-yaml-master-agentIntelligent YAML validation, generation, and transformation agent with schema inference, linting, and format conversion capabilities 003-jeremy-vertex-ai-media-masterComprehensive Google Vertex AI multimodal mastery for Jeremy - video processing (6+ hours), audio generation, image creation with Gemini 2.0/2.5 and Imagen 4. Marketing campaign automation, content generation, and media asset production. 004-jeremy-google-cloud-agent-sdkGoogle Cloud Agent Development Kit (ADK) and Agent Starter Pack mastery - build containerized multi-agent systems with production-ready templates, deploy to Cloud Run/GKE/Agent Engine, RAG agents, ReAct agents, and multi-agent orchestration. agent-context-managerAutomatically detects and loads AGENTS.md files to provide agent-specific instructions ai-commit-genAI-powered commit message generator - analyzes your git diff and creates conventional commit messages instantly
Tags
replitcloud-idedeploymentscollaborativeai-codingbrowser-idehosting
|