| name | replit-hello-world |
| description | Create a minimal working Replit app with database, object storage, and auth.
Use when starting a new Replit project, testing your setup,
or learning Replit's built-in services (DB, Auth, Object Storage).
Trigger with phrases like "replit hello world", "replit starter",
"replit quick start", "first replit app", "replit example".
|
| allowed-tools | Read, Write, Edit, Bash(npm:*), Bash(pip:*) |
| version | 1.12.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","replit","starter","database","api"] |
| compatibility | Designed for Claude Code, also compatible with Codex and OpenClaw |
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)
.replit and replit.nix configured (see replit-install-auth)
- Node.js 18+ or Python 3.10+
Instructions
Step 1: Node.js — Express + Replit Database
import express from 'express';
import Database from '@replit/database';
const app = express();
const db = new Database();
app.use(express.json());
app.get('/health', (req, res) => {
res.json({
status: 'ok',
repl: process.env.REPL_SLUG,
owner: process.env.REPL_OWNER,
timestamp: new Date().toISOString(),
});
});
app.post('/api/items', async (req, res) => {
{ key, value } = req.;
db.(key, value);
res.({ : key });
});
app.(, (req, res) => {
value = db.(req..);
(value === ) res.().({ : });
res.({ : req.., value });
});
app.(, (req, res) => {
prefix = (req.. ) || ;
keys = db.(prefix);
res.({ keys });
});
app.(, (req, res) => {
db.(req..);
res.({ : req.. });
});
= process.. || ;
app.(, {
.();
.();
});