Localhost Server Manager
by envizionwork
Spin up a secure background environment in seconds with zero configuration. No Apache. No Nginx. No nonsense.
lsm start --port 3000 --host 127.0.0.1 --ssl --watch
Spin up a secure background environment in seconds with zero configuration. No Apache. No Nginx. No nonsense.
lsm start --port 3000 --host 127.0.0.1 --ssl --watch
Click any card to open a full terminal guide with code, connections, and deep explanations.
Connect terminal to Google Colab GPUs via SSH to fine-tune AI models locally using LoRA.
Understand the exact differences between Gemini/ChatGPT massive training vs. Local LoRA fine-tuning.
Free, complete examples for running LLMs offline, building custom Modelfiles, and API integration.
Containerize your Node.js apps. Terminal commands to build, run, and link containers.
Generate keys, connect to remote Linux servers, and manage config files securely.
Automate your deployments directly from terminal pushes using YAML pipelines.
Route multiple localhost apps to domain names with Certbot SSL on a VPS.
The essential `psql` terminal commands for dumping, restoring, and querying databases.
Isolate AI dependencies securely using virtual environments and `requirements.txt`.
Setup a two-way real-time communication server in Node.js tested via terminal.
Connect VS Code to remote SSH servers, Docker containers, and WSL2 for seamless local-feeling development.
Deploy, scale, and manage containerized apps with kubectl. From pods to services to ingress controllers.
Securely manage secrets, API keys, and config across dev, staging, and production environments.
Implement stateless JSON Web Token auth flows in Node.js — sign, verify, refresh tokens and protect routes.
Design clean, versioned REST APIs with proper status codes, pagination, filtering, and error handling.
Write unit, integration, and E2E tests with Jest, Vitest, and Playwright for bulletproof applications.
Rebase, cherry-pick, bisect, stash strategies and branching models for professional team development.
Workspaces, lock files, peer deps, publishing packages, and monorepo management from the terminal.
Bundle JS/CSS assets, configure HMR, code splitting, tree shaking, and production optimizations.
Deploy apps to EC2, manage S3 buckets, configure IAM, and automate with CloudFormation via terminal.
Connect web apps to Firestore, authenticate users, write security rules, and deploy to Firebase Hosting.
Design schemas, write aggregation pipelines, index strategies, and connect Node.js apps to MongoDB Atlas.
Cache API responses, store sessions, implement pub/sub, and use Redis as a fast key-value store.
Configure NGINX and HAProxy to distribute traffic, handle failover, and scale horizontally.
Generate self-signed certs, use Let's Encrypt Certbot, configure HSTS, and force HTTPS redirects.
Connect to OpenAI, Claude, Gemini, and Mistral APIs — streaming responses, tool calls, and embeddings.
Set up Open WebUI as a ChatGPT-like interface for your local Ollama models with custom personas.
Build RAG systems, agent chains, memory modules, and tool-using AI pipelines with LangChain.
Use the browser's native File System API to read/write local files without a backend server.
Use ps, top, htop, kill, systemctl, and cron to manage running services and scheduled jobs.
Convert .md files to styled HTML at build time using marked, remark, or pandoc.
Master the Network, Performance, Memory, and Sources panels for debugging production web apps.
Build production-grade Python REST APIs with FastAPI — async endpoints, Pydantic models, auth, and docs.
Send transactional emails with Nodemailer, SendGrid, Resend, and Mailgun from Node.js and Python.
Lighthouse audits, lazy loading, image compression, critical CSS, and Core Web Vitals fixes.
Embed a full SQL database in your app with better-sqlite3 and sqlite3 — zero setup, no server needed.
Build a GraphQL schema, write resolvers, handle subscriptions, and consume with Apollo Client.
Resize, convert, compress, and watermark images in bulk using Sharp (Node.js) and ImageMagick.
Configure tsconfig, strict mode, path aliases, declaration files, and type-safe API contracts.
Configure A records, CNAMEs, MX records, SPF, DKIM, and DMARC for custom domains.
Make any web app installable on mobile with Web App Manifest, offline caching, and push notifications.
Render 3D scenes in the browser — meshes, lights, cameras, textures, animations, and GLTF loading.
Implement Google, GitHub, Discord OAuth login flows with Passport.js and NextAuth.
Create repos, manage issues, trigger workflows, and read org data with the GitHub REST and GraphQL APIs.
Build peer-to-peer video calls and screen sharing with WebRTC, STUN servers, and Socket.io signaling.
Build Chrome/Firefox extensions with Manifest V3 — content scripts, background workers, and storage.
Write production shell scripts — loops, conditions, functions, argument parsing, error handling, cron.
Reduce final image size 10x with multi-stage Dockerfiles — separate build and runtime environments.
Deploy serverless JS/TypeScript at the edge globally with zero cold starts and KV storage.
Turn a Raspberry Pi or old PC into a local dev server with Ubuntu Server, SSH, and reverse proxy.
Index documents, run fuzzy queries, aggregations, and build autocomplete with Elasticsearch and Kibana.
Monitor server metrics, set up dashboards, configure alerts for CPU, memory, and response times.
Write Makefile targets to automate build, test, lint, docker-up, and deploy commands.
Provision cloud resources on AWS/GCP/Azure with Terraform modules and state management.
Store, rotate, and inject secrets securely with HashiCorp Vault and environment injection patterns.
Offload CPU-intensive tasks to worker threads and run parallel JS code without blocking the event loop.
Build Server-Sent Events, NDJSON streams, and chunked transfer responses for real-time AI output.
Implement stacks, queues, linked lists, trees, and graphs with practical use-case examples.
Build no-code/code automation flows connecting APIs, databases, AI, and services with n8n locally.
Build iOS and Android apps with React Native — navigation, native modules, and Expo setup.
Fix CORS errors, configure allowed origins, handle preflight requests, and secure your API headers.
Manage multiple apps and packages in one repo with Turborepo's caching and pipeline system.
Generate text embeddings with OpenAI/Ollama, store in Chroma/Pinecone, and build semantic search.
Download and run BERT, GPT-2, Whisper, and CLIP models locally with the HuggingFace pipeline API.
Split terminal panes, attach/detach sessions, and keep processes running after SSH disconnection.
Scrape dynamic websites, take screenshots, fill forms, and automate browsers with Puppeteer/Playwright.
Write regular expressions for validation, extraction, replacement, and parsing with real-world examples.
Drop-in Node.js replacement with 10x faster startup — scripts, bundler, test runner, and package manager.
Set up ngrok, Cloudflare Tunnel, and localtunnel to expose localhost to the internet securely.
Configure GitLab CI pipelines with stages, runners, caching, environments, and deploy jobs.
Clean, transform, filter, group, and visualize datasets with Python Pandas and Matplotlib.
Write test scripts, chain requests, use environments, and mock servers for API development.
Handle multipart file uploads in Node.js with multer, validate types, stream to S3, and generate thumbnails.
Generate tones, load audio buffers, apply filters, and build visualizers in the browser.
Write screen-reader-friendly HTML, ARIA labels, keyboard nav, and meet WCAG 2.1 AA standards.
Connect sensors and devices with MQTT broker (Mosquitto), publish/subscribe, and visualize data.
Securely hash passwords, configure salt rounds, and implement rate-limiting for login endpoints.
Window functions, CTEs, JSONB operations, explain analyze, and query optimization techniques.
Configure ESLint, Prettier, Husky pre-commit hooks, and lint-staged for clean codebases.
Add multi-language support with i18next, locale routing, RTL layouts, and pluralization rules.
Configure Cloudflare CDN, set cache headers, purge cache, and optimize global asset delivery.
Sitemap generation, robots.txt, Open Graph tags, structured data, and SSR for search engine crawling.
Async/await patterns, Promise.all, race conditions, mutex locks, and parallel task management.
Write forward and rollback SQL migrations with Flyway, Liquibase, Prisma Migrate, and Knex.
Build live charts with Chart.js, Recharts, and D3.js connected to WebSocket data streams.
Split monoliths into services — API gateways, service discovery, circuit breakers, and event buses.
Implement token bucket rate limiting, IP blocking, and Cloudflare WAF rules in Node.js and NGINX.
Design system prompts, few-shot examples, chain-of-thought, and structured output for AI models.
Upload, download, stream, and generate presigned URLs with AWS S3, MinIO, and Backblaze B2.
Define .proto schemas, generate client/server stubs, and build high-performance binary RPC APIs.
Full pipeline for fine-tuning LLMs on custom datasets using Axolotl — config YAML, training, and merging.
Scale CSS maintainably with BEM naming, utility classes, design tokens, and component patterns.
Find memory leaks with heapdumps, clinic.js, and Chrome DevTools memory profiler in production.
Receive, validate (HMAC), queue, and reliably process webhooks from Stripe, GitHub, and Shopify.
Write reliable E2E tests, visual regression tests, and CI integration with Playwright Test runner.
Produce and consume events, manage topics, consumer groups, and offsets with Kafka and kafkajs.
Deploy TypeScript at the edge with Deno Deploy, Vercel Edge Functions, and Netlify Edge.
Implement Zero Trust networking — mTLS, service mesh, identity-based access, and Tailscale.
Instrument your app with traces, metrics, and logs using OpenTelemetry and export to Jaeger/Grafana.
Production-ready checklist: env vars, HTTPS, CORS, rate limits, logging, monitoring, backups, and rollback.
Deploy templates, CSS frameworks, JS libraries, and free APIs — all in one place. Click any card to expand.
Drop this in your project root. Run node server.js and it spins up immediately on port 3000, auto-opening your browser.
import express from 'express';
import { createServer } from 'http';
import open from 'open';
const app = express();
const PORT = process.env.PORT || 3000;
app.use(express.json());
app.use(express.static('public'));
app.get('/', (_req, res) => res.send('<h1>Server running ✔</h1>'));
app.get('/health', (_req, res) => res.json({ status:'ok', uptime: process.uptime() }));
const server = createServer(app);
server.listen(PORT, () => {
console.log(`\n✔ Server: http://localhost:${PORT}`);
// Auto-open browser on start
open(`http://localhost:${PORT}`).catch(() => {});
});Production-ready FastAPI app with CORS, health endpoint, and Swagger UI at /docs. Run with uvicorn main:app --reload.
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
import uvicorn
app = FastAPI(title="My API", version="1.0.0")
app.add_middleware(CORSMiddleware,
allow_origins=["*"], allow_methods=["*"], allow_headers=["*"])
@app.get("/")
def root():
return {"message": "FastAPI running ✔", "docs": "/docs"}
@app.get("/health")
def health():
return {"status": "ok"}
if __name__ == "__main__":
uvicorn.run("main:app", host="0.0.0.0", port=8000, reload=True)Three-service stack: Node.js app, PostgreSQL database, and Redis cache. Run docker compose up.
version: '3.9'
services:
app:
build: .
ports: ["3000:3000"]
environment:
DATABASE_URL: postgres://user:pass@db:5432/appdb
REDIS_URL: redis://cache:6379
depends_on: [db, cache]
volumes: [".:/app", "/app/node_modules"]
db:
image: postgres:16-alpine
environment: { POSTGRES_USER: user, POSTGRES_PASSWORD: pass, POSTGRES_DB: appdb }
volumes: [pgdata:/var/lib/postgresql/data]
ports: ["5432:5432"]
cache:
image: redis:7-alpine
ports: ["6379:6379"]
volumes:
pgdata:Full CI pipeline: runs tests on every PR, deploys to production server via SSH on merge to main.
CI/CDGitHub Actionsname: Deploy to Production
on:
push:
branches: [main]
jobs:
test-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: '20' }
- run: npm ci
- run: npm test --if-present
- name: Deploy via SSH
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_KEY }}
script: |
cd ~/app && git pull origin main
npm ci --omit=dev && pm2 restart allProduction NGINX config routing a domain to your Node app with WebSocket support and security headers.
NGINXSSL/TLSserver {
listen 80; listen [::]:80;
server_name yourdomain.com www.yourdomain.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
server_name yourdomain.com;
ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem;
add_header X-Frame-Options DENY; add_header X-Content-Type-Options nosniff;
location / {
proxy_pass http://127.0.0.1:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}Full WebSocket server with room-based broadcasting, heartbeat ping/pong, and graceful reconnect logic.
WebSocketsNode.jsimport { WebSocketServer } from 'ws';
const wss = new WebSocketServer({ port: 8080 });
const rooms = new Map();
wss.on('connection', (ws) => {
ws.isAlive = true;
ws.on('pong', () => { ws.isAlive = true; });
ws.on('message', (raw) => {
const msg = JSON.parse(raw);
if (msg.type === 'join') {
ws.room = msg.room;
if (!rooms.has(msg.room)) rooms.set(msg.room, new Set());
rooms.get(msg.room).add(ws);
} else if (msg.type === 'broadcast' && ws.room) {
rooms.get(ws.room)?.forEach(c => {
if (c !== ws && c.readyState === 1) c.send(JSON.stringify(msg));
});
}
});
ws.on('close', () => rooms.get(ws.room)?.delete(ws));
});
// Heartbeat — prune dead connections every 30s
setInterval(() => {
wss.clients.forEach(ws => {
if (!ws.isAlive) return ws.terminate();
ws.isAlive = false; ws.ping();
});
}, 30000);
console.log('WS Server running at ws://localhost:8080');Drop-in JWT middleware for Express with access + refresh token rotation. Set JWT_SECRET in your .env.
import jwt from 'jsonwebtoken';
const SECRET = process.env.JWT_SECRET || 'change-me';
const REFRESH = process.env.JWT_REFRESH || 'refresh-secret';
export function signTokens(payload) {
const access = jwt.sign(payload, SECRET, { expiresIn: '15m' });
const refresh = jwt.sign(payload, REFRESH, { expiresIn: '7d' });
return { access, refresh };
}
export function verifyAccess(req, res, next) {
const token = req.headers.authorization?.split(' ')[1];
if (!token) return res.status(401).json({ error: 'No token' });
try {
req.user = jwt.verify(token, SECRET);
next();
} catch { res.status(401).json({ error: 'Invalid/expired token' }); }
}
export function refreshAccess(req, res) {
const { refreshToken } = req.body;
if (!refreshToken) return res.status(401).json({ error: 'No refresh token' });
try {
const payload = jwt.verify(refreshToken, REFRESH);
const { iat, exp, ...data } = payload;
res.json(signTokens(data));
} catch { res.status(401).json({ error: 'Refresh token invalid' }); }
}Complete .env template covering DB, cache, APIs, auth, storage, and email. Never commit the real file.
ConfigSecurity# === App === NODE_ENV=development PORT=3000 APP_URL=http://localhost:3000 # === Database === DATABASE_URL=postgresql://user:pass@localhost:5432/mydb REDIS_URL=redis://localhost:6379 # === Auth === JWT_SECRET=your-super-secret-key-here JWT_REFRESH=your-refresh-secret-here SESSION_SECRET=another-secret # === Storage === AWS_ACCESS_KEY_ID= AWS_SECRET_ACCESS_KEY= AWS_BUCKET=my-bucket AWS_REGION=us-east-1 # === Email === SMTP_HOST=smtp.sendgrid.net SMTP_PORT=587 SMTP_USER=apikey SMTP_PASS=your-sendgrid-api-key # === APIs === OPENAI_API_KEY=sk-... STRIPE_SECRET_KEY=sk_test_...
Multi-stage build: heavy build stage + minimal Alpine runtime. Final image under 100MB.
DockerProduction# Stage 1: Build FROM node:20-alpine AS builder WORKDIR /app COPY package*.json ./ RUN npm ci COPY . . RUN npm run build --if-present # Stage 2: Production FROM node:20-alpine AS runner RUN addgroup -S app && adduser -S app -G app WORKDIR /app COPY --from=builder /app/node_modules ./node_modules COPY --from=builder /app/dist ./dist COPY --from=builder /app/package.json . USER app EXPOSE 3000 ENV NODE_ENV=production CMD ["node", "dist/server.js"]
Vite config with API proxy to backend, path aliases, and chunk splitting for production.
ReactViteimport { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import path from 'path';
export default defineConfig({
plugins: [react()],
resolve: { alias: { '@': path.resolve(__dirname, 'src') } },
server: {
port: 5173,
open: true,
proxy: {
'/api': { target: 'http://localhost:3000', changeOrigin: true }
}
},
build: {
outDir: 'dist',
rollupOptions: {
output: {
manualChunks: { vendor: ['react','react-dom'] }
}
}
}
});Full Prisma schema with User, Post, and Session models + a seed script. Run npx prisma migrate dev.
generator client { provider = "prisma-client-js" }
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model User {
id String @id @default(cuid())
email String @unique
name String?
password String
role Role @default(USER)
posts Post[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model Post {
id String @id @default(cuid())
title String
body String
published Boolean @default(false)
author User @relation(fields: [authorId], references: [id])
authorId String
createdAt DateTime @default(now())
}
enum Role { USER ADMIN MOD }Redis utility module for session storage, API response caching, and rate limiting with ioredis.
RedisCacheimport Redis from 'ioredis';
export const redis = new Redis(process.env.REDIS_URL || 'redis://localhost:6379');
// Cache wrapper with TTL
export async function cached(key, ttlSec, fetchFn) {
const hit = await redis.get(key);
if (hit) return JSON.parse(hit);
const data = await fetchFn();
await redis.setex(key, ttlSec, JSON.stringify(data));
return data;
}
// Simple rate limiter: max `limit` requests per `windowSec`
export async function rateLimit(identifier, limit = 100, windowSec = 60) {
const key = `rl:${identifier}`;
const count = await redis.incr(key);
if (count === 1) await redis.expire(key, windowSec);
return { allowed: count <= limit, count, limit };
}
redis.on('connect', () => console.log('✔ Redis connected'));
redis.on('error', (e) => console.error('Redis error:', e));Deploy serverless JS at Cloudflare's edge with routing, KV storage reads, and geo-based redirects.
EdgeServerlessexport default {
async fetch(request, env) {
const url = new URL(request.url);
const country = request.cf?.country || 'US';
// Simple router
if (url.pathname === '/api/hello') {
return Response.json({ message: 'Hello from the edge!', country });
}
if (url.pathname === '/api/config') {
// Read from KV binding (add MY_KV in wrangler.toml)
const config = await env.MY_KV.get('app-config', 'json');
return Response.json(config || {});
}
// Geo-redirect example
if (country === 'AU') {
return Response.redirect('https://au.yourdomain.com' + url.pathname, 302);
}
return new Response('Not found', { status: 404 });
}
};Next.js 14 App Router API route with typed request/response, auth middleware, and error handling.
Next.jsTypeScriptimport { NextRequest, NextResponse } from 'next/server';
export async function GET(req: NextRequest) {
const token = req.headers.get('authorization')?.split(' ')[1];
if (!token) return NextResponse.json({ error: 'Unauthorized' }, { status: 401 });
try {
const data = await fetchData();
return NextResponse.json(data, {
headers: { 'Cache-Control': 's-maxage=60, stale-while-revalidate' }
});
} catch (err) {
return NextResponse.json({ error: 'Internal server error' }, { status: 500 });
}
}
export async function POST(req: NextRequest) {
const body = await req.json();
// Validate body here with Zod or similar
return NextResponse.json({ success: true, received: body }, { status: 201 });
}
async function fetchData() {
return { items: [], total: 0, timestamp: Date.now() };
}Complete AI/ML Python dependency stack. Run pip install -r requirements.txt inside a virtualenv.
# Core AI / ML torch==2.2.0 torchvision==0.17.0 transformers==4.38.0 datasets==2.17.0 accelerate==0.26.0 peft==0.8.0 bitsandbytes==0.42.0 # LangChain ecosystem langchain==0.1.9 langchain-openai==0.0.7 chromadb==0.4.22 # API + server fastapi==0.109.0 uvicorn[standard]==0.27.0 httpx==0.26.0 # Data pandas==2.1.4 numpy==1.26.3 scikit-learn==1.4.0 # Utils python-dotenv==1.0.0 pydantic==2.6.0
Drop into /etc/ssh/sshd_config. Disables password auth, restricts access to named users, sets max tries.
Port 2222 AddressFamily inet ListenAddress 0.0.0.0 # Disable root and password login PermitRootLogin no PasswordAuthentication no ChallengeResponseAuthentication no UsePAM yes # Use public key only PubkeyAuthentication yes AuthorizedKeysFile .ssh/authorized_keys # Rate limit MaxAuthTries 3 MaxSessions 5 LoginGraceTime 30 # Restrict to specific users (add yours) AllowUsers deploy ubuntu # Disable unused features X11Forwarding no AllowAgentForwarding no AllowTcpForwarding no PermitTunnel no
Provisions a t3.micro EC2 instance with security group + S3 bucket. Run terraform init && terraform apply.
terraform {
required_providers { aws = { source = "hashicorp/aws", version = "~> 5.0" } }
}
provider "aws" { region = "us-east-1" }
resource "aws_security_group" "web" {
name = "web-sg"
ingress { from_port = 80 to_port = 80 protocol = "tcp" cidr_blocks = ["0.0.0.0/0"] }
ingress { from_port = 443 to_port = 443 protocol = "tcp" cidr_blocks = ["0.0.0.0/0"] }
ingress { from_port = 2222 to_port = 2222 protocol = "tcp" cidr_blocks = ["0.0.0.0/0"] }
egress { from_port = 0 to_port = 0 protocol = "-1" cidr_blocks = ["0.0.0.0/0"] }
}
resource "aws_instance" "app" {
ami = "ami-0c02fb55956c7d316" # Amazon Linux 2023
instance_type = "t3.micro"
vpc_security_group_ids = [aws_security_group.web.id]
tags = { Name = "app-server" }
}
resource "aws_s3_bucket" "assets" {
bucket = "my-app-assets-${random_id.suffix.hex}"
}
resource "random_id" "suffix" { byte_length = 4 }PM2 ecosystem file: runs your app in cluster mode, manages env variables, and auto-restarts on crash.
PM2Productionmodule.exports = {
apps: [{
name: 'my-app',
script: './dist/server.js',
instances: 'max', // Use all CPU cores
exec_mode: 'cluster',
watch: false,
max_memory_restart: '500M',
env: {
NODE_ENV: 'development',
PORT: 3000
},
env_production: {
NODE_ENV: 'production',
PORT: 3000
},
error_file: './logs/err.log',
out_file: './logs/out.log',
log_date_format: 'YYYY-MM-DD HH:mm:ss',
restart_delay: 4000,
max_restarts: 10
}]
};Auto-instruments your Node.js app. Import at the very top of your entry file before anything else.
OTelObservabilityimport { NodeSDK } from '@opentelemetry/sdk-node';
import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http';
import { getNodeAutoInstrumentations } from '@opentelemetry/auto-instrumentations-node';
import { Resource } from '@opentelemetry/resources';
import { SEMRESATTRS_SERVICE_NAME } from '@opentelemetry/semantic-conventions';
const sdk = new NodeSDK({
resource: new Resource({
[SEMRESATTRS_SERVICE_NAME]: process.env.SERVICE_NAME || 'my-service'
}),
traceExporter: new OTLPTraceExporter({
url: process.env.OTEL_EXPORTER_OTLP_ENDPOINT || 'http://localhost:4318/v1/traces'
}),
instrumentations: [getNodeAutoInstrumentations()]
});
sdk.start();
console.log('✔ OpenTelemetry tracing initialised');
process.on('SIGTERM', () => sdk.shutdown());Verified Stripe webhook endpoint handling payment, subscription, and refund events securely.
StripePaymentsimport Stripe from 'stripe';
import express from 'express';
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY);
const router = express.Router();
// IMPORTANT: raw body needed for signature verification
router.post('/webhook', express.raw({ type: 'application/json' }), (req, res) => {
const sig = req.headers['stripe-signature'];
let event;
try {
event = stripe.webhooks.constructEvent(req.body, sig, process.env.STRIPE_WEBHOOK_SECRET);
} catch (err) {
return res.status(400).send(`Webhook Error: ${err.message}`);
}
switch (event.type) {
case 'payment_intent.succeeded':
console.log('Payment succeeded:', event.data.object.id); break;
case 'customer.subscription.created':
console.log('Subscription created:', event.data.object.id); break;
case 'invoice.payment_failed':
console.log('Payment failed:', event.data.object.id); break;
default:
console.log('Unhandled event:', event.type);
}
res.json({ received: true });
});
export default router;Add Tailwind to any HTML file instantly with the Play CDN — no build step required for prototyping.
Utility-firstv3.4<!-- Tailwind CSS Play CDN (dev/prototyping only) --> <script src="https://cdn.tailwindcss.com"></script> <!-- For production: npm install tailwindcss -->
The most widely used CSS framework. Responsive grid, prebuilt components, and JS plugins included.
Bootstrap 5.3<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet"> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
Semantic component classes for Tailwind. Buttons, modals, cards, and more with theming support.
DaisyUI 4<link href="https://cdn.jsdelivr.net/npm/daisyui@4.7.3/dist/full.min.css" rel="stylesheet"> <script src="https://cdn.tailwindcss.com"></script>
Pure CSS framework using Flexbox. No JavaScript required — just classes. Great for clean layouts.
Bulma 1.0<link href="https://cdn.jsdelivr.net/npm/bulma@1.0.1/css/bulma.min.css" rel="stylesheet">
Classless CSS framework — just write semantic HTML and it looks great. Perfect for documentation.
Pico 2<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.min.css">
76+ CSS animations. Add class animate__animated animate__fadeIn to any element.
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css"> <!-- Usage: --> <h1 class="animate__animated animate__fadeInUp">Hello</h1>
Copy-paste glassmorphism effect for cards and modals. Works in all modern browsers.
Snippet.glass {
background: rgba(255, 255, 255, 0.08);
backdrop-filter: blur(16px);
-webkit-backdrop-filter: blur(16px);
border: 1px solid rgba(255, 255, 255, 0.12);
border-radius: 16px;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}
.glass-dark {
background: rgba(0, 0, 0, 0.3);
backdrop-filter: blur(20px) saturate(180%);
border: 1px solid rgba(255, 255, 255, 0.06);
border-radius: 12px;
}The most popular charting library. Line, bar, pie, radar, scatter — all responsive and animated.
Chart.js 4<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<canvas id="myChart" width="400" height="200"></canvas>
<script>
new Chart(document.getElementById('myChart'), {
type: 'line',
data: { labels: ['Jan','Feb','Mar'], datasets: [{ data: [10,20,15] }] }
});
</script>Industry-standard animation library. Smooth tweens, timelines, ScrollTrigger, and morphing SVG.
GSAP 3<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/gsap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/ScrollTrigger.min.js"></script>
<script>
gsap.registerPlugin(ScrollTrigger);
gsap.from('.hero', { opacity: 0, y: 60, duration: 1, ease: 'power3.out' });
</script>Add reactive behaviour directly in HTML with x-data, x-on, and x-bind — no build step.
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script>
<div x-data="{ open: false }">
<button @click="open = !open">Toggle</button>
<p x-show="open" x-transition>Hello Alpine!</p>
</div>Fast Markdown → HTML parser. Great for rendering user content, READMEs, and documentation.
Marked 12<script src="https://cdn.jsdelivr.net/npm/marked@12/marked.min.js"></script>
<script>
const html = marked.parse('## Hello\nThis is **Markdown**!');
document.getElementById('output').innerHTML = html;
</script>The most powerful data visualization library. Full control over SVG, scales, axes, and transitions.
D3 v7<script src="https://cdn.jsdelivr.net/npm/d3@7"></script>
<script>
const svg = d3.select('body').append('svg').attr('width', 500).attr('height', 300);
svg.append('circle').attr('cx', 250).attr('cy', 150).attr('r', 80).attr('fill', '#39d4ff');
</script>Lightweight fuzzy-search library. Search arrays of objects client-side with configurable thresholds.
Fuse.js 7<script src="https://cdn.jsdelivr.net/npm/fuse.js@7.0.0/dist/fuse.min.js"></script>
<script>
const fuse = new Fuse([{ name: 'John' }, { name: 'Jane' }], { keys: ['name'] });
const results = fuse.search('Jon'); // Finds "John"
console.log(results);
</script>The leading open-source map library. Renders OpenStreetMap tiles with markers, popups, and overlays.
Leaflet 1.9<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css">
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"></script>
<div id="map" style="height:400px"></div>
<script>
const map = L.map('map').setView([51.505, -0.09], 13);
L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png').addTo(map);
L.marker([51.505, -0.09]).addTo(map).bindPopup('Hello!').openPopup();
</script>Access Wikipedia search and article summaries without an API key. CORS-enabled, free forever.
No KeyREST// Search Wikipedia
const res = await fetch('https://en.wikipedia.org/api/rest_v1/page/summary/JavaScript');
const data = await res.json();
console.log(data.title, data.extract);
// Full search
const search = await fetch('https://en.wikipedia.org/w/api.php?action=query&list=search&srsearch=nodejs&format=json&origin=*');
const { query } = await search.json();
console.log(query.search);Get full dictionary entries with phonetics, definitions, and audio pronunciations — no key required.
No KeyRESTconst word = 'serendipity';
const res = await fetch(`https://api.dictionaryapi.dev/api/v2/entries/en/${word}`);
const [entry] = await res.json();
console.log(entry.phonetic); // /ˌser.ənˈdɪp.ɪ.ti/
console.log(entry.meanings[0].definitions[0].definition);Completely free weather forecast API. No key, no rate limits for reasonable use, 7-day forecasts.
No KeyFree tier// Get Sydney weather forecast
const res = await fetch(
'https://api.open-meteo.com/v1/forecast?latitude=-33.87&longitude=151.21¤t=temperature_2m,windspeed_10m&daily=temperature_2m_max,precipitation_sum&timezone=auto'
);
const { current, daily } = await res.json();
console.log('Temp:', current.temperature_2m + '°C');Get detailed data on all 250 countries: capitals, currencies, languages, flags, and calling codes.
No KeyREST// All countries
const all = await fetch('https://restcountries.com/v3.1/all').then(r => r.json());
// Search by name
const aus = await fetch('https://restcountries.com/v3.1/name/australia').then(r => r.json());
console.log(aus[0].capital, aus[0].population);
// By region
const europe = await fetch('https://restcountries.com/v3.1/region/europe').then(r => r.json());Live and historical currency exchange rates. The free tier on exchangerate-api gives 1500 req/month.
Free tierREST// Free, no-key endpoint (limited pairs)
const res = await fetch('https://open.er-api.com/v6/latest/USD');
const { rates } = await res.json();
console.log('EUR:', rates.EUR, 'AUD:', rates.AUD, 'GBP:', rates.GBP);Programming jokes and Stoic/dev quotes. Perfect for loading states, onboarding screens, or easter eggs.
No KeyREST// Programming joke
const joke = await fetch('https://v2.jokeapi.dev/joke/Programming?type=single').then(r => r.json());
console.log(joke.joke);
// Inspirational quote (ZenQuotes — free, no key)
const quote = await fetch('https://zenquotes.io/api/random').then(r => r.json());
console.log(quote[0].q, '—', quote[0].a);Fetch public GitHub data without a token. 60 req/hour unauthenticated, 5000/hour with a token.
No Key (public)REST + GraphQL// Get repo info
const repo = await fetch('https://api.github.com/repos/facebook/react').then(r => r.json());
console.log(repo.stargazers_count, 'stars');
// List commits
const commits = await fetch('https://api.github.com/repos/facebook/react/commits?per_page=5').then(r => r.json());
commits.forEach(c => console.log(c.commit.message));
// Search repos
const results = await fetch('https://api.github.com/search/repositories?q=nodejs+stars:>1000&sort=stars').then(r => r.json());The Movie Database API. Free tier with 40 req/10s. Get movies, TV shows, cast, ratings, and posters.
Free KeyREST// Register free at https://www.themoviedb.org/settings/api
const API_KEY = 'YOUR_TMDB_KEY';
// Trending movies this week
const trending = await fetch(`https://api.themoviedb.org/3/trending/movie/week?api_key=${API_KEY}`).then(r => r.json());
trending.results.forEach(m => console.log(m.title, m.vote_average));
// Poster URL
const posterUrl = `https://image.tmdb.org/t/p/w500${trending.results[0].poster_path}`;NASA's open APIs. Astronomy Picture of the Day, Mars Rover Photos, EPIC Earth imagery, and more.
Free KeyNo key: DEMO_KEY// DEMO_KEY = 30 req/hour free. Register at https://api.nasa.gov for 1000/hour
const key = 'DEMO_KEY';
// Astronomy Picture of the Day
const apod = await fetch(`https://api.nasa.gov/planetary/apod?api_key=${key}`).then(r => r.json());
console.log(apod.title, apod.hdurl);
// Mars Rover latest photos
const mars = await fetch(`https://api.nasa.gov/mars-photos/api/v1/rovers/curiosity/latest_photos?api_key=${key}`).then(r => r.json());
console.log(mars.latest_photos[0].img_src);Open Library and Google Books APIs for book data, covers, ISBNs, and full metadata — both free.
No KeyREST// Search Open Library (no key)
const books = await fetch('https://openlibrary.org/search.json?q=dune+frank+herbert').then(r => r.json());
console.log(books.docs[0].title, books.docs[0].author_name);
// Book cover by ISBN
const isbn = '9780441013593';
const cover = `https://covers.openlibrary.org/b/isbn/${isbn}-L.jpg`;
// Google Books (no key for basic)
const gb = await fetch('https://www.googleapis.com/books/v1/volumes?q=dune').then(r => r.json());
console.log(gb.items[0].volumeInfo.title);Free recipe database with meal photos, YouTube links, categories, and ingredient lists.
No KeyREST// Random meal
const meal = await fetch('https://www.themealdb.com/api/json/v1/1/random.php').then(r => r.json());
console.log(meal.meals[0].strMeal, meal.meals[0].strCategory);
// Search by name
const pasta = await fetch('https://www.themealdb.com/api/json/v1/1/search.php?s=pasta').then(r => r.json());
console.log(pasta.meals.map(m => m.strMeal));
// List all categories
const cats = await fetch('https://www.themealdb.com/api/json/v1/1/categories.php').then(r => r.json());Official FDA database API. Query drug labels, adverse event reports, and food recalls. No key for basic use.
No KeyOfficial FDA// Drug label search
const drug = await fetch('https://api.fda.gov/drug/label.json?search=ibuprofen&limit=1').then(r => r.json());
console.log(drug.results[0].indications_and_usage);
// Food recall events
const recalls = await fetch('https://api.fda.gov/food/enforcement.json?search=peanut&limit=5').then(r => r.json());
recalls.results.forEach(r => console.log(r.product_description));Apple's iTunes search API is completely free and keyless. Search music, podcasts, apps, and more.
No KeyREST// Search for music
const music = await fetch('https://itunes.apple.com/search?term=the+weeknd&media=music&limit=5').then(r => r.json());
music.results.forEach(t => console.log(t.trackName, t.previewUrl));
// Podcast search
const pods = await fetch('https://itunes.apple.com/search?term=javascript&media=podcast&limit=5').then(r => r.json());
pods.results.forEach(p => console.log(p.collectionName));Comprehensive Pokémon RESTful API. All 1000+ Pokémon with stats, abilities, evolutions, and sprites.
No KeyREST// Get a Pokémon
const poke = await fetch('https://pokeapi.co/api/v2/pokemon/pikachu').then(r => r.json());
console.log(poke.name, poke.base_experience);
console.log('Sprite:', poke.sprites.front_default);
// List all Pokémon (paginated)
const list = await fetch('https://pokeapi.co/api/v2/pokemon?limit=20&offset=0').then(r => r.json());
list.results.forEach(p => console.log(p.name));Geolocate any IP address or visitor's IP. Returns country, city, timezone, and ISP info.
Free TierREST// Current visitor IP (no key, free)
const myIp = await fetch('https://ipapi.co/json/').then(r => r.json());
console.log(myIp.city, myIp.country_name, myIp.timezone);
// Look up a specific IP
const lookup = await fetch('https://ipapi.co/8.8.8.8/json/').then(r => r.json());
console.log(lookup.org); // Google LLCGenerate realistic fake user data for mocking UIs, seeding databases, and testing forms.
No KeyREST// Generate 5 random users
const data = await fetch('https://randomuser.me/api/?results=5').then(r => r.json());
data.results.forEach(u => {
console.log(u.name.first, u.name.last, u.email);
console.log('Avatar:', u.picture.large);
console.log('Location:', u.location.city, u.location.country);
});Aggregate news from 80,000+ sources. Free dev tier: 100 req/day. Register at newsapi.org.
Free KeyREST// Register free at https://newsapi.org
const API_KEY = 'YOUR_KEY';
// Top tech headlines
const news = await fetch(`https://newsapi.org/v2/top-headlines?category=technology&language=en&apiKey=${API_KEY}`).then(r => r.json());
news.articles.slice(0,5).forEach(a => console.log(a.title, a.url));
// Search articles
const search = await fetch(`https://newsapi.org/v2/everything?q=javascript&sortBy=publishedAt&apiKey=${API_KEY}`).then(r => r.json());The Star Wars API. All characters, films, starships, vehicles, species, and planets — no key needed.
No KeyREST// All people
const people = await fetch('https://swapi.dev/api/people/').then(r => r.json());
people.results.forEach(p => console.log(p.name, p.birth_year));
// Get a starship
const ship = await fetch('https://swapi.dev/api/starships/9/').then(r => r.json());
console.log(ship.name, ship.max_atmosphering_speed);🔓 Watch this short ad to unlock your download
30s