How gurshaan17/p99 works
p99 is a daily production-incident diagnosis and learning site. Readers encounter a published incident, inspect symptoms, constraints, and telemetry, choose a diagnosis, then reveal the explanation, self-check their reasoning, and retain lessons; attempt state is stored locally. The archive and topic pages support discovery. Separate branches provide SEO/feed surfaces and email subscription/digest operations. Evidence is limited to the README and the supplied excerpts/SOURCE INDEX; some component-level and integration details are unsampled, so those links are omitted or documented rather than inferred.
Main entry points: incidents.ts Publish-aware queries · page.tsx Incident write-up · route.ts Subscription endpoint · send.ts Email rendering and sending
Components 25
Incident content
- Incident records
content/incidents - Incident registry
content/incidents/index.ts - Publish-aware queries
lib/incidents.ts
Reader experience
- Daily incident
app/page.tsx - Incident write-up
app/q/[slug]/page.tsx - Diagnosis and reveal
components/question/incident.tsx - Answer and scoring state
lib/attempts.ts - Attempt state hook
hooks/useAttempt.ts
Discovery and SEO
- Archive and topics
app/archive/page.tsx - Archive presentation
components/archive - Search and command palette
components/shell/command-palette.tsx - SEO page generation
lib/seo/pages.ts - SEO metadata
lib/seo/metadata.ts - Sitemap generation
lib/seo/sitemap.ts - RSS and llms feeds
app/rss.xml/route.ts
Email operations
- Subscription endpoint
app/api/subscribe/route.ts - Subscriber records
app/api/subscribe/route.ts - Email rendering and sending
lib/email/send.ts - Daily digest job
app/api/cron/daily-digest/route.ts - Amazon SES
lib/ses.ts
Publishing services
- Upstash Redis
lib/redis.ts - Scheduled revalidation
app/api/revalidate/route.ts
Other components
- Reader
- Feed consumer
- Email subscriber
Connections 29
- Incident records → Incident registry: registered in
- Incident registry → Publish-aware queries: queried by
lib/incidents.ts - Publish-aware queries → Daily incident: supplies published incident
app/page.tsx - Reader → Daily incident: opens
- Daily incident → Incident write-up: opens full write-up
app/page.tsx - Publish-aware queries → Incident write-up: resolves slug
app/q/[slug]/page.tsx - Incident write-up → Diagnosis and reveal: renders incident sections
app/q/[slug]/page.tsx - Incident write-up → Attempt state hook: supports attempt UI
- Attempt state hook → Answer and scoring state: reads and updates
hooks/useAttempt.ts - Answer and scoring state → Incident write-up: persists local answers
- Publish-aware queries → Archive and topics: supplies published records
app/archive/page.tsx - Archive and topics → Archive presentation: renders archive view
app/archive/page.tsx - Reader → Archive and topics: browses incidents
- Publish-aware queries → Search and command palette: provides visible incidents
- Publish-aware queries → SEO page generation: builds incident SEO data
lib/seo/pages.ts - SEO page generation → SEO metadata: feeds page metadata
app/q/[slug]/page.tsx - Publish-aware queries → Sitemap generation: supplies published URLs
lib/seo/sitemap.ts - Publish-aware queries → RSS and llms feeds: supplies published incidents
app/rss.xml/route.ts - RSS and llms feeds → Feed consumer: serves feeds
app/rss.xml/route.ts - Reader → Subscription endpoint: subscribes
- Subscription endpoint → Upstash Redis: rate limits and stores
app/api/subscribe/route.ts - Subscription endpoint → Subscriber records: adds subscriber
app/api/subscribe/route.ts - Subscription endpoint → Email rendering and sending: sends welcome email
app/api/subscribe/route.ts - Daily digest job → Upstash Redis: reads subscriber list
app/api/cron/daily-digest/route.ts - Daily digest job → Email rendering and sending: sends daily digest
app/api/cron/daily-digest/route.ts - Email rendering and sending → Amazon SES: sends messages
lib/email/send.ts - Email rendering and sending → Email subscriber: delivers email
- Scheduled revalidation → Publish-aware queries: refreshes publish data
app/api/revalidate/route.ts - Scheduled revalidation → Reader: invalidates page output