CYDERCODER // PLAYBOOK
SYS.STATUS: OK 00%
> INITIALIZING...
Install this playbook for offline access
You're offline — reading cached content
WHO THIS IS FOR

Built for every stage of the builder journey

Beginners

Clear path from zero to deployed product in one afternoon. Exact AI prompts to copy. Explains the why, not just the how — all the way to production with a custom domain.

  • Build your first website end-to-end
  • Deploy with Vercel, set up Google Search Console
  • Understand what React is doing behind the scenes

Senior Devs

A reference manual for AI architecture decisions. RAG chunking, MCP, multi-agent systems, CDN caching, deployment strategies — without the fluff.

  • RAG chunking strategies, MCP protocol architecture
  • Typography scale, color theory, motion design systems
  • CDN caching, edge functions, deployment strategies
Portrait Lock Active
Please rotate your device back to Portrait orientation to read the playbook content.
Back to Dashboard

Production Thinking: What Happens After You Deploy

01. The Three Pillars of Observability

When your app is live, you can’t see what’s happening. Users report errors, but you don’t know why. Server crashes, but you don’t know when. Observability gives you eyes on your running application.

There are three types of information you need:

The Three Pillars
Metrics
Numbers measured over time
CPU usage, response time, error rate
Tells you THAT something is wrong
Logs
Text entries when code runs
Timestamps, messages, context
Tells you WHY something went wrong
Traces
Map of a request’s journey
Edge → API → Database → Cache
Tells you WHERE the bottleneck is

02. Error Tracking: Catch Bugs Before Users Do

When your app crashes, you need to know immediately. Error tracking tools capture crashes automatically and alert you.

What You Need

Sentry (free tier available) captures errors with:

  • The exact line of code that failed
  • The user’s browser and device
  • The stack trace (the chain of functions that led to the error)
  • Which deployment introduced the bug

How to Set It Up

  1. Go to sentry.io and create a free account
  2. Create a new project for your website
  3. Sentry gives you a DSN (a URL) — copy it
  4. In your project, tell Lovable or Cursor: “Add Sentry error tracking using this DSN: [paste your DSN]”
  5. Deploy — all errors are now captured automatically

What You’ll See

When something breaks, Sentry sends you an email with:

  • What happened: “TypeError: Cannot read property ‘map’ of undefined”
  • Where it happened: “src/components/ProjectList.tsx, line 42”
  • How many users affected: “12 users in the last hour”
  • When it started: “Started after deployment v2.3.1”

03. Health Checks: Is Your App Alive?

A health check is a simple URL that returns “yes, I’m alive” when your app is running. Monitoring tools ping this URL every 30 seconds. If it doesn’t respond, they alert you.

How It Works

  1. Your app exposes a URL like /health
  2. A monitoring tool (like BetterStack or UptimeRobot) checks it every 30 seconds
  3. If the check fails 3 times in a row, you get an alert
  4. You fix the problem
  5. The monitor confirms it’s back online

What to Tell Your AI Tool

When building with Lovable or Cursor, add this to your prompt:

“Add a health check endpoint at /health that returns JSON with status (‘ok’ or ‘unhealthy’), timestamp, and uptime. If the database connection fails, return status ‘unhealthy’ with a 503 status code.”


04. Structured Logging: Better Than console.log

When something goes wrong, you need to see what happened. Structured logging means writing logs in a consistent format that machines can search and humans can read.

The Problem with console.log

Most developers use console.log("something happened"). This is useless in production because:

  • You can’t search through thousands of messages
  • You don’t know when things happened
  • You don’t have context about what user or what request triggered it

The Solution: Structured Logs

Every log entry should have:

  • Timestamp: When it happened
  • Level: How serious (info, warn, error)
  • Message: What happened
  • Context: Who was affected, what request triggered it

What to Tell Your AI Tool

“Replace all console.log statements with structured logging. Each log entry should be a JSON object with: timestamp (ISO date string), level (‘info’, ‘warn’, or ‘error’), message (human-readable description), and context (object with requestId, userId, and any relevant data). For errors, also include the error message and stack trace.”


05. Crash Recovery: What Happens When Things Break

Even with monitoring, things will crash. The question is: how fast do you recover?

The Graceful Shutdown

When your app crashes or gets replaced by a new deployment, it should:

  1. Stop accepting new requests
  2. Finish processing any in-progress requests
  3. Close database connections cleanly
  4. Exit gracefully

This prevents data corruption from half-finished operations.

What to Tell Your AI Tool

“Add graceful shutdown handling that:

  1. Listens for SIGTERM signal
  2. Stops accepting new connections
  3. Waits for in-flight requests to complete (max 30 seconds)
  4. Closes database connections
  5. Exits cleanly

If shutdown takes longer than 30 seconds, force exit.”


06. The Monitoring Dashboard

You need a single place to see everything happening with your app. Most hosting platforms (Vercel, Railway) provide this built-in.

What to Monitor

Monitoring Dashboard
Health
Request Rate (requests per minute)
Error Rate (percentage of failed requests)
Response Time (P50, P95, P99)
Resources
CPU Usage
Memory Usage
Database Connections
Dependencies
Database status
API status (Stripe, email, etc.)
Cache status (Redis)

Alert Thresholds

MetricWarningCriticalAction
Error Rate> 1%> 5%Check Sentry for new errors
Response Time (P95)> 500ms> 2sCheck database queries
CPU Usage> 70%> 90%Scale up or optimize
Memory Usage> 70%> 90%Check for memory leaks
Disk Usage> 80%> 95%Clean up logs or scale

07. Incident Response: When Things Go Wrong

Even with monitoring, things will break. The difference between junior and senior engineers is how fast they respond.

The 5-Step Process

Step 1< 1 minute
Detect
Monitoring alerts fire — error rate spike, latency spike, or health check failing
Step 2< 5 minutes
Assess
Is it user-facing? How many users affected? Is data at risk? What changed recently?
Step 3< 10 minutes
Communicate
Update status page: “Investigating reports of [issue]“
Step 4< 30 minutes
Mitigate
Rollback last deploy, scale up, turn off broken feature, or failover to backup
Step 5Within 48 hours
Retrospective
What caused it? Why didn’t we catch it? How do we prevent it next time?

The Fastest Fix

Rollback. If something breaks after a deploy, the fastest fix is almost always rolling back to the previous version.

In Vercel: Go to your project → Deployments → find the last working one → click “Promote to Production”

In Lovable: Go to GitHub → find the last working commit → click “Restore”


08. What to Tell Your AI Tool

When building with Lovable, Cursor, or any AI tool, add these to your prompts:

For Error Tracking

Add Sentry error tracking. Capture all unhandled errors
and log them with context (user ID, request ID, page URL).
Show a friendly error page to users when something crashes.

For Health Checks

Add a /health endpoint that checks:
1. Is the server running?
2. Can it connect to the database?
3. Are external APIs reachable?

Return status "healthy" or "unhealthy" with details.

For Logging

Add structured logging. Every log entry should be JSON with
timestamp, level, message, and context (requestId, userId).
Replace all console.log with this structured logger.

For Graceful Shutdown

Handle SIGTERM for graceful shutdown:
1. Stop accepting new requests
2. Wait for in-flight requests (max 30s)
3. Close database connections
4. Exit cleanly

Key Takeaways

ConceptMental ModelSenior Insight
Three PillarsMetrics, Logs, TracesYou need all three — metrics alone tell you something is wrong but not what
Error TrackingSentry catches crashesSet it up once, get alerts forever — free tier is enough
Health ChecksSimple URL that says “I’m alive”Monitoring tools ping it every 30 seconds — if it fails, you get alerted
Structured LoggingJSON over console.logTimestamp + level + message + context — queryable and searchable
Crash RecoveryFinish in-flight work before exitPrevents data corruption from half-finished operations
Incident ResponseDetect → Assess → Mitigate → RetrospectiveThe fastest fix is almost always a rollback