How transitive-bullshit/severance-wellness-memes works
Main Components
• Client (Browser/User Devices): The entry point that interacts with the frontend.
• Frontend (Next.js Web Application):
• Pages found under src/app (e.g., about, legal, dynamic pages under src/app/o and src/app/x) indicate the visual and navigational components.
• UI components (in src/components) provide elements like headers, footers, interactive elements (e.g., dark mode toggle, animated inputs, hero buttons).
• Backend / API Endpoints:
• API routes such as those under src/app/api/stripe (for handling Stripe-related webhooks) and dynamic API routes for image generation (e.g., src/app/o/[id]/image) handle server-side logic.
• Tasks/Utilities in the src/bin directory (e.g., seeding, generating wellness facts, resolving Twitter users) serve as CLI tools and background tasks.
• Database:
• The prisma directory and the files under src/lib/db indicate that the application uses Prisma as the ORM layer with a PostgreSQL backend.
• External Services and Integrations:
• Twitter: The app fetches Twitter profiles and tweets. Files like src/lib/resolve-twitter-user.ts and the data seeding files show dependency on Twitter data.
• OpenAI: The README and files in src/lib (like generate-wellness-facts.ts and extract-user-full-name.ts) illustrate calls to gpt-4.5 and gpt-4o-mini for text generation.
• Stripe: The API endpoints handling Stripe webhooks and additional Stripe integration logic in src/lib/stripe.ts highlight payment processing.
• Vercel and Dynamic OG Image Generation: With Next.js and the mention of Vercel’s dynamic image generation powered by Satori, there is an on-the-fly image generation component (visible in files like src/app/o/[id]/image/route.tsx).
Architectural Design Principles and Patterns
• The system uses a serverless/edge-like pattern where Next.js API routes act as serverless functions.
• Separation of concerns: Dedicated directories for views (pages), business logic (lib), and utility tools (bin).
• API-driven interactions: Dynamic endpoints (with [id] routes) map to RESTful API handlers that trigger different services.