Localhost Server Manager
by envizionwork

Spin up a secure background environment in seconds with zero configuration. No Apache. No Nginx. No nonsense.

100% Free · Open Source
lsm-terminal
$
⚙️ Interactive LSM Command Builder
Generated Command
lsm start --port 3000 --host 127.0.0.1 --ssl --watch

Terminal & AI Mastery

Click any card to open a full terminal guide with code, connections, and deep explanations.

All 🤖 AI & LLM 🐳 DevOps ⚙️ Backend 💻 Terminal 🗄️ Database
100 guides
🚀

1. Colab GPU & LoRA

Connect terminal to Google Colab GPUs via SSH to fine-tune AI models locally using LoRA.

🧠

2. AI Training Architectures

Understand the exact differences between Gemini/ChatGPT massive training vs. Local LoRA fine-tuning.

🦙

3. Advanced Ollama API

Free, complete examples for running LLMs offline, building custom Modelfiles, and API integration.

🐳

4. Docker Compose Mastery

Containerize your Node.js apps. Terminal commands to build, run, and link containers.

🔑

5. SSH & Server Auth

Generate keys, connect to remote Linux servers, and manage config files securely.

🐙

6. GitHub Actions CI/CD

Automate your deployments directly from terminal pushes using YAML pipelines.

🔀

7. NGINX Reverse Proxy

Route multiple localhost apps to domain names with Certbot SSL on a VPS.

🐘

8. PostgreSQL via CLI

The essential `psql` terminal commands for dumping, restoring, and querying databases.

🐍

9. Python Venv & Pip

Isolate AI dependencies securely using virtual environments and `requirements.txt`.

âš¡

10. Real-time WebSockets

Setup a two-way real-time communication server in Node.js tested via terminal.

🖥️

11. VS Code Remote Dev

Connect VS Code to remote SSH servers, Docker containers, and WSL2 for seamless local-feeling development.

☸️

12. Kubernetes Basics

Deploy, scale, and manage containerized apps with kubectl. From pods to services to ingress controllers.

🌍

13. Environment Variables & .env

Securely manage secrets, API keys, and config across dev, staging, and production environments.

🔐

14. JWT Authentication

Implement stateless JSON Web Token auth flows in Node.js — sign, verify, refresh tokens and protect routes.

📡

15. REST API Design

Design clean, versioned REST APIs with proper status codes, pagination, filtering, and error handling.

🧪

16. Automated Testing

Write unit, integration, and E2E tests with Jest, Vitest, and Playwright for bulletproof applications.

🔄

17. Git Advanced Workflows

Rebase, cherry-pick, bisect, stash strategies and branching models for professional team development.

📦

18. npm / pnpm / Yarn Mastery

Workspaces, lock files, peer deps, publishing packages, and monorepo management from the terminal.

🏗️

19. Webpack & Vite Config

Bundle JS/CSS assets, configure HMR, code splitting, tree shaking, and production optimizations.

🌩️

20. AWS CLI Essentials

Deploy apps to EC2, manage S3 buckets, configure IAM, and automate with CloudFormation via terminal.

🔥

21. Firebase Setup & Rules

Connect web apps to Firestore, authenticate users, write security rules, and deploy to Firebase Hosting.

📊

22. MongoDB & Mongoose

Design schemas, write aggregation pipelines, index strategies, and connect Node.js apps to MongoDB Atlas.

âš¡

23. Redis Caching

Cache API responses, store sessions, implement pub/sub, and use Redis as a fast key-value store.

🔀

24. Load Balancing

Configure NGINX and HAProxy to distribute traffic, handle failover, and scale horizontally.

🛡️

25. HTTPS & SSL Certificates

Generate self-signed certs, use Let's Encrypt Certbot, configure HSTS, and force HTTPS redirects.

🤖

26. AI API Integration

Connect to OpenAI, Claude, Gemini, and Mistral APIs — streaming responses, tool calls, and embeddings.

🦙

27. Open WebUI + Ollama

Set up Open WebUI as a ChatGPT-like interface for your local Ollama models with custom personas.

🧠

28. LangChain Pipelines

Build RAG systems, agent chains, memory modules, and tool-using AI pipelines with LangChain.

📁

29. File System Access API

Use the browser's native File System API to read/write local files without a backend server.

🎛️

30. Linux Process Management

Use ps, top, htop, kill, systemctl, and cron to manage running services and scheduled jobs.

📝

31. Markdown to HTML Pipeline

Convert .md files to styled HTML at build time using marked, remark, or pandoc.

🔬

32. Chrome DevTools Deep Dive

Master the Network, Performance, Memory, and Sources panels for debugging production web apps.

🐍

33. FastAPI Backend

Build production-grade Python REST APIs with FastAPI — async endpoints, Pydantic models, auth, and docs.

📮

34. Email Sending via Code

Send transactional emails with Nodemailer, SendGrid, Resend, and Mailgun from Node.js and Python.

🏎️

35. Performance Optimization

Lighthouse audits, lazy loading, image compression, critical CSS, and Core Web Vitals fixes.

🗄️

36. SQLite for Local Apps

Embed a full SQL database in your app with better-sqlite3 and sqlite3 — zero setup, no server needed.

🔌

37. GraphQL API

Build a GraphQL schema, write resolvers, handle subscriptions, and consume with Apollo Client.

🖼️

38. Image Processing CLI

Resize, convert, compress, and watermark images in bulk using Sharp (Node.js) and ImageMagick.

🔮

39. TypeScript Setup

Configure tsconfig, strict mode, path aliases, declaration files, and type-safe API contracts.

🌐

40. DNS & Domain Config

Configure A records, CNAMEs, MX records, SPF, DKIM, and DMARC for custom domains.

📲

41. PWA & Service Workers

Make any web app installable on mobile with Web App Manifest, offline caching, and push notifications.

🎮

42. WebGL & Three.js Basics

Render 3D scenes in the browser — meshes, lights, cameras, textures, animations, and GLTF loading.

🔑

43. OAuth 2.0 / Social Login

Implement Google, GitHub, Discord OAuth login flows with Passport.js and NextAuth.

🐙

44. GitHub API Automation

Create repos, manage issues, trigger workflows, and read org data with the GitHub REST and GraphQL APIs.

📡

45. WebRTC Video/Audio

Build peer-to-peer video calls and screen sharing with WebRTC, STUN servers, and Socket.io signaling.

🧩

46. Browser Extensions

Build Chrome/Firefox extensions with Manifest V3 — content scripts, background workers, and storage.

🔧

47. Bash Scripting Essentials

Write production shell scripts — loops, conditions, functions, argument parsing, error handling, cron.

📦

48. Docker Multi-Stage Builds

Reduce final image size 10x with multi-stage Dockerfiles — separate build and runtime environments.

☁️

49. Cloudflare Workers

Deploy serverless JS/TypeScript at the edge globally with zero cold starts and KV storage.

🏠

50. Home Lab Server Setup

Turn a Raspberry Pi or old PC into a local dev server with Ubuntu Server, SSH, and reverse proxy.

🔍

51. ElasticSearch Full-Text Search

Index documents, run fuzzy queries, aggregations, and build autocomplete with Elasticsearch and Kibana.

📊

52. Grafana + Prometheus

Monitor server metrics, set up dashboards, configure alerts for CPU, memory, and response times.

🛠️

53. Makefile for Dev Automation

Write Makefile targets to automate build, test, lint, docker-up, and deploy commands.

🧱

54. Terraform Infrastructure as Code

Provision cloud resources on AWS/GCP/Azure with Terraform modules and state management.

🔏

55. Secret Management (Vault)

Store, rotate, and inject secrets securely with HashiCorp Vault and environment injection patterns.

🧵

56. Worker Threads in Node.js

Offload CPU-intensive tasks to worker threads and run parallel JS code without blocking the event loop.

🌊

57. Streaming APIs

Build Server-Sent Events, NDJSON streams, and chunked transfer responses for real-time AI output.

🧮

58. Data Structures in JS/Python

Implement stacks, queues, linked lists, trees, and graphs with practical use-case examples.

🤖

59. n8n Workflow Automation

Build no-code/code automation flows connecting APIs, databases, AI, and services with n8n locally.

📱

60. React Native Basics

Build iOS and Android apps with React Native — navigation, native modules, and Expo setup.

🔐

61. CORS Configuration

Fix CORS errors, configure allowed origins, handle preflight requests, and secure your API headers.

📦

62. Monorepo with Turborepo

Manage multiple apps and packages in one repo with Turborepo's caching and pipeline system.

🧠

63. Embeddings & Vector DBs

Generate text embeddings with OpenAI/Ollama, store in Chroma/Pinecone, and build semantic search.

🤗

64. HuggingFace Transformers

Download and run BERT, GPT-2, Whisper, and CLIP models locally with the HuggingFace pipeline API.

🖥️

65. tmux Terminal Multiplexer

Split terminal panes, attach/detach sessions, and keep processes running after SSH disconnection.

📸

66. Puppeteer & Playwright Scraping

Scrape dynamic websites, take screenshots, fill forms, and automate browsers with Puppeteer/Playwright.

🔢

67. RegEx Mastery

Write regular expressions for validation, extraction, replacement, and parsing with real-world examples.

🏎️

68. Bun Runtime

Drop-in Node.js replacement with 10x faster startup — scripts, bundler, test runner, and package manager.

🌐

69. Proxy Servers & Tunneling

Set up ngrok, Cloudflare Tunnel, and localtunnel to expose localhost to the internet securely.

🔄

70. CI/CD with GitLab

Configure GitLab CI pipelines with stages, runners, caching, environments, and deploy jobs.

📊

71. Pandas Data Analysis

Clean, transform, filter, group, and visualize datasets with Python Pandas and Matplotlib.

🧪

72. API Testing with Postman/Insomnia

Write test scripts, chain requests, use environments, and mock servers for API development.

🗂️

73. File Upload Handling

Handle multipart file uploads in Node.js with multer, validate types, stream to S3, and generate thumbnails.

🔊

74. Web Audio API

Generate tones, load audio buffers, apply filters, and build visualizers in the browser.

🏷️

75. Semantic HTML & Accessibility

Write screen-reader-friendly HTML, ARIA labels, keyboard nav, and meet WCAG 2.1 AA standards.

📡

76. MQTT for IoT

Connect sensors and devices with MQTT broker (Mosquitto), publish/subscribe, and visualize data.

🔐

77. bcrypt & Password Hashing

Securely hash passwords, configure salt rounds, and implement rate-limiting for login endpoints.

💾

78. PostgreSQL Advanced Queries

Window functions, CTEs, JSONB operations, explain analyze, and query optimization techniques.

🧹

79. Code Linting & Formatting

Configure ESLint, Prettier, Husky pre-commit hooks, and lint-staged for clean codebases.

🌍

80. Internationalization (i18n)

Add multi-language support with i18next, locale routing, RTL layouts, and pluralization rules.

📦

81. CDN & Asset Delivery

Configure Cloudflare CDN, set cache headers, purge cache, and optimize global asset delivery.

🔍

82. SEO for Web Apps

Sitemap generation, robots.txt, Open Graph tags, structured data, and SSR for search engine crawling.

🧵

83. Concurrent Programming

Async/await patterns, Promise.all, race conditions, mutex locks, and parallel task management.

🔄

84. Database Migrations

Write forward and rollback SQL migrations with Flyway, Liquibase, Prisma Migrate, and Knex.

📊

85. Real-time Dashboards

Build live charts with Chart.js, Recharts, and D3.js connected to WebSocket data streams.

🏗️

86. Microservices Architecture

Split monoliths into services — API gateways, service discovery, circuit breakers, and event buses.

🛡️

87. Rate Limiting & DDoS Protection

Implement token bucket rate limiting, IP blocking, and Cloudflare WAF rules in Node.js and NGINX.

🤖

88. LLM Prompt Engineering

Design system prompts, few-shot examples, chain-of-thought, and structured output for AI models.

📁

89. S3-Compatible Object Storage

Upload, download, stream, and generate presigned URLs with AWS S3, MinIO, and Backblaze B2.

🔌

90. gRPC Services

Define .proto schemas, generate client/server stubs, and build high-performance binary RPC APIs.

🧠

91. Fine-Tuning with Axolotl

Full pipeline for fine-tuning LLMs on custom datasets using Axolotl — config YAML, training, and merging.

🎨

92. CSS Architecture (BEM/Tailwind)

Scale CSS maintainably with BEM naming, utility classes, design tokens, and component patterns.

🔬

93. Memory Profiling Node.js

Find memory leaks with heapdumps, clinic.js, and Chrome DevTools memory profiler in production.

📡

94. Webhooks & Event Ingestion

Receive, validate (HMAC), queue, and reliably process webhooks from Stripe, GitHub, and Shopify.

🧪

95. End-to-End Testing Playwright

Write reliable E2E tests, visual regression tests, and CI integration with Playwright Test runner.

🌊

96. Apache Kafka Basics

Produce and consume events, manage topics, consumer groups, and offsets with Kafka and kafkajs.

🏎️

97. Edge Computing & Deno Deploy

Deploy TypeScript at the edge with Deno Deploy, Vercel Edge Functions, and Netlify Edge.

🔐

98. Zero Trust Security

Implement Zero Trust networking — mTLS, service mesh, identity-based access, and Tailscale.

📊

99. OpenTelemetry Observability

Instrument your app with traces, metrics, and logs using OpenTelemetry and export to Jaeger/Grafana.

🚀

100. Full-Stack Deployment Checklist

Production-ready checklist: env vars, HTTPS, CORS, rate limits, logging, monitoring, backups, and rollback.

Downloads & Libraries

Deploy templates, CSS frameworks, JS libraries, and free APIs — all in one place. Click any card to expand.

📦 Deploy Templates
🎨 CSS Libraries
âš¡ JS Libraries
🌐 Free APIs
🚀

Express.js Server — Auto-Connect

server.js · Node.js · Starts on localhost:3000 instantly

Drop this in your project root. Run node server.js and it spins up immediately on port 3000, auto-opening your browser.

✔ Zero ConfigNode v18+
server.js
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(() => {});
});
🐍

FastAPI Python Server

main.py · Python · REST + auto-docs at /docs

Production-ready FastAPI app with CORS, health endpoint, and Swagger UI at /docs. Run with uvicorn main:app --reload.

FastAPIPython 3.10+
main.py
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)
🐳

Docker Compose Full Stack

docker-compose.yml · Node + PostgreSQL + Redis

Three-service stack: Node.js app, PostgreSQL database, and Redis cache. Run docker compose up.

DockerPostgreSQLRedis
docker-compose.yml
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:
🐙

GitHub Actions CI/CD Pipeline

deploy.yml · Auto test + deploy on push to main

Full CI pipeline: runs tests on every PR, deploys to production server via SSH on merge to main.

CI/CDGitHub Actions
deploy.yml
name: 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 all
🔀

NGINX Reverse Proxy + SSL

app.conf · Routes domain → localhost + Certbot ready

Production NGINX config routing a domain to your Node app with WebSocket support and security headers.

NGINXSSL/TLS
app.conf
server {
    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;
    }
}
âš¡

WebSocket Real-time Server

ws-server.js · Broadcast, heartbeat, rooms

Full WebSocket server with room-based broadcasting, heartbeat ping/pong, and graceful reconnect logic.

WebSocketsNode.js
ws-server.js
import { 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');
🔐

JWT Auth Middleware

auth.js · Sign, verify, refresh tokens for Express

Drop-in JWT middleware for Express with access + refresh token rotation. Set JWT_SECRET in your .env.

JWTExpress
auth.js
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' }); }
}
🌍

Environment Variables Template

.env.example · Full production-ready .env scaffold

Complete .env template covering DB, cache, APIs, auth, storage, and email. Never commit the real file.

ConfigSecurity
.env.example
# === 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_...
📦

Dockerfile — Node.js Multi-Stage

Dockerfile · Minimal production image, non-root user

Multi-stage build: heavy build stage + minimal Alpine runtime. Final image under 100MB.

DockerProduction
Dockerfile
# 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"]
⚛️

React + Vite Starter

vite.config.js + App.jsx · HMR, proxy, path aliases

Vite config with API proxy to backend, path aliases, and chunk splitting for production.

ReactVite
vite.config.js
import { 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'] }
      }
    }
  }
});
🗄️

Prisma Schema + Seed

schema.prisma + seed.ts · Users, Posts, Sessions model

Full Prisma schema with User, Post, and Session models + a seed script. Run npx prisma migrate dev.

PrismaORM
schema.prisma
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 Session Store + Cache

redis.js · Sessions, rate limiting, pub/sub

Redis utility module for session storage, API response caching, and rate limiting with ioredis.

RedisCache
redis.js
import 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));
☁️

Cloudflare Worker Edge Function

worker.js · Edge API, KV, geolocation routing

Deploy serverless JS at Cloudflare's edge with routing, KV storage reads, and geo-based redirects.

EdgeServerless
worker.js
export 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 API Route + Middleware

route.ts · App Router, typed, auth-protected

Next.js 14 App Router API route with typed request/response, auth middleware, and error handling.

Next.jsTypeScript
route.ts
import { 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() };
}
🐍

Python AI/ML Requirements

requirements.txt · PyTorch, Transformers, LangChain stack

Complete AI/ML Python dependency stack. Run pip install -r requirements.txt inside a virtualenv.

PythonAI/ML
requirements.txt
# 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
🔑

Hardened SSH Config

sshd_config · No root login, key-only, fail2ban ready

Drop into /etc/ssh/sshd_config. Disables password auth, restricts access to named users, sets max tries.

SecurityLinux
sshd_config
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
🧱

Terraform AWS EC2 + S3

main.tf · VPC, EC2 instance, S3 bucket, security group

Provisions a t3.micro EC2 instance with security group + S3 bucket. Run terraform init && terraform apply.

TerraformAWS
main.tf
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 Process Manager Config

ecosystem.config.js · Cluster, env, logs, restart

PM2 ecosystem file: runs your app in cluster mode, manages env variables, and auto-restarts on crash.

PM2Production
ecosystem.config.js
module.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
  }]
};
📊

OpenTelemetry Instrumentation

tracing.js · Traces, metrics, logs → Jaeger/Grafana

Auto-instruments your Node.js app. Import at the very top of your entry file before anything else.

OTelObservability
tracing.js
import { 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());
💳

Stripe Webhook Handler

stripe-webhook.js · HMAC verify, payment events

Verified Stripe webhook endpoint handling payment, subscription, and refund events securely.

StripePayments
stripe-webhook.js
import 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;
🌊

Tailwind CSS v3

CDN · Utility-first · Zero config via Play CDN

Add Tailwind to any HTML file instantly with the Play CDN — no build step required for prototyping.

Utility-firstv3.4
html
<!-- Tailwind CSS Play CDN (dev/prototyping only) -->
<script src="https://cdn.tailwindcss.com"></script>
<!-- For production: npm install tailwindcss -->
🅱️

Bootstrap 5

CDN · Grid, components, utilities — all-in-one

The most widely used CSS framework. Responsive grid, prebuilt components, and JS plugins included.

Bootstrap 5.3
html
<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>
🎨

DaisyUI (Tailwind Components)

CDN · 50+ pre-built components on top of Tailwind

Semantic component classes for Tailwind. Buttons, modals, cards, and more with theming support.

DaisyUI 4
html
<link href="https://cdn.jsdelivr.net/npm/daisyui@4.7.3/dist/full.min.css" rel="stylesheet">
<script src="https://cdn.tailwindcss.com"></script>
🎯

Bulma CSS

CDN · Modern Flexbox-based, no JS dependency

Pure CSS framework using Flexbox. No JavaScript required — just classes. Great for clean layouts.

Bulma 1.0
html
<link href="https://cdn.jsdelivr.net/npm/bulma@1.0.1/css/bulma.min.css" rel="stylesheet">
🌙

Pico CSS

CDN · Minimal semantic HTML styling, no classes

Classless CSS framework — just write semantic HTML and it looks great. Perfect for documentation.

Pico 2
html
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.min.css">

Animate.css

CDN · Drop-in CSS animations — bounce, fade, slide

76+ CSS animations. Add class animate__animated animate__fadeIn to any element.

Animations
html
<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>
🧊

Glassmorphism CSS Snippet

snippet · Frosted glass cards with backdrop-filter

Copy-paste glassmorphism effect for cards and modals. Works in all modern browsers.

Snippet
css
.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;
}
📊

Chart.js — Data Charts

CDN · 8 chart types, responsive, animated

The most popular charting library. Line, bar, pie, radar, scatter — all responsive and animated.

Chart.js 4
html
<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>
🔥

GSAP — Animation Library

CDN · High-performance JS animations, 60fps

Industry-standard animation library. Smooth tweens, timelines, ScrollTrigger, and morphing SVG.

GSAP 3
html
<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>
🔷

Alpine.js — Lightweight Reactivity

CDN · Vue-like directives in plain HTML, 14KB

Add reactive behaviour directly in HTML with x-data, x-on, and x-bind — no build step.

Alpine 3
html
<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>
📝

Marked.js — Markdown Parser

CDN · Parse Markdown to HTML in browser, 28KB

Fast Markdown → HTML parser. Great for rendering user content, READMEs, and documentation.

Marked 12
html
<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>
🌳

D3.js — Data Visualization

CDN · SVG charts, force graphs, maps — full control

The most powerful data visualization library. Full control over SVG, scales, axes, and transitions.

D3 v7
html
<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>
🔍

Fuse.js — Fuzzy Search

CDN · Client-side fuzzy-search with scoring, no server

Lightweight fuzzy-search library. Search arrays of objects client-side with configurable thresholds.

Fuse.js 7
html
<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>
🗺️

Leaflet.js — Interactive Maps

CDN · OpenStreetMap tiles, markers, polygons, free

The leading open-source map library. Renders OpenStreetMap tiles with markers, popups, and overlays.

Leaflet 1.9
html
<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>
📖

Wikipedia API

Free · No key · Search, summaries, full articles

Access Wikipedia search and article summaries without an API key. CORS-enabled, free forever.

No KeyREST
javascript
// 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);
📚

Dictionary API (Free)

Free · No key · Definitions, phonetics, synonyms

Get full dictionary entries with phonetics, definitions, and audio pronunciations — no key required.

No KeyREST
javascript
const 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);
🌦️

Open-Meteo Weather API

Free · No key · Forecasts, historical, 90+ variables

Completely free weather forecast API. No key, no rate limits for reasonable use, 7-day forecasts.

No KeyFree tier
javascript
// 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');
🌍

REST Countries API

Free · No key · 250 countries, flags, currencies, maps

Get detailed data on all 250 countries: capitals, currencies, languages, flags, and calling codes.

No KeyREST
javascript
// 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());
🪙

Exchange Rates API

Free tier · No key · 170 currencies, daily updates

Live and historical currency exchange rates. The free tier on exchangerate-api gives 1500 req/month.

Free tierREST
javascript
// 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);
😂

JokeAPI & QuoteAPI

Free · No key · Programming jokes, inspirational quotes

Programming jokes and Stoic/dev quotes. Perfect for loading states, onboarding screens, or easter eggs.

No KeyREST
javascript
// 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);
🐱

GitHub REST API

Free · No key (public) · Repos, users, issues, commits

Fetch public GitHub data without a token. 60 req/hour unauthenticated, 5000/hour with a token.

No Key (public)REST + GraphQL
javascript
// 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());
🎬

TMDB Movie & TV API

Free key · 1M+ movies, TV shows, cast, posters

The Movie Database API. Free tier with 40 req/10s. Get movies, TV shows, cast, ratings, and posters.

Free KeyREST
javascript
// 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 APIs

Free key · APOD, Mars rover photos, near-earth objects

NASA's open APIs. Astronomy Picture of the Day, Mars Rover Photos, EPIC Earth imagery, and more.

Free KeyNo key: DEMO_KEY
javascript
// 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 & Books API

Free · No key · 20M+ books, covers, ISBNs, authors

Open Library and Google Books APIs for book data, covers, ISBNs, and full metadata — both free.

No KeyREST
javascript
// 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);
🍽️

TheMealDB & RecipeDB

Free · No key · 300+ meals, categories, ingredients

Free recipe database with meal photos, YouTube links, categories, and ingredient lists.

No KeyREST
javascript
// 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());
💊

OpenFDA Drug & Food API

Free · No key · FDA drug labels, adverse events, recalls

Official FDA database API. Query drug labels, adverse event reports, and food recalls. No key for basic use.

No KeyOfficial FDA
javascript
// 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));
🎵

iTunes Search API

Free · No key · Music, podcasts, apps, books search

Apple's iTunes search API is completely free and keyless. Search music, podcasts, apps, and more.

No KeyREST
javascript
// 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));
🧬

PokeAPI — Pokémon Data

Free · No key · 1000+ Pokémon, moves, abilities

Comprehensive Pokémon RESTful API. All 1000+ Pokémon with stats, abilities, evolutions, and sprites.

No KeyREST
javascript
// 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));
🌐

IP Geolocation API

Free tier · No key · Country, city, timezone, ISP

Geolocate any IP address or visitor's IP. Returns country, city, timezone, and ISP info.

Free TierREST
javascript
// 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 LLC
💬

Random User Generator API

Free · No key · Fake user profiles, avatars, addresses

Generate realistic fake user data for mocking UIs, seeding databases, and testing forms.

No KeyREST
javascript
// 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);
});
📰

NewsAPI — Headline Aggregator

Free dev key · Top headlines, source filter, search

Aggregate news from 80,000+ sources. Free dev tier: 100 req/day. Register at newsapi.org.

Free KeyREST
javascript
// 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());
🛸

SWAPI — Star Wars Universe

Free · No key · All Star Wars characters, planets, ships

The Star Wars API. All characters, films, starships, vehicles, species, and planets — no key needed.

No KeyREST
javascript
// 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);
Ad

🔓 Watch this short ad to unlock your download

30s
Sponsored
Sponsored